* src/regression/ptrarg.c: added, fails due to bug #1430967
[fw/sdcc] / src / regression / Makefile
1 # Regression testing Makefile for Pic Port of SDCC
2 #
3 # note that this regression suite was started before
4 # the one in sdcc/regression. The regression suite in
5 # sdcc/regression is better suited for testing mature
6 # ports.
7 #
8 # GPL'd
9 #
10 # T. Scott Dattalo scott@dattalo.com
11 #
12 # This makefile provides a means by which the output
13 # of the SDCC Compiler can be tested. This version
14 # is unique to the PIC (as in Microchip PIC) port.
15 # As such it requires the following software:
16 #
17 #  gpasm version 0.11.1 (or greater)
18 #  gpsim version 0.20.7 (or greater)
19 #
20 # Usage:
21 #
22 # make
23 #  - without any options the whole regression test is
24 #    performed. The results are placed into a log file
25 #    (defined by $LOGFILE).
26 #
27 # make asm
28 #  - Creates .asm files by compiling the .c files
29 #
30 # make cod
31 #  - Creates .cod files by assembling the .asm files
32 #    (.cod files are symbolic files compatible with
33 #    MPASM, Microchip's assembler)
34 #
35 # make stc
36 #  - Creates .stc files which are script files for
37 #    gpsim.
38 #
39 # make clean
40 #  - removes all of the intermediate files created
41 #
42 # make cleancod
43 # make cleanasm
44 # make cleanstc
45 # make cleano
46 #  - removes either the .stc, .asm, .cod or .o files
47
48 # verboseness
49 #Q ?= # be verbose
50 Q ?= @ # be quiet
51
52 CC = sdcc
53 LINKER = gplink
54 TARGETPIC = 16f877
55 CFLAGS = -Wl,--map -I ../../device/include/pic -mpic14 -pp$(TARGETPIC)
56
57 .SUFFIXES: .asm .c .cod .stc
58
59 # Results of the test are placed here:
60 LOGFILE = test.log
61
62 # Script file for creating gpsim scripts
63 CREATESTC = create_stc
64
65 # Script file for invoking gpsim
66 SIMULATE = simulate
67
68 # List the C files to be test here:
69 SRC = b.c \
70         add.c \
71         add2.c \
72         add3.c \
73         and1.c \
74         and2.c \
75         b.c \
76         bool1.c \
77         bool2.c \
78         bool3.c \
79         call1.c \
80         compare.c \
81         compare2.c \
82         compare3.c \
83         compare4.c \
84         compare5.c \
85         compare6.c \
86         for.c \
87         inline.c \
88         nestfor.c \
89         or1.c \
90         ptrarg.c \
91         ptrfunc.c \
92         rotate1.c \
93         rotate2.c \
94         rotate3.c \
95         rotate4.c \
96         rotate5.c \
97         sub.c \
98         sub2.c \
99         switch1.c \
100         while.c \
101         xor.c
102 #       arrays.c \
103 #       add4.c \
104 #       bank1.c \
105 #       compare7.c \
106 #       compare8.c \
107 #       compare9.c \
108 #       compare10.c \
109 #       configword.c \
110 #       mult1.c \
111 #       pointer1.c \
112 #       rotate6.c \
113 #       rotate7.c \
114 #       string1.c \
115 #       struct1.c \
116
117 COD := $(patsubst %.c, %.cod, $(SRC))
118 ASM := $(patsubst %.c, %.asm, $(SRC))
119 O := $(patsubst %.c, %.o, $(SRC))
120 STC := $(patsubst %.c, %.stc, $(SRC))
121 HEX := $(patsubst %.c, %.hex, $(SRC))
122 LST := $(patsubst %.c, %.lst, $(SRC))
123 MAP := $(patsubst %.c, %.map, $(SRC))
124
125 all:    test
126
127
128 # The cod files are generated by sdcc
129 .c.cod:
130         $(Q)$(CC) $(CFLAGS) $*.c
131
132 # The .stc files are script files for gpsim
133 .cod.stc:
134         $(Q)./$(CREATESTC) $*.cod $*.stc
135         $(Q)./$(SIMULATE) $*.stc $(LOGFILE)
136
137 # this will also make .stc files
138 #%.stc : %.cod
139 #       ./create_stc $^ $@
140
141 # now for the dependencies
142
143 cod : $(COD)
144
145 o : $(O)
146
147 asm : $(ASM)
148
149 stc : $(STC)
150         echo $(STC)
151
152 test:   $(STC)
153         $(Q)echo "Done - Results are in $(LOGFILE)"
154
155 cleancod:
156         files="$(COD)" ; \
157         for f in $$files ; do \
158           if [ -f $$f ]; then rm $$f; fi \
159         done ; \
160
161 cleano:
162         files="$(O)" ; \
163         for f in $$files ; do \
164           if [ -f $$f ]; then rm $$f; fi \
165         done ; \
166
167 cleanasm:
168         files="$(ASM)" ; \
169         for f in $$files ; do \
170           if [ -f $$f ]; then rm $$f; fi \
171         done ; \
172
173 cleanstc:
174         files="$(STC)" ; \
175         for f in $$files ; do \
176           if [ -f $$f ]; then rm $$f; fi \
177         done ; \
178
179 cleanhex:
180         files="$(HEX)" ; \
181         for f in $$files ; do \
182           if [ -f $$f ]; then rm $$f; fi \
183         done ; \
184
185 cleanlst:
186         files="$(LST)" ; \
187         for f in $$files ; do \
188           if [ -f $$f ]; then rm $$f; fi \
189         done ; \
190
191 clean: cleancod cleanasm cleanstc cleano cleanhex cleanlst
192         if [ -f "$(LOGFILE)" ]; then rm $(LOGFILE); fi