X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fregression%2FMakefile;h=4a5468a884a31ddbf73377a96621276068126f27;hb=80972b2e54c9b88f11c27b878874fd2a6a681391;hp=c072227d0e7071899cf4838a2231cbbac5cef3b6;hpb=6d080aabf22676ff1d378afc6de668099ee9da6f;p=fw%2Fsdcc diff --git a/src/regression/Makefile b/src/regression/Makefile index c072227d..4a5468a8 100644 --- a/src/regression/Makefile +++ b/src/regression/Makefile @@ -49,12 +49,31 @@ #Q ?= # be verbose Q ?= @ # be quiet -CC = sdcc +SDCC_SRC=../.. +SDCC_BIN=../.. + +CC = $(SDCC_BIN)/bin/sdcc LINKER = gplink +USE_PIC16 ?= 0 +ifeq ($(strip $(filter 1 yes,$(USE_PIC16))),) TARGETPIC = 16f877 -CFLAGS = -I ../../device/include/pic -mpic14 -c -pp$(TARGETPIC) +#TARGETPIC = 16f84 +CFLAGS = -mpic14 -p$(TARGETPIC) +DIR = pic +else +TARGETPIC = 18f452 +CFLAGS = -mpic16 -p$(TARGETPIC) +DIR = pic16 +endif +CFLAGS += -Wl,-q +CFLAGS += -Wl,--map +CFLAGS += -I $(SDCC_SRC)/device/include/$(DIR) +CFLAGS += -L $(SDCC_BIN)/device/lib/$(DIR)/bin +#CFLAGS += --no-pcode-opt +#CFLAGS += -V .SUFFIXES: .asm .c .cod .stc +.NOTPARALLEL: # Results of the test are placed here: LOGFILE = test.log @@ -66,43 +85,60 @@ CREATESTC = create_stc SIMULATE = simulate # List the C files to be test here: -SRC = b.c \ - add.c \ - add2.c \ - add3.c \ - and1.c \ - and2.c \ - bool1.c \ - bool2.c \ - bool3.c \ - call1.c \ - compare.c \ - compare2.c \ - compare3.c \ - compare4.c \ - compare5.c \ - compare6.c \ - for.c \ - nestfor.c \ - or1.c \ - rotate1.c \ - rotate2.c \ - rotate3.c \ - rotate4.c \ - rotate5.c \ - sub.c \ - sub2.c \ - switch1.c \ - while.c \ - xor.c \ - ptrfunc.c - -# struct1.c \ -# mul1.c \ +SRC = add.c \ + add2.c \ + add3.c \ + add4.c \ + and1.c \ + and2.c \ + arrays.c \ + b.c \ + bank1.c \ + bool1.c \ + bool2.c \ + bool3.c \ + call1.c \ + compare.c \ + compare10.c \ + compare2.c \ + compare3.c \ + compare4.c \ + compare5.c \ + compare6.c \ + compare7.c \ + compare8.c \ + compare9.c \ + configword.c \ + empty.c \ + for.c \ + init0.c \ + inline.c \ + mult1.c \ + nestfor.c \ + or1.c \ + pcodeopt.c \ + pointer1.c \ + ptrarg.c \ + ptrfunc.c \ + rotate1.c \ + rotate2.c \ + rotate3.c \ + rotate4.c \ + rotate5.c \ + rotate6.c \ + rotate7.c \ + string1.c \ + struct1.c \ + sub.c \ + sub2.c \ + switch1.c \ + while.c \ + xor.c COD := $(patsubst %.c, %.cod, $(SRC)) ASM := $(patsubst %.c, %.asm, $(SRC)) -O := $(patsubst %.c, %.o, $(SRC)) +O := $(patsubst %.c, %.o, $(SRC)) +P := $(patsubst %.c, %.p, $(SRC)) STC := $(patsubst %.c, %.stc, $(SRC)) HEX := $(patsubst %.c, %.hex, $(SRC)) LST := $(patsubst %.c, %.lst, $(SRC)) @@ -111,24 +147,14 @@ MAP := $(patsubst %.c, %.map, $(SRC)) all: test -# The asm files are generated by sdcc -.c.o: - $(Q)$(CC) $(CFLAGS) $*.c - -# The .cod files are generated by gpasm -# these get loaded by gpsim. -.o.cod: - $(Q)$(LINKER) --map -c -o $*.o $*.o - -# gpasm $*.asm - -# gpasm -c -I $(HEADER) $*.asm - +# The cod files are generated by sdcc +.c.cod: + $(Q)-$(CC) $(CFLAGS) $*.c # The .stc files are script files for gpsim .cod.stc: - $(Q)./$(CREATESTC) $*.cod $*.stc - $(Q)./$(SIMULATE) $*.stc $(LOGFILE) + $(Q)-./$(CREATESTC) $*.cod $*.stc + $(Q)-./$(SIMULATE) $*.stc $(LOGFILE) # this will also make .stc files #%.stc : %.cod @@ -160,6 +186,12 @@ cleano: if [ -f $$f ]; then rm $$f; fi \ done ; \ +cleanp: + files="$(P)" ; \ + for f in $$files ; do \ + if [ -f $$f ]; then rm $$f; fi \ + done ; \ + cleanasm: files="$(ASM)" ; \ for f in $$files ; do \ @@ -184,5 +216,11 @@ cleanlst: if [ -f $$f ]; then rm $$f; fi \ done ; \ -clean: cleancod cleanasm cleanstc cleano cleanhex cleanlst +cleanmap: + files="$(MAP)" ; \ + for f in $$files ; do \ + if [ -f $$f ]; then rm $$f; fi \ + done ; \ + +clean: cleancod cleanasm cleanstc cleano cleanp cleanhex cleanlst cleanmap if [ -f "$(LOGFILE)" ]; then rm $(LOGFILE); fi