aboutsummaryrefslogtreecommitdiff
path: root/core/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'core/Makefile')
-rw-r--r--core/Makefile42
1 files changed, 42 insertions, 0 deletions
diff --git a/core/Makefile b/core/Makefile
new file mode 100644
index 0000000..468d260
--- /dev/null
+++ b/core/Makefile
@@ -0,0 +1,42 @@
+-include ../../config.mk
+
+SRC = $(wildcard ccan/*/*.c)
+CFLAGS += -I. -I../..
+
+test: text buffer map array
+ @./text
+ @./buffer
+ @./map
+ @./array
+
+config.h:
+ @echo Generating ccan configuration header
+ @${CC} ccan-config.c && ./a.out > config.h && rm -f a.out
+
+text: config.h text.c ../../text.c ../../text-util.c
+ @echo Compiling $@ binary
+ @${CC} ${CFLAGS} ${CFLAGS_STD} ${filter %.c, $^} ${SRC} ${LDFLAGS} -o $@
+
+buffer: config.h buffer.c ../../buffer.c
+ @echo Compiling $@ binary
+ @${CC} ${CFLAGS} ${CFLAGS_STD} ${filter %.c, $^} ${SRC} ${LDFLAGS} -o $@
+
+map: config.h map.c ../../map.c
+ @echo Compiling $@ binary
+ @${CC} ${CFLAGS} ${CFLAGS_STD} ${filter %.c, $^} ${SRC} ${LDFLAGS} -o $@
+
+array: config.h array.c ../../array.c
+ @echo Compiling $@ binary
+ @${CC} ${CFLAGS} ${CFLAGS_STD} ${filter %.c, $^} ${SRC} ${LDFLAGS} -o $@
+
+debug: clean
+ $(MAKE) CFLAGS_VIS='${DEBUG_CFLAGS_VIS}'
+
+clean:
+ @echo cleaning
+ @rm -f text
+ @rm -f buffer
+ @rm -f map
+ @rm -f array
+
+.PHONY: clean debug