kocotian.pl

My personal webpage sources
git clone git://git.kocotian.pl/kocotian.pl.git
Log | Files | Refs | README | LICENSE

commit 81bcc00e1663f12abd6ab53f6ac1ac5189ed228b
parent 93138d39224bf92731215e8e4c9be0caf6ae6501
Author: kocotian <kocotian@kocotian.pl>
Date:   Sat, 20 Mar 2021 16:45:13 +0100

Makefile

Diffstat:
AMakefile | 39+++++++++++++++++++++++++++++++++++++++
Aconfig.mk | 16++++++++++++++++
2 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile @@ -0,0 +1,39 @@ +# == Section 0: Includes == + +include config.mk + +# == Section 1: Generating a generator == + +SRCLIB = util.c +OBJLIB = ${SRCLIB:.c=.o} + +SRC = generate.c +BIN = ${SRC:.c=} + +all: options ${BIN} + +options: + @echo build options: + @echo "CFLAGS = ${CFLAGS}" + @echo "CPPFLAGS = ${CPPFLAGS}" + @echo "LDFLAGS = ${LDFLAGS}" + @echo "CC = ${CC}" + +${BIN}: ${SRC} + +${BIN}: ${OBJLIB} + +${OBJLIB}: ${SRCLIB} + +%.o: %.c + ${CC} ${CCFLAGS} -c -o $@ $< + +%: %.c ${OBJLIB} + ${CC} ${CCFLAGS} ${LDFLAGS} -o $@ $^ + +clean: + rm -f ${OBJLIB} ${BIN} + +.PHONY: all clean + +# == Section 2: Generating pages == diff --git a/config.mk b/config.mk @@ -0,0 +1,16 @@ +# basics +MAJORVERSION = 0 +SUBVERSION = 0 +PATCHLEVEL = 1 +BUILDNAME = vanilla + +VERSION = ${MAJORVERSION}.${SUBVERSION}.${PATCHLEVEL}-${BUILDNAME} + +# flags +CFLAGS = -std=c99 -Wall -Wextra -pedantic -Ofast +CPPFLAGS = -D_XOPEN_SOURCE=700 -DVERSION=\"${VERSION}\" +LDFLAGS = -Ofast -static +CCFLAGS = ${CFLAGS} ${CPPFLAGS} + +# compiler +CC = cc