source: EcnlProtoTool/trunk/tcc-0.9.27/tests/tests2/Makefile@ 331

Last change on this file since 331 was 331, checked in by coas-nagasima, 6 years ago

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

File size: 3.4 KB
Line 
1TOP = ../..
2include $(TOP)/Makefile
3SRC = $(TOPSRC)/tests/tests2
4VPATH = $(SRC)
5
6TESTS = $(patsubst %.c,%.test,$(sort $(notdir $(wildcard $(SRC)/*.c))))
7
8# some tests do not pass on all platforms, remove them for now
9SKIP = 34_array_assignment.test # array assignment is not in C standard
10ifeq ($(CONFIG_arm_eabi),yes) # not ARM soft-float
11 SKIP += 22_floating_point.test
12endif
13ifdef CONFIG_OSX
14 SKIP += 40_stdio.test 42_function_pointer.test
15 FLAGS += -w
16endif
17ifeq ($(ARCH),x86_64)
18 SKIP += 73_arm64.test
19endif
20ifeq (,$(filter i386,$(ARCH)))
21 SKIP += 98_al_ax_extend.test 99_fastcall.test
22endif
23ifeq (,$(filter i386 x86_64,$(ARCH)))
24 SKIP += 85_asm-outside-function.test
25endif
26ifeq (-$(findstring gcc,$(CC))-,--)
27 SKIP += $(patsubst %.expect,%.test,$(GEN-ALWAYS))
28endif
29ifeq (-$(CONFIG_WIN32)-$(CONFIG_i386)$(CONFIG_arm)-,--yes-)
30 SKIP += 95_bitfields%.test # type_align is different on 32bit-non-windows
31endif
32
33# Some tests might need arguments
34ARGS =
3531_args.test : ARGS = arg1 arg2 arg3 arg4 arg5
3646_grep.test : ARGS = '[^* ]*[:a:d: ]+\:\*-/: $$' $(SRC)/46_grep.c
37
38# And some tests don't test the right thing with -run
39NORUN =
4042_function_pointer.test : NORUN = true
41
42# Some tests might need different flags
43FLAGS =
4476_dollars_in_identifiers.test : FLAGS += -fdollars-in-identifiers
45
46# These tests run several snippets from the same file one by one
4760_errors_and_warnings.test : FLAGS += -dt
4896_nodata_wanted.test : FLAGS += -dt
49
50# Always generate certain .expects (don't put these in the GIT),
51GEN-ALWAYS =
52# GEN-ALWAYS += 95_bitfields.expect # does not work
53
54# using the ms compiler for the really ms-compatible bitfields
5595_bitfields_ms.test : GEN = $(GEN-MSC)
56
57# Filter source directory in warnings/errors (out-of-tree builds)
58FILTER = 2>&1 | sed 's,$(SRC)/,,g'
59# Filter some always-warning
60ifeq (-$(findstring arm,$(ARCH))-,-arm-)
61FILTER += 2>&1 | grep -v 'warning: soft float ABI currently not supported'
62endif
63
64all test tests2.all: $(filter-out $(SKIP),$(TESTS)) ;
65
66%.test: %.c %.expect
67 @echo Test: $*...
68 @$(if $(NORUN),$(T1),$(T2)) $(if $(NODIFF),,$(T3))
69
70T1 = $(TCC) $(FLAGS) $< -o a.exe && ./a.exe $(ARGS)
71T2 = $(TCC) $(FLAGS) -run $< $(ARGS)
72T3 = $(FILTER) >$*.output 2>&1 || true \
73 && diff -Nbu $(filter %.expect,$^) $*.output \
74 && rm -f $*.output $(filter $*.expect,$(GEN-ALWAYS))
75
76# run single test and update .expect file, e.g. "make tests2.37+"
77tests2.%+:
78 @$(MAKE) $(call F2,$(call F1,$*)) --no-print-directory
79
80# just run tcc to see the output, e.g. "make tests2.37-"
81tests2.%-:
82 @$(MAKE) $(call F1,$*) NODIFF=true --no-print-directory
83
84# run single test, e.g. "make tests2.37"
85tests2.%:
86 @$(MAKE) $(call F1,$*) --no-print-directory
87
88F1 = $(or $(filter $1_%,$(TESTS)),$1_???.test)
89F2 = $1 UPDATE="$(patsubst %.test,%.expect,$1)"
90
91# automatically generate .expect files with gcc:
92%.expect :
93 @echo Generating: $@
94 @$(call GEN,$(SRC)/$*.c) $(FILTER) >$@ 2>&1
95 @rm -f *.exe *.obj *.pdb
96
97# using TCC for .expect if -dt in FLAGS
98GEN = $(if $(filter -dt,$(FLAGS)),$(GEN-TCC),$(GEN-CC))
99GEN-CC = $(CC) -w -std=gnu99 $(FLAGS) $1 -o a.exe && ./a.exe $(ARGS)
100GEN-TCC = $(TCC) $(FLAGS) -run $1 $(ARGS)
101GEN-MSC = $(MS-CC) $1 && ./$(basename $@).exe
102MS-CC = cl
103
104# tell make not to delete
105.PRECIOUS: %.expect
106
107# force .expect generation for these files
108$(sort $(GEN-ALWAYS) $(UPDATE)) : force
109force:
110
111clean:
112 rm -f fred.txt *.output a.exe $(GEN-ALWAYS)
Note: See TracBrowser for help on using the repository browser.