7 include $(PRJDIR)/Makefile.common
11 PORTS = $(shell cat ../ports.build)
12 ALLPORTS = $(shell cat ../ports.all)
13 PORT_LIBS = $(PORTS:%=%/port.a)
19 ifdef SDCC_SUB_VERSION
20 CFLAGS += -DSDCC_SUB_VERSION_STR=\"$(SDCC_SUB_VERSION)\"
23 SLIBOBJS = SDCCerr.o NewAlloc.o MySystem.o BuildCmd.o
25 OBJECTS = SDCCy.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 \
30 asm.o SDCCmacro.o SDCCutil.o
33 ifeq ($(USE_ALT_LEX), 1)
40 SOURCES = $(patsubst %.o,%.c,$(OBJECTS))
42 TARGET = $(PRJDIR)/bin/sdcc$(EXEEXT)
44 # Compiling entire program or any subproject
45 # ------------------------------------------
46 all: ports checkconf $(TARGET)
49 for i in $(PORTS); do $(MAKE) -C $$i; done
51 $(PRJDIR)/support/gc/libgc.a:
52 cd $(PRJDIR)/support/gc && $(MAKE)
54 # Compiling and installing everything and runing test
55 # ---------------------------------------------------
56 install: all installdirs
57 $(INSTALL) $(TARGET) `echo $(bindir)/sdcc|sed '$(transform)'`
58 $(STRIP) `echo $(bindir)/sdcc|sed '$(transform)'`
61 # Deleting all the installed files
62 # --------------------------------
66 # Performing self-test
67 # --------------------
71 # Performing installation test
72 # ----------------------------
76 # Creating installation directories
77 # ---------------------------------
79 $(INSTALL) -d $(bindir)
82 # Creating dependencies
83 # ---------------------
86 Makefile.dep: $(SOURCES) $(SPECIAL) *.h $(PRJDIR)/*.h
87 $(CPP) $(CPPFLAGS) $(M_OR_MM) $(SOURCES) >Makefile.dep
95 $(TARGET): $(SLIBOBJS) $(OBJECTS) $(PORT_LIBS)
96 $(CC) -o $@ $(SLIBOBJS) $(OBJECTS) $(PORT_LIBS) $(LIBDIRS) $(LIBS)
99 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
101 $(SLIBOBJS):%.o:$(SLIB)/%.c
102 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
104 reswords.h: reswords.gperf Makefile
105 gperf -o -k1,2,4 -t -C -N is_reserved_word $< > $@
107 altlex.o: altlex.c SDCCy.h reswords.h
112 $(YACC) -d -v -o $@ $<
114 SDCClex.c: SDCC.lex SDCCy.h
128 # Remaking configuration
129 # ----------------------
131 @if [ -f $(PRJDIR)/devel ]; then\
132 $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" \
136 # End of main_in.mk/main.mk