7 include $(PRJDIR)/Makefile.common
11 PORTS = mcs51 z80 avr ds390
12 PORT_LIBS = $(PORTS:%=%/port.a)
14 LIBS = -lgc -lm @LIBS@
15 ifeq ($(HAVE_LIBGC), 1)
17 LIBDIRS = -L$(PRJDIR)/support/gc
18 LIBGC = $(PRJDIR)/support/gc/libgc.a
21 ifdef SDCC_SUB_VERSION
22 CFLAGS += -DSDCC_SUB_VERSION_STR=\"$(SDCC_SUB_VERSION)\"
25 OBJECTS = SDCCy.o SDCCerr.o SDCChasht.o SDCCmain.o \
26 SDCCsymt.o SDCCopt.o SDCCast.o SDCCmem.o SDCCval.o \
27 SDCCicode.o SDCCbitv.o SDCCset.o SDCClabel.o \
28 SDCCBBlock.o SDCCloop.o SDCCcse.o SDCCcflow.o SDCCdflow.o \
29 SDCClrange.o SDCCptropt.o SDCCpeeph.o SDCCglue.o spawn.o \
33 ifeq ($(USE_ALT_LEX), 1)
40 SOURCES = $(patsubst %.o,%.c,$(OBJECTS))
42 TARGET = $(PRJDIR)/bin/sdcc
43 PACKIHX = $(PRJDIR)/bin/packihx
45 # Compiling entire program or any subproject
46 # ------------------------------------------
47 all: ports checkconf $(LIBGC) $(TARGET) $(PACKIHX)
50 for i in $(PORTS); do $(MAKE) -C $$i; done
52 $(PRJDIR)/support/gc/libgc.a:
53 cd $(PRJDIR)/support/gc && $(MAKE)
55 # Compiling and installing everything and runing test
56 # ---------------------------------------------------
57 install: all installdirs
58 $(INSTALL) -s $(TARGET) $(bindir)/sdcc
59 $(INSTALL) $(PACKIHX) $(bindir)/packihx
62 # Deleting all the installed files
63 # --------------------------------
68 # Performing self-test
69 # --------------------
73 # Performing installation test
74 # ----------------------------
78 # Creating installation directories
79 # ---------------------------------
81 $(INSTALL) -d $(bindir)
84 # Creating dependencies
85 # ---------------------
88 Makefile.dep: $(SOURCES) $(SPECIAL) *.h $(PRJDIR)/*.h
89 $(CPP) $(CPPFLAGS) $(M_OR_MM) $(SOURCES) >Makefile.dep
97 $(TARGET): $(OBJECTS) $(PORT_LIBS)
98 $(CC) -o $@ $(OBJECTS) $(PORT_LIBS) $(LIBDIRS) $(LIBS)
101 $(INSTALL) packihx $(PACKIHX)
105 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
107 reswords.h: reswords.gperf Makefile
108 gperf -o -k1,2,4 -t -C -N is_reserved_word $< > $@
110 altlex.o: altlex.c SDCCy.h reswords.h
115 $(YACC) -d -v -o $@ $<
117 SDCClex.c: SDCC.lex SDCCy.h
131 # Remaking configuration
132 # ----------------------
134 @if [ -f $(PRJDIR)/devel ]; then\
135 $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" \
139 # End of main_in.mk/main.mk