Use 'ao-dbg' instead of 's51' to communicate with TeleMetrum
[fw/sdcc] / src / Makefile.in
1 #
2 #
3 #
4
5 srcdir          = @srcdir@
6 top_srcdir      = @top_srcdir@
7 top_builddir    = @top_builddir@
8 VPATH =           @srcdir@
9
10 include $(top_builddir)/Makefile.common
11
12 USE_ALT_LEX     = 0
13
14 PORTS           = $(shell cat ../ports.build)
15 ALLPORTS        = $(shell cat ../ports.all)
16 PORT_LIBS       = $(PORTS:%=%/port.a)
17
18 LIBS            = -lm @LIBS@
19
20 #CFLAGS          += -Werror
21 CPPFLAGS        += -I$(srcdir)
22 LDFLAGS         = @LDFLAGS@
23
24 ifdef SDCC_SUB_VERSION
25 CFLAGS          += -DSDCC_SUB_VERSION_STR=\"$(SDCC_SUB_VERSION)\"
26 endif
27
28 SLIBOBJS        = NewAlloc.o MySystem.o BuildCmd.o dbuf.o dbuf_string.o findme.o
29
30 OBJECTS         = SDCCy.o SDCChasht.o SDCCmain.o \
31                   SDCCsymt.o SDCCopt.o SDCCast.o SDCCmem.o SDCCval.o \
32                   SDCCicode.o SDCCbitv.o SDCCset.o SDCClabel.o \
33                   SDCCBBlock.o SDCCloop.o SDCCcse.o SDCCcflow.o SDCCdflow.o \
34                   SDCClrange.o SDCCptropt.o SDCCpeeph.o SDCCglue.o \
35                   SDCCasm.o SDCCmacro.o SDCCutil.o SDCCdebug.o cdbFile.o SDCCdwarf2.o\
36                   SDCCerr.o
37
38 SPECIAL         = SDCCy.h 
39 ifeq ($(USE_ALT_LEX), 1)
40 OBJECTS         += altlex.o
41 SPECIAL         += reswords.h
42 else
43 OBJECTS         += SDCClex.o
44 endif
45
46 SLIBSOURCES     = $(patsubst %.o,$(SLIB)/%.c,$(SLIBOBJS))
47 SOURCES         = $(patsubst %.o,%.c,$(OBJECTS))
48
49 TARGET          = $(top_builddir)/bin/sdcc$(EXEEXT)
50
51 # Compiling entire program or any subproject
52 # ------------------------------------------
53 all: checkconf version.h $(TARGET)
54
55 $(PORT_LIBS): FORCE 
56         $(MAKE) -C $(dir $@)
57
58 FORCE:
59
60 $(top_builddir)/support/gc/libgc.a:
61         $(MAKE) -C $(top_builddir)/support/gc
62
63 # Compiling and installing everything and runing test
64 # ---------------------------------------------------
65 install: all installdirs
66         $(INSTALL) $(TARGET) `echo $(DESTDIR)$(bindir)/sdcc$(EXEEXT)|sed '$(transform)'`
67         $(STRIP) `echo $(DESTDIR)$(bindir)/sdcc$(EXEEXT)|sed '$(transform)'`
68
69
70 # Deleting all the installed files
71 # --------------------------------
72 uninstall:
73         rm -f $(DESTDIR)$(bindir)/sdcc$(EXEEXT)
74
75 # Performing self-test
76 # --------------------
77 check:
78
79
80 # Performing installation test
81 # ----------------------------
82 installcheck:
83
84
85 # Creating installation directories
86 # ---------------------------------
87 installdirs:
88         $(INSTALL) -d $(DESTDIR)$(bindir)
89
90
91 # Creating dependencies
92 # ---------------------
93 dep: version.h Makefile.dep
94
95 Makefile.dep: version.h $(SOURCES) $(SLIBSOURCES) $(SPECIAL)
96         $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
97
98 # don't include Makefile.dep for the listed targets:
99 ifeq "$(findstring $(MAKECMDGOALS),uninstall check installcheck installdirs checkconf \
100                                    clean distclean mostlyclean realclean)" ""
101   -include Makefile.dep
102 endif
103 include $(srcdir)/clean.mk
104
105
106 # My rules
107 # --------
108 $(TARGET): $(SLIBOBJS) $(OBJECTS) $(PORT_LIBS)
109         $(CC) $(LDFLAGS) -o $@ $(SLIBOBJS) $(OBJECTS) $(PORT_LIBS) $(LIBDIRS) $(LIBS)
110
111 .c.o:
112         $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
113
114 $(SLIBOBJS):%.o:$(SLIB)/%.c
115         $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
116
117 reswords.h: reswords.gperf Makefile
118         gperf -o -k1,2,4 -t -C -N is_reserved_word $< > $@
119
120 altlex.o: altlex.c SDCCy.h reswords.h
121
122 SDCCy.h: SDCCy.c
123
124 SDCCy.c: SDCC.y
125         $(YACC) -d -v -o $@ $<
126
127 SDCClex.c: SDCC.lex SDCCy.h
128         $(LEX) -t $< >$@
129
130 version.h: ../ChangeLog
131         $(AWK) -f $(srcdir)/version.awk $< > $@
132
133 .y.c:
134         rm -f $*.cc $*.h
135         $(YACC) -d $<
136         mv y.tab.c $*.cc
137         mv y.tab.h $*.h
138
139 .l.c:
140         rm -f $*.cc
141         $(LEX) -t $< >$*.cc
142
143
144 # Remaking configuration
145 # ----------------------
146 checkconf:
147         @if [ -f $(top_builddir)/devel ]; then\
148           $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" \
149           freshconf;\
150         fi
151
152 # End of main_in.mk/main.mk