#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 = -Wl,--map -I ../../device/include/pic -L ../../device/lib/pic/bin -mpic14 -pp$(TARGETPIC) -Wl,-q
+#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
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 \
# The cod files are generated by sdcc
.c.cod:
- $(Q)$(CC) $(CFLAGS) $*.c
+ $(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