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.8.10 (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
45 # - removes either the .stc, .asm, or .cod files
50 HEADER=/usr/local/share/gpasm/header
52 .SUFFIXES: .asm .c .cod .stc
54 # Results of the test are placed here:
57 # Script file for creating gpsim scripts
58 CREATESTC = create_stc
60 # Script file for invoking gpsim
63 # List the C files to be test here:
93 COD := $(patsubst %.c, %.cod, $(SRC))
94 ASM := $(patsubst %.c, %.asm, $(SRC))
95 STC := $(patsubst %.c, %.stc, $(SRC))
100 # The asm files are generated by sdcc
102 $(CC) -mpic14 -S $*.c
104 # The .cod files are generated by gpasm
105 # these get loaded by gpsim.
107 gpasm -c -I $(HEADER) $*.asm
109 # The .stc files are script files for gpsim
111 ./$(CREATESTC) $*.cod $*.stc
112 ./$(SIMULATE) $*.stc $(LOGFILE)
114 # this will also make .stc files
118 # now for the dependencies
128 echo "Done - Results are in $(LOGFILE)"
132 for f in $$files ; do \
133 if [ -f $$f ]; then rm $$f; fi \
138 for f in $$files ; do \
139 if [ -f $$f ]; then rm $$f; fi \
144 for f in $$files ; do \
145 if [ -f $$f ]; then rm $$f; fi \
148 clean: cleancod cleanasm cleanstc
149 if [ -f "$(LOGFILE)" ]; then rm $(LOGFILE); fi