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
53 CFLAGS = -mpic14 -c -pp$(TARGETPIC)
55 .SUFFIXES: .asm .c .cod .stc
57 # Results of the test are placed here:
60 # Script file for creating gpsim scripts
61 CREATESTC = create_stc
63 # Script file for invoking gpsim
66 # List the C files to be test here:
101 COD := $(patsubst %.c, %.cod, $(SRC))
102 ASM := $(patsubst %.c, %.asm, $(SRC))
103 O := $(patsubst %.c, %.o, $(SRC))
104 STC := $(patsubst %.c, %.stc, $(SRC))
105 HEX := $(patsubst %.c, %.hex, $(SRC))
106 LST := $(patsubst %.c, %.lst, $(SRC))
107 MAP := $(patsubst %.c, %.map, $(SRC))
112 # The asm files are generated by sdcc
116 # The .cod files are generated by gpasm
117 # these get loaded by gpsim.
119 $(LINKER) --map -c -s $(TARGETPIC2).lkr -o $*.o $*.o
123 # gpasm -c -I $(HEADER) $*.asm
126 # The .stc files are script files for gpsim
128 ./$(CREATESTC) $*.cod $*.stc
129 ./$(SIMULATE) $*.stc $(LOGFILE)
131 # this will also make .stc files
135 # now for the dependencies
147 echo "Done - Results are in $(LOGFILE)"
151 for f in $$files ; do \
152 if [ -f $$f ]; then rm $$f; fi \
157 for f in $$files ; do \
158 if [ -f $$f ]; then rm $$f; fi \
163 for f in $$files ; do \
164 if [ -f $$f ]; then rm $$f; fi \
169 for f in $$files ; do \
170 if [ -f $$f ]; then rm $$f; fi \
175 for f in $$files ; do \
176 if [ -f $$f ]; then rm $$f; fi \
181 for f in $$files ; do \
182 if [ -f $$f ]; then rm $$f; fi \
185 clean: cleancod cleanasm cleanstc cleano cleanhex cleanlst
186 if [ -f "$(LOGFILE)" ]; then rm $(LOGFILE); fi