1 -include ..
/..
/config.mk
3 ALL
= buffer-test map-test array-test text-test
4 SRC
= $(wildcard ccan
/*/*.c
)
5 CFLAGS
+= -I.
-I..
/..
-DBUFFER_SIZE
=4 -DBLOCK_SIZE
=4
14 @echo Generating ccan configuration header
15 @
${CC} ccan-config.c
-o ccan-config
&& .
/ccan-config
> config.h
17 text-test
: config.h text-test.c ..
/..
/text.c ..
/..
/text-common.c ..
/..
/text-io.c ..
/..
/text-iterator.c ..
/..
/text-util.c ..
/..
/text-motions.c ..
/..
/text-objects.c ..
/..
/text-regex.c ..
/..
/array.c
18 @echo Compiling
$@ binary
19 @
${CC} ${CFLAGS} ${CFLAGS_STD} ${CFLAGS_LIBC} ${CFLAGS_EXTRA} ${filter %.c
, $^
} ${SRC} ${LDFLAGS} -o
$@
21 buffer-test
: config.h buffer-test.c ..
/..
/buffer.c
22 @echo Compiling
$@ binary
23 @
${CC} ${CFLAGS} ${CFLAGS_STD} ${CFLAGS_LIBC} ${CFLAGS_EXTRA} ${filter %.c
, $^
} ${SRC} ${LDFLAGS} -o
$@
25 map-test
: config.h map-test.c ..
/..
/map.c
26 @echo Compiling
$@ binary
27 @
${CC} ${CFLAGS} ${CFLAGS_STD} ${CFLAGS_LIBC} ${CFLAGS_EXTRA} ${filter %.c
, $^
} ${SRC} ${LDFLAGS} -o
$@
29 array-test
: config.h array-test.c ..
/..
/array.c
30 @echo Compiling
$@ binary
31 @
${CC} ${CFLAGS} ${CFLAGS_STD} ${CFLAGS_LIBC} ${CFLAGS_EXTRA} ${filter %.c
, $^
} ${SRC} ${LDFLAGS} -o
$@
34 $(MAKE
) CFLAGS_EXTRA
='${CFLAGS_EXTRA} ${CFLAGS_DEBUG}'
37 $(MAKE
) CFLAGS_EXTRA
='--coverage'
40 $(MAKE
) CFLAGS_EXTRA
='-fsanitize=address'
43 $(MAKE
) CFLAGS_EXTRA
='-fsanitize=undefined'
46 $(MAKE
) CFLAGS_EXTRA
='-fsanitize=memory -fsanitize-memory-track-origins'
48 valgrind
: clean ${ALL}
49 @for
test in
${ALL}; do \
50 valgrind
--leak-check
=full
--log-file
="$$test.valgrind" "./$$test"; \
51 cat
"$$test.valgrind"; \
52 grep LEAK
"$$test.valgrind" >/dev
/null
&& exit
1 || true
; \
56 $(MAKE
) CC
="tis-interpreter.sh --cc" CFLAGS
='"${CFLAGS} ${CFLAGS_STD} -DHAVE_MEMRCHR=0 -DTIS_INTERPRETER=1"' CFLAGS_STD
='' CFLAGS_LIBC
='' LDFLAGS
='#' $(ALL
)
60 @
rm -f ccan-config config.h
61 @
rm -f data symlink hardlink
63 @
rm -f
*.gcov
*.gcda
*.gcno
66 .PHONY
: clean debug coverage tis valgrind asan ubsan msan