7 include $(PRJDIR)/Makefile.common
9 PORTS = mcs51 z80 avr ds390
10 PORT_LIBS = $(PORTS:%=%/port.a)
12 LIBS = -lgc -lm @LIBS@
13 ifeq ($(HAVE_LIBGC), 1)
15 LIBDIRS = -L$(PRJDIR)/support/gc
16 LIBGC = $(PRJDIR)/support/gc/libgc.a
19 ifdef SDCC_SUB_VERSION
20 CFLAGS += -DSDCC_SUB_VERSION_STR=\"$(SDCC_SUB_VERSION)\"
23 OBJECTS = SDCCy.o SDCClex.o SDCCerr.o SDCChasht.o SDCCmain.o \
24 SDCCsymt.o SDCCopt.o SDCCast.o SDCCmem.o SDCCval.o \
25 SDCCicode.o SDCCbitv.o SDCCset.o SDCClabel.o \
26 SDCCBBlock.o SDCCloop.o SDCCcse.o SDCCcflow.o SDCCdflow.o \
27 SDCClrange.o SDCCptropt.o SDCCpeeph.o SDCCglue.o spawn.o \
30 SOURCES = $(patsubst %.o,%.c,$(OBJECTS))
32 TARGET = $(PRJDIR)/bin/sdcc
34 # Compiling entire program or any subproject
35 # ------------------------------------------
36 all: ports checkconf $(LIBGC) $(TARGET)
39 for i in $(PORTS); do $(MAKE) -C $$i; done
41 $(PRJDIR)/support/gc/libgc.a:
42 cd $(PRJDIR)/support/gc && $(MAKE)
44 # Compiling and installing everything and runing test
45 # ---------------------------------------------------
46 install: all installdirs
47 $(INSTALL) -s $(TARGET) $(bindir)/sdcc
50 # Deleting all the installed files
51 # --------------------------------
56 # Performing self-test
57 # --------------------
61 # Performing installation test
62 # ----------------------------
66 # Creating installation directories
67 # ---------------------------------
69 $(INSTALL) -d $(bindir)
72 # Creating dependencies
73 # ---------------------
76 Makefile.dep: $(SOURCES) *.h $(PRJDIR)/*.h
77 $(CPP) $(CPPFLAGS) $(M_OR_MM) $(SOURCES) >Makefile.dep
85 $(TARGET): $(OBJECTS) $(PORT_LIBS)
86 $(CC) -o $@ $(OBJECTS) $(PORT_LIBS) $(LIBDIRS) $(LIBS)
89 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
94 $(YACC) -d -v -o $@ $<
96 SDCClex.c: SDCC.lex SDCCy.h
110 # Remaking configuration
111 # ----------------------
113 @if [ -f $(PRJDIR)/devel ]; then\
114 $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" \
118 # End of main_in.mk/main.mk