1 # Regression testing Makefile for Pic Port of SDCC
5 # T. Scott Dattalo scott@dattalo.com
7 # This makefile provides a means by which the output
8 # of the SDCC Compiler can be tested. This version
9 # is unique to the PIC (as in Microchip PIC) port.
10 # As such it requires the following software:
12 # gpasm version 0.8.10 (or greater)
13 # gpsim version 0.20.7 (or greater)
18 # - without any options the whole regression test is
19 # performed. The results are placed into a log file
20 # (defined by $LOGFILE).
23 # - Creates .asm files by compiling the .c files
26 # - Creates .cod files by assembling the .asm files
27 # (.cod files are symbolic files compatible with
28 # MPASM, Microchip's assembler)
31 # - Creates .stc files which are script files for
35 # - removes all of the intermediate files created
40 # - removes either the .stc, .asm, or .cod files
45 .SUFFIXES: .asm .c .cod .stc
47 # Results of the test are placed here:
50 # Script file for creating gpsim scripts
51 CREATESTC = create_stc
53 # Script file for invoking gpsim
56 # List the C files to be test here:
80 COD := $(patsubst %.c, %.cod, $(SRC))
81 ASM := $(patsubst %.c, %.asm, $(SRC))
82 STC := $(patsubst %.c, %.stc, $(SRC))
87 # The asm files are generated by sdcc
91 # The .cod files are generated by gpasm
92 # these get loaded by gpsim.
96 # The .stc files are script files for gpsim
98 ./$(CREATESTC) $*.cod $*.stc
100 # this will also make .stc files
104 # now for the dependencies
114 if [ -n "$(STC)" ]; then \
115 stcfiles="$(STC)" ; \
116 for f in $$stcfiles ; do \
117 ./$(SIMULATE) $$f $(LOGFILE); \
120 echo "Done - Results are in $(LOGFILE)"
124 for f in $$files ; do \
125 if [ -f $$f ]; then rm $$f; fi \
130 for f in $$files ; do \
131 if [ -f $$f ]; then rm $$f; fi \
136 for f in $$files ; do \
137 if [ -f $$f ]; then rm $$f; fi \
140 clean: cleancod cleanasm cleanstc
141 if [ -f "$(LOGFILE)" ]; then rm $(LOGFILE); fi