forked from cjlano/tinyprintf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (30 loc) · 986 Bytes
/
Makefile
File metadata and controls
39 lines (30 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
CPPFLAGS+=-I.
CFLAGS+=-Wall -W -Wextra -O3 -g
# RUNNER:=valgrind
.PHONY: all test tests compiletests runtests clean
all: tests
test tests: compiletests runtests
runtests: test/printf test/sprintf
set -x ; for prg in $^ ; do $(RUNNER) $$prg || exit $$? ; done
compiletests:
$(COMPILE.c) \
-DTINYPRINTF_DEFINE_TFP_PRINTF=0 \
-DTINYPRINTF_DEFINE_TFP_SPRINTF=0 \
-DTINYPRINTF_OVERRIDE_LIBC=0 \
-o tinyprintf_minimal.o tinyprintf.c
$(COMPILE.c) \
-DTINYPRINTF_DEFINE_TFP_PRINTF=1 \
-DTINYPRINTF_DEFINE_TFP_SPRINTF=0 \
-DTINYPRINTF_OVERRIDE_LIBC=0 \
-o tinyprintf_only_tfp_printf.o tinyprintf.c
$(COMPILE.c) \
-DTINYPRINTF_DEFINE_TFP_PRINTF=0 \
-DTINYPRINTF_DEFINE_TFP_SPRINTF=1 \
-DTINYPRINTF_OVERRIDE_LIBC=0 \
-o tinyprintf_only_tfp_sprintf.o tinyprintf.c
test/printf: test/printf.o tinyprintf.o
$(LINK.c) -o $@ $^
test/sprintf: test/sprintf.o tinyprintf.o
$(LINK.c) -o $@ $^
clean:
$(RM) *.o test/*.o *~ test/*~ test/printf test/sprintf