1 # Regression testing Makefile for Pic Port of SDCC
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
10 # T. Scott Dattalo scott@dattalo.com
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:
17 # gpasm version 0.11.1 (or greater)
18 # gpsim version 0.20.7 (or greater)
23 # - without any options the whole regression test is
24 # performed. The results are placed into a log file
25 # (defined by $LOGFILE).
28 # - Creates .asm files by compiling the .c files
31 # - Creates .cod files by assembling the .asm files
32 # (.cod files are symbolic files compatible with
33 # MPASM, Microchip's assembler)
36 # - Creates .stc files which are script files for
40 # - removes all of the intermediate files created
46 # - removes either the .stc, .asm, .cod or .o files
55 CFLAGS = -Wl,--map -I ../../device/include/pic -L ../../device/lib/pic/bin -mpic14 -pp$(TARGETPIC) -Wl,-q --no-pcode-opt
57 .SUFFIXES: .asm .c .cod .stc
59 # Results of the test are placed here:
62 # Script file for creating gpsim scripts
63 CREATESTC = create_stc
65 # Script file for invoking gpsim
68 # List the C files to be test here:
117 COD := $(patsubst %.c, %.cod, $(SRC))
118 ASM := $(patsubst %.c, %.asm, $(SRC))
119 O := $(patsubst %.c, %.o, $(SRC))
120 P := $(patsubst %.c, %.p, $(SRC))
121 STC := $(patsubst %.c, %.stc, $(SRC))
122 HEX := $(patsubst %.c, %.hex, $(SRC))
123 LST := $(patsubst %.c, %.lst, $(SRC))
124 MAP := $(patsubst %.c, %.map, $(SRC))
129 # The cod files are generated by sdcc
131 $(Q)-$(CC) $(CFLAGS) $*.c
133 # The .stc files are script files for gpsim
135 $(Q)-./$(CREATESTC) $*.cod $*.stc
136 $(Q)-./$(SIMULATE) $*.stc $(LOGFILE)
138 # this will also make .stc files
142 # now for the dependencies
154 $(Q)echo "Done - Results are in $(LOGFILE)"
158 for f in $$files ; do \
159 if [ -f $$f ]; then rm $$f; fi \
164 for f in $$files ; do \
165 if [ -f $$f ]; then rm $$f; fi \
170 for f in $$files ; do \
171 if [ -f $$f ]; then rm $$f; fi \
176 for f in $$files ; do \
177 if [ -f $$f ]; then rm $$f; fi \
182 for f in $$files ; do \
183 if [ -f $$f ]; then rm $$f; fi \
188 for f in $$files ; do \
189 if [ -f $$f ]; then rm $$f; fi \
194 for f in $$files ; do \
195 if [ -f $$f ]; then rm $$f; fi \
200 for f in $$files ; do \
201 if [ -f $$f ]; then rm $$f; fi \
204 clean: cleancod cleanasm cleanstc cleano cleanp cleanhex cleanlst cleanmap
205 if [ -f "$(LOGFILE)" ]; then rm $(LOGFILE); fi