Static template generator for C
git clone git://soophie.de/ductape
blob: 720ba416697629edd3b0629e0a71d33ad0c69fc7 (832 bytes)[doc][blame][raw]
1
CC := cc2
CFLAGS := -Wall -Wextra -Werror -pedantic3
CFLAGS_RELEASE := -O2 -DNDEBUG4
CFLAGS_DEBUG := -g3 -O05
CCHECK=-I. -x c - -fsyntax-only6
# NOTE: exposes header impls into dynamically linked modules7
LDFLAGS :=8
LDLIBS :=9
DEPS := \10
-I$(HOME)/git/buf/src11
SOURCE := \12
src/main.c13
TARGET := ductape15
all: build17
build: $(SOURCE)18
$(CC) -o $(TARGET) $(CFLAGS) $(DEPS) $(LDFLAGS) $^ $(LDLIBS)20
build-release: $(SOURCE)21
$(CC) -o $(TARGET) $(CFLAGS) $(DEPS) $(CFLAGS_RELEASE) $(LDFLAGS) $^ $(LDLIBS)23
build-debug: $(SOURCE)24
$(CC) -o $(TARGET) $(CFLAGS) $(DEPS) $(CFLAGS_DEBUG) $(LDFLAGS) $^ $(LDLIBS)26
clean:27
rm -f ./$(TARGET)29
install: build-release30
cp $(TARGET) /usr/local/bin/31
cp src/ductape.h /usr/local/include/32
rm ./$(TARGET)34
check: src/ductape.h35
@printf '#define DUCTAPE_IMPL\n#include "%s"' "$^" | $(CC) $(CFLAGS) $(CCHECK)