aboutsummaryrefslogtreecommitdiff
path: root/core/Makefile
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-04-19 14:10:13 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-04-19 14:10:13 +0200
commit2e102a11afe9b256f0f9cf5391faf445fd40430a (patch)
treefcf8f6f4e2b7832bed9c380bf49bcc491ca06292 /core/Makefile
downloadvis-2e102a11afe9b256f0f9cf5391faf445fd40430a.tar.gz
vis-2e102a11afe9b256f0f9cf5391faf445fd40430a.tar.xz
Initial import of test branch from vis repository
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