2 include $(TOP
)/Makefile
4 # run local version of tcc with local libraries and includes
5 TCCFLAGS
= -B
$(TOP
) -I
$(TOP
)
7 TCCFLAGS
= -B
$(TOP
)/win32
-I
$(TOP
)/include -I
$(TOP
) -L
$(TOP
)
9 TCC
= $(TOP
)/tcc
$(TCCFLAGS
)
11 TESTS
= $(patsubst %.c
,%.
test,$(sort $(wildcard *.c
)))
13 # 34_array_assignment.test -- array assignment is not in C standard
14 SKIP
= 34_array_assignment.
test
16 # some tests do not pass on all platforms, remove them for now
17 ifeq ($(CONFIG_arm_eabi
),yes
) # not ARM soft-float
18 SKIP
+= 22_floating_point.
test
20 ifeq ($(TARGETOS
),Darwin
)
24 SKIP
+= 24_math_library.
test # don't have round()
25 SKIP
+= 28_strings.
test # don't have r/index() / strings.h
30 ifeq (,$(filter i386 x86-64
,$(ARCH
)))
31 SKIP
+= 85-asm-outside-function.
test
34 # Some tests might need arguments
36 31_args.
test : ARGS
= arg1 arg2 arg3 arg4 arg5
37 46_grep.
test : ARGS
= '[^* ]*[:a:d: ]+\:\*-/: $$' 46_grep.c
39 # Some tests might need different flags
40 76_dollars_in_identifiers.
test : TCCFLAGS
+= -fdollars-in-identifiers
42 # Filter some always-warning
44 ifeq (-$(findstring arm
,$(ARCH
))-,-arm-
)
45 FILTER
= 2>&1 | grep
-v
'warning: soft float ABI currently not supported'
48 all test: $(filter-out $(SKIP
),$(TESTS
))
53 @
$(TCC
) -run
$< $(ARGS
) $(FILTER
) >$*.output
2>&1 || true
54 @diff
-Nbu
$*.expect
$*.output
&& rm -f
$*.output
55 # test exe (disabled for speed)
56 # @($(TCC) $(FLAGS) $< -o $*.exe && ./$*.exe $(ARGS)) $(FiLTER) >$*.output2 2>&1 ; \
57 # diff -Nbu $*.expect $*.output2 && rm -f $*.output2 $*.exe
59 # automatically generate .expect files with gcc:
61 (gcc
$*.c
-o a.exe
&& .
/a.exe
$(ARGS
)) >$*.expect
2>&1; rm -f a.exe
63 # tell make not to delete
67 rm -f fred.txt
*.output a.exe