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
52 CFLAGS = -mpic14 -c -pp$(TARGETPIC)
54 .SUFFIXES: .asm .c .cod .stc
56 # Results of the test are placed here:
59 # Script file for creating gpsim scripts
60 CREATESTC = create_stc
62 # Script file for invoking gpsim
65 # List the C files to be test here:
100 COD := $(patsubst %.c, %.cod, $(SRC))
101 ASM := $(patsubst %.c, %.asm, $(SRC))
102 O := $(patsubst %.c, %.o, $(SRC))
103 STC := $(patsubst %.c, %.stc, $(SRC))
104 HEX := $(patsubst %.c, %.hex, $(SRC))
105 LST := $(patsubst %.c, %.lst, $(SRC))
106 MAP := $(patsubst %.c, %.map, $(SRC))
111 # The asm files are generated by sdcc
115 # The .cod files are generated by gpasm
116 # these get loaded by gpsim.
118 $(LINKER) --map -c -s $(TARGETPIC).lkr -o $*.o $*.o
122 # gpasm -c -I $(HEADER) $*.asm
125 # The .stc files are script files for gpsim
127 ./$(CREATESTC) $*.cod $*.stc
128 ./$(SIMULATE) $*.stc $(LOGFILE)
130 # this will also make .stc files
134 # now for the dependencies
145 echo "Done - Results are in $(LOGFILE)"
149 for f in $$files ; do \
150 if [ -f $$f ]; then rm $$f; fi \
155 for f in $$files ; do \
156 if [ -f $$f ]; then rm $$f; fi \
161 for f in $$files ; do \
162 if [ -f $$f ]; then rm $$f; fi \
167 for f in $$files ; do \
168 if [ -f $$f ]; then rm $$f; fi \
173 for f in $$files ; do \
174 if [ -f $$f ]; then rm $$f; fi \
179 for f in $$files ; do \
180 if [ -f $$f ]; then rm $$f; fi \
183 clean: cleancod cleanasm cleanstc cleano cleanhex cleanlst
184 if [ -f "$(LOGFILE)" ]; then rm $(LOGFILE); fi