7 include $(PRJDIR)/Makefile.common
11 PORTS = mcs51 z80 avr ds390 pic izt
12 PORT_LIBS = $(PORTS:%=%/port.a)
18 ifdef SDCC_SUB_VERSION
19 CFLAGS += -DSDCC_SUB_VERSION_STR=\"$(SDCC_SUB_VERSION)\"
22 OBJECTS = SDCCy.o SDCCerr.o SDCChasht.o SDCCmain.o \
23 SDCCsymt.o SDCCopt.o SDCCast.o SDCCmem.o SDCCval.o \
24 SDCCicode.o SDCCbitv.o SDCCset.o SDCClabel.o \
25 SDCCBBlock.o SDCCloop.o SDCCcse.o SDCCcflow.o SDCCdflow.o \
26 SDCClrange.o SDCCptropt.o SDCCpeeph.o SDCCglue.o spawn.o \
30 ifeq ($(USE_ALT_LEX), 1)
37 SOURCES = $(patsubst %.o,%.c,$(OBJECTS))
39 TARGET = $(PRJDIR)/bin/sdcc
41 # Compiling entire program or any subproject
42 # ------------------------------------------
43 all: ports checkconf $(LIBGC) $(TARGET)
46 for i in $(PORTS); do $(MAKE) -C $$i; done
48 $(PRJDIR)/support/gc/libgc.a:
49 cd $(PRJDIR)/support/gc && $(MAKE)
51 # Compiling and installing everything and runing test
52 # ---------------------------------------------------
53 install: all installdirs
54 $(INSTALL) -s $(TARGET) $(bindir)/sdcc
57 # Deleting all the installed files
58 # --------------------------------
61 rm -f $(bindir)/packihx
63 # Performing self-test
64 # --------------------
68 # Performing installation test
69 # ----------------------------
73 # Creating installation directories
74 # ---------------------------------
76 $(INSTALL) -d $(bindir)
79 # Creating dependencies
80 # ---------------------
83 Makefile.dep: $(SOURCES) $(SPECIAL) *.h $(PRJDIR)/*.h
84 $(CPP) $(CPPFLAGS) $(M_OR_MM) $(SOURCES) >Makefile.dep
92 $(TARGET): $(OBJECTS) $(PORT_LIBS)
93 $(CC) -o $@ $(OBJECTS) $(PORT_LIBS) $(LIBDIRS) $(LIBS)
96 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
98 reswords.h: reswords.gperf Makefile
99 gperf -o -k1,2,4 -t -C -N is_reserved_word $< > $@
101 altlex.o: altlex.c SDCCy.h reswords.h
106 $(YACC) -d -v -o $@ $<
108 SDCClex.c: SDCC.lex SDCCy.h
122 # Remaking configuration
123 # ----------------------
125 @if [ -f $(PRJDIR)/devel ]; then\
126 $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" \
130 # End of main_in.mk/main.mk