Removed some generated files, added Makefile.common, shifted mcs51 sdcc
[fw/sdcc] / src / Makefile.in
1 #
2 #
3 #
4
5 PRJDIR          = ..
6
7 include $(PRJDIR)/Makefile.common
8
9 LIBS            = $(PORT)/port.a -lgc @LIBS@
10 LIBDIRS         = -L$(PRJDIR)/support/gc
11
12 OBJECTS         = SDCCy.o SDCClex.o SDCCerr.o SDCChasht.o SDCCmain.o \
13                   SDCCsymt.o SDCCopt.o SDCCast.o SDCCmem.o SDCCval.o \
14                   SDCCicode.o SDCCbitv.o SDCCset.o SDCClabel.o \
15                   SDCCBBlock.o SDCCloop.o SDCCcse.o SDCCcflow.o SDCCdflow.o \
16                   SDCClrange.o SDCCptropt.o SDCCpeeph.o SDCCglue.o spawn.o
17 SOURCES         = $(patsubst %.o,%.c,$(OBJECTS))
18
19 TARGET          = $(PRJDIR)/bin/sdcc
20
21
22 # Compiling entire program or any subproject
23 # ------------------------------------------
24 all: port checkconf $(PRJDIR)/support/gc/libgc.a $(TARGET)
25
26 port:
27         $(MAKE) -C $(PORT)
28
29 $(PRJDIR)/support/gc/libgc.a:
30         cd $(PRJDIR)/support/gc && $(MAKE)
31
32
33 # Compiling and installing everything and runing test
34 # ---------------------------------------------------
35 install: all installdirs
36         $(INSTALL) -s $(TARGET) $(bindir)/sdcc
37
38
39 # Deleting all the installed files
40 # --------------------------------
41 uninstall:
42         rm -f $(bindir)/sdcc
43
44
45 # Performing self-test
46 # --------------------
47 check:
48
49
50 # Performing installation test
51 # ----------------------------
52 installcheck:
53
54
55 # Creating installation directories
56 # ---------------------------------
57 installdirs:
58         $(INSTALL) -d $(bindir)
59
60
61 # Creating dependencies
62 # ---------------------
63 dep: Makefile.dep
64
65 Makefile.dep: $(SOURCES) *.h $(PRJDIR)/*.h
66         $(CPP) $(CPPFLAGS) $(M_OR_MM) $(SOURCES) >Makefile.dep
67
68 include Makefile.dep
69 include clean.mk
70
71
72 # My rules
73 # --------
74 $(TARGET): $(OBJECTS)
75         $(CC) -o $@ $(OBJECTS) $(LIBDIRS) $(LIBS)
76
77 .c.o:
78         $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
79
80 SDCCy.c: SDCC.y
81         $(YACC) -d -v -o $@ $<
82
83 SDCClex.c: SDCC.lex SDCCy.h
84         $(LEX) -t $< >$@
85
86 SDCCpeeph.rul: SDCCpeeph.def
87         $(AWK) -f SDCCpeeph.awk SDCCpeeph.def > SDCCpeeph.rul
88
89 .y.c:
90         rm -f $*.cc $*.h
91         $(YACC) -d $<
92         mv y.tab.c $*.cc
93         mv y.tab.h $*.h
94
95 .l.c:
96         rm -f $*.cc
97         $(LEX) -t $< >$*.cc
98
99
100 # Remaking configuration
101 # ----------------------
102 checkconf:
103         @if [ -f $(PRJDIR)/devel ]; then\
104           $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" \
105           freshconf;\
106         fi
107
108 # End of main_in.mk/main.mk
109