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 CC = $(SDCC_BIN)/bin/sdcc
58 ifeq ($(strip $(filter 1 yes,$(USE_PIC16))),)
61 CFLAGS = -mpic14 -p$(TARGETPIC)
65 CFLAGS = -mpic16 -p$(TARGETPIC)
70 CFLAGS += -I $(SDCC_SRC)/device/include/$(DIR)
71 CFLAGS += -L $(SDCC_BIN)/device/lib/$(DIR)/bin
72 #CFLAGS += --no-pcode-opt
75 .SUFFIXES: .asm .c .cod .stc
78 # Results of the test are placed here:
81 # Script file for creating gpsim scripts
82 CREATESTC = create_stc
84 # Script file for invoking gpsim
87 # List the C files to be test here:
138 COD := $(patsubst %.c, %.cod, $(SRC))
139 ASM := $(patsubst %.c, %.asm, $(SRC))
140 O := $(patsubst %.c, %.o, $(SRC))
141 P := $(patsubst %.c, %.p, $(SRC))
142 STC := $(patsubst %.c, %.stc, $(SRC))
143 HEX := $(patsubst %.c, %.hex, $(SRC))
144 LST := $(patsubst %.c, %.lst, $(SRC))
145 MAP := $(patsubst %.c, %.map, $(SRC))
150 # The cod files are generated by sdcc
152 $(Q)-$(CC) $(CFLAGS) $*.c
154 # The .stc files are script files for gpsim
156 $(Q)-./$(CREATESTC) $*.cod $*.stc
157 $(Q)-./$(SIMULATE) $*.stc $(LOGFILE)
159 # this will also make .stc files
163 # now for the dependencies
175 $(Q)echo "Done - Results are in $(LOGFILE)"
179 for f in $$files ; do \
180 if [ -f $$f ]; then rm $$f; fi \
185 for f in $$files ; do \
186 if [ -f $$f ]; then rm $$f; fi \
191 for f in $$files ; do \
192 if [ -f $$f ]; then rm $$f; fi \
197 for f in $$files ; do \
198 if [ -f $$f ]; then rm $$f; fi \
203 for f in $$files ; do \
204 if [ -f $$f ]; then rm $$f; fi \
209 for f in $$files ; do \
210 if [ -f $$f ]; then rm $$f; fi \
215 for f in $$files ; do \
216 if [ -f $$f ]; then rm $$f; fi \
221 for f in $$files ; do \
222 if [ -f $$f ]; then rm $$f; fi \
225 clean: cleancod cleanasm cleanstc cleano cleanp cleanhex cleanlst cleanmap
226 if [ -f "$(LOGFILE)" ]; then rm $(LOGFILE); fi