7 include $(PRJDIR)/Makefile.common
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 OBJECTS = SDCCy.o SDCClex.o SDCCerr.o SDCChasht.o SDCCmain.o \
20 SDCCsymt.o SDCCopt.o SDCCast.o SDCCmem.o SDCCval.o \
21 SDCCicode.o SDCCbitv.o SDCCset.o SDCClabel.o \
22 SDCCBBlock.o SDCCloop.o SDCCcse.o SDCCcflow.o SDCCdflow.o \
23 SDCClrange.o SDCCptropt.o SDCCpeeph.o SDCCglue.o spawn.o \
26 SOURCES = $(patsubst %.o,%.c,$(OBJECTS))
28 TARGET = $(PRJDIR)/bin/sdcc
30 # Compiling entire program or any subproject
31 # ------------------------------------------
32 all: ports checkconf $(LIBGC) $(TARGET)
35 for i in $(PORTS); do $(MAKE) -C $$i; done
37 $(PRJDIR)/support/gc/libgc.a:
38 cd $(PRJDIR)/support/gc && $(MAKE)
41 # Compiling and installing everything and runing test
42 # ---------------------------------------------------
43 install: all installdirs
44 $(INSTALL) -s $(TARGET) $(bindir)/sdcc
47 # Deleting all the installed files
48 # --------------------------------
53 # Performing self-test
54 # --------------------
58 # Performing installation test
59 # ----------------------------
63 # Creating installation directories
64 # ---------------------------------
66 $(INSTALL) -d $(bindir)
69 # Creating dependencies
70 # ---------------------
73 Makefile.dep: $(SOURCES) *.h $(PRJDIR)/*.h
74 $(CPP) $(CPPFLAGS) $(M_OR_MM) $(SOURCES) >Makefile.dep
82 $(TARGET): $(OBJECTS) $(PORT_LIBS)
83 $(CC) -o $@ $(OBJECTS) $(PORT_LIBS) $(LIBDIRS) $(LIBS)
86 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
91 $(YACC) -d -v -o $@ $<
93 SDCClex.c: SDCC.lex SDCCy.h
107 # Remaking configuration
108 # ----------------------
110 @if [ -f $(PRJDIR)/devel ]; then\
111 $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" \
115 # End of main_in.mk/main.mk