2 include $(TOP
)/Makefile
4 # clear CFLAGS and LDFLAGS
9 TCCFLAGS
= -B
$(top_srcdir
)/win32
-I
$(top_srcdir
)/include -L
$(TOP
)
11 TCCFLAGS
= -B
$(TOP
) -I
$(top_srcdir
)/include -lm
14 ifeq ($(TARGETOS
),Darwin
)
15 CFLAGS
+= -Wl
,-flat_namespace
,-undefined
,warning
16 TCCFLAGS
+= -D_ANSI_SOURCE
17 export MACOSX_DEPLOYMENT_TARGET
:=10.2
20 TCC
= $(TOP
)/tcc
$(TCCFLAGS
)
22 TESTS
= $(patsubst %.c
,%.
test,$(wildcard *.c
))
24 # 34_array_assignment.test -- array assignment is not in C standard
25 SKIP
= 34_array_assignment.
test
27 # some tests do not pass on all platforms, remove them for now
28 ifeq ($(CONFIG_arm_eabi
),yes
) # not ARM soft-float
29 SKIP
+= 22_floating_point.
test
31 ifeq ($(TARGETOS
),Darwin
)
35 SKIP
+= 24_math_library.
test # don't have round()
36 SKIP
+= 28_strings.
test # don't have r/index() / strings.h
42 # Some tests might need arguments
44 31_args.
test : ARGS
= arg1 arg2 arg3 arg4 arg5
45 46_grep.
test : ARGS
= '[^* ]*[:a:d: ]+\:\*-/: $$' 46_grep.c
47 # Some tests might need different flags
49 76_dollars_in_identifiers.
test : FLAGS
= -fdollars-in-identifiers
51 # Filter some always-warning
53 ifeq (-$(findstring arm
,$(ARCH
))-,-arm-
)
54 FILTER
= 2>&1 | grep
-v
'warning: soft float ABI currently not supported'
57 all test: $(filter-out $(SKIP
),$(TESTS
))
62 @
$(TCC
) $(FLAGS
) -run
$< $(ARGS
) $(FILTER
) >$*.output
2>&1 || true
63 @diff
-Nbu
$*.expect
$*.output
&& rm -f
$*.output
64 # test exe (disabled for speed)
65 # @($(TCC) $(FLAGS) $< -o $*.exe && ./$*.exe $(ARGS)) $(FiLTER) >$*.output2 2>&1 ; \
66 # diff -Nbu $*.expect $*.output2 && rm -f $*.output2 $*.exe
68 # automatically generate .expect files with gcc:
70 (gcc
$*.c
-o a.exe
&& .
/a.exe
$(ARGS
)) >$*.expect
2>&1; rm -f a.exe
72 # tell make not to delete
76 rm -vf fred.txt
*.output a.exe