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 SLIBOBJS = SDCCerr.o NewAlloc.o
24 OBJECTS = SDCCy.o SDCChasht.o SDCCmain.o \
25 SDCCsymt.o SDCCopt.o SDCCast.o SDCCmem.o SDCCval.o \
26 SDCCicode.o SDCCbitv.o SDCCset.o SDCClabel.o \
27 SDCCBBlock.o SDCCloop.o SDCCcse.o SDCCcflow.o SDCCdflow.o \
28 SDCClrange.o SDCCptropt.o SDCCpeeph.o SDCCglue.o spawn.o \
32 ifeq ($(USE_ALT_LEX), 1)
39 SOURCES = $(patsubst %.o,%.c,$(OBJECTS))
41 TARGET = $(PRJDIR)/bin/sdcc
43 # Compiling entire program or any subproject
44 # ------------------------------------------
45 all: ports checkconf $(TARGET)
48 for i in $(PORTS); do $(MAKE) -C $$i; done
50 $(PRJDIR)/support/gc/libgc.a:
51 cd $(PRJDIR)/support/gc && $(MAKE)
53 # Compiling and installing everything and runing test
54 # ---------------------------------------------------
55 install: all installdirs
56 $(INSTALL) -s $(TARGET) $(bindir)/sdcc
59 # Deleting all the installed files
60 # --------------------------------
63 rm -f $(bindir)/packihx
65 # Performing self-test
66 # --------------------
70 # Performing installation test
71 # ----------------------------
75 # Creating installation directories
76 # ---------------------------------
78 $(INSTALL) -d $(bindir)
81 # Creating dependencies
82 # ---------------------
85 Makefile.dep: $(SOURCES) $(SPECIAL) *.h $(PRJDIR)/*.h
86 $(CPP) $(CPPFLAGS) $(M_OR_MM) $(SOURCES) >Makefile.dep
94 $(TARGET): $(SLIBOBJS) $(OBJECTS) $(PORT_LIBS)
95 $(CC) -o $@ $(SLIBOBJS) $(OBJECTS) $(PORT_LIBS) $(LIBDIRS) $(LIBS)
98 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
100 $(SLIBOBJS):%.o:$(SLIB)/%.c
101 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
103 reswords.h: reswords.gperf Makefile
104 gperf -o -k1,2,4 -t -C -N is_reserved_word $< > $@
106 altlex.o: altlex.c SDCCy.h reswords.h
111 $(YACC) -d -v -o $@ $<
113 SDCClex.c: SDCC.lex SDCCy.h
127 # Remaking configuration
128 # ----------------------
130 @if [ -f $(PRJDIR)/devel ]; then\
131 $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" \
135 # End of main_in.mk/main.mk