include $(PRJDIR)/Makefile.common
-PORTS = mcs51 z80
+USE_ALT_LEX = 0
+
+PORTS = mcs51 z80 avr ds390
PORT_LIBS = $(PORTS:%=%/port.a)
-LIBS = -lgc @LIBS@
+LIBS = -lgc -lm @LIBS@
ifeq ($(HAVE_LIBGC), 1)
else
LIBDIRS = -L$(PRJDIR)/support/gc
LIBGC = $(PRJDIR)/support/gc/libgc.a
endif
-OBJECTS = SDCCy.o SDCClex.o SDCCerr.o SDCChasht.o SDCCmain.o \
+#CFLAGS += -Werror
+
+ifdef SDCC_SUB_VERSION
+CFLAGS += -DSDCC_SUB_VERSION_STR=\"$(SDCC_SUB_VERSION)\"
+endif
+
+OBJECTS = SDCCy.o SDCCerr.o SDCChasht.o SDCCmain.o \
SDCCsymt.o SDCCopt.o SDCCast.o SDCCmem.o SDCCval.o \
SDCCicode.o SDCCbitv.o SDCCset.o SDCClabel.o \
SDCCBBlock.o SDCCloop.o SDCCcse.o SDCCcflow.o SDCCdflow.o \
- SDCClrange.o SDCCptropt.o SDCCpeeph.o SDCCglue.o spawn.o
+ SDCClrange.o SDCCptropt.o SDCCpeeph.o SDCCglue.o spawn.o \
+ asm.o
+
+SPECIAL = SDCCy.h
+ifeq ($(USE_ALT_LEX), 1)
+OBJECTS += altlex.o
+SPECIAL += reswords.h
+else
+OBJECTS += SDCClex.o
+endif
+
SOURCES = $(patsubst %.o,%.c,$(OBJECTS))
TARGET = $(PRJDIR)/bin/sdcc
$(PRJDIR)/support/gc/libgc.a:
cd $(PRJDIR)/support/gc && $(MAKE)
-
# Compiling and installing everything and runing test
# ---------------------------------------------------
install: all installdirs
# --------------------------------
uninstall:
rm -f $(bindir)/sdcc
-
+ rm -f $(bindir)/packihx
# Performing self-test
# --------------------
# ---------------------
dep: Makefile.dep
-Makefile.dep: $(SOURCES) *.h $(PRJDIR)/*.h
+Makefile.dep: $(SOURCES) $(SPECIAL) *.h $(PRJDIR)/*.h
$(CPP) $(CPPFLAGS) $(M_OR_MM) $(SOURCES) >Makefile.dep
include Makefile.dep
.c.o:
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+reswords.h: reswords.gperf Makefile
+ gperf -o -k1,2,4 -t -C -N is_reserved_word $< > $@
+
+altlex.o: altlex.c SDCCy.h reswords.h
+
SDCCy.h: SDCCy.c
SDCCy.c: SDCC.y
SDCClex.c: SDCC.lex SDCCy.h
$(LEX) -t $< >$@
-SDCCpeeph.rul: SDCCpeeph.def
- $(AWK) -f SDCCpeeph.awk SDCCpeeph.def > SDCCpeeph.rul
-
.y.c:
rm -f $*.cc $*.h
$(YACC) -d $<