struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / src / Makefile.in
blob84840bfa27fb5942b93251fe4bbc22c520d7b9b8
5 srcdir = @srcdir@
6 top_srcdir = @top_srcdir@
7 top_builddir = @top_builddir@
8 VPATH = @srcdir@
9 GIT_REVISION = @GIT_REVISION@
10 SVN_REVISION = @SVN_REVISION@
12 PORTS = $(shell cat ../ports.build)
13 ALLPORTS = $(shell cat ../ports.all)
14 PORT_LIBS = $(PORTS:%=%/port.a)
16 LIBS = -lm @LIBS@
18 CFLAGS = @CFLAGS@ @WALL_FLAG@
19 CXXFLAGS = @CXXFLAGS@ @WALL_FLAG@
20 CPPFLAGS += -I$(srcdir)
21 LDFLAGS = @LDFLAGS@
23 ifdef SDCC_SUB_VERSION
24 CFLAGS += -DSDCC_SUB_VERSION_STR=\"$(SDCC_SUB_VERSION)\"
25 endif
27 SLIBOBJS = NewAlloc.o dbuf.o dbuf_string.o findme.o
29 OBJECTS = SDCCy.o SDCChasht.o SDCCmain.o SDCCattr.o \
30 SDCCsymt.o SDCCopt.o SDCCast.o SDCCmem.o SDCCval.o \
31 SDCCicode.o SDCCbitv.o SDCCset.o SDCClabel.o \
32 SDCCBBlock.o SDCCloop.o SDCCcse.o SDCCcflow.o SDCCdflow.o \
33 SDCClrange.o SDCCptropt.o SDCCpeeph.o SDCCglue.o \
34 SDCCasm.o SDCCmacro.o SDCCutil.o SDCCdebug.o cdbFile.o SDCCdwarf2.o\
35 SDCCerr.o SDCCsystem.o SDCCgen.o
37 SPECIAL = SDCCy.h version.h
38 OBJECTS += SDCClex.o
40 SLIBSOURCES = $(patsubst %.o,$(SLIB)/%.c,$(SLIBOBJS))
41 SOURCES := $(patsubst %.o,%.c,$(OBJECTS))
43 # C++ sources (.cc extension)
44 CXXSOURCES += $(sort $(notdir $(wildcard $(srcdir)/*.cc)))
45 OBJECTS += $(patsubst %.cc,%.o,$(CXXSOURCES))
47 TARGET = sdcc$(EXEEXT)
49 # ------------------------------------------
50 include $(top_builddir)/Makefile.common
52 # Compiling entire program or any subproject
53 # ------------------------------------------
54 all: checkconf version.h $(TARGET)
56 $(PORT_LIBS): FORCE
57 $(MAKE) -C $(dir $@)
59 FORCE:
61 $(top_builddir)/support/gc/libgc.a:
62 $(MAKE) -C $(top_builddir)/support/gc
64 # Compiling and installing everything and runing test
65 # ---------------------------------------------------
66 install: all installdirs
67 $(INSTALL) $(TARGET) $(DESTDIR)$(bindir)/`echo sdcc|sed '$(transform)'`$(EXEEXT)
68 $(STRIP) $(DESTDIR)$(bindir)/`echo sdcc|sed '$(transform)'`$(EXEEXT)
71 # Deleting all the installed files
72 # --------------------------------
73 # NOTE: Deleting sdcpp in here, because the GNU cpp code base does not implement the uninstall target
74 uninstall:
75 rm -f $(DESTDIR)$(bindir)/`echo sdcc|sed '$(transform)'`$(EXEEXT)
76 rm -f $(DESTDIR)$(bindir)/`echo sdcpp|sed '$(transform)'`$(EXEEXT)
78 # Performing self-test
79 # --------------------
80 check:
83 # Performing installation test
84 # ----------------------------
85 installcheck:
88 # Creating installation directories
89 # ---------------------------------
90 installdirs:
91 $(INSTALL) -d $(DESTDIR)$(bindir)
94 include $(srcdir)/clean.mk
97 # My rules
98 # --------
99 $(TARGET): $(SLIBOBJS) $(OBJECTS) $(PORT_LIBS)
100 $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(SLIBOBJS) $(OBJECTS) $(PORT_LIBS) $(LIBDIRS) $(LIBS)
102 .c.o:
103 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
105 $(SLIBOBJS):%.o:$(SLIB)/%.c
106 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
108 reswords.h: reswords.gperf Makefile
109 gperf -o -k1,2,4 -t -C -N is_reserved_word $< > $@
111 SDCCy.h: SDCCy.c
113 SDCCy.c: SDCC.y
114 $(YACC) -d $<
115 mv y.tab.c $*.c
116 mv y.tab.h $*.h
118 SDCClex.c: SDCC.lex SDCCy.h
119 $(LEX) -8 -f -t $< >$@
121 # BUG: move if changed only.
122 version.h: ../ChangeLog Makefile
123 if [ -z "${GIT_REVISION}" ]; then \
124 $(AWK) -f $(srcdir)/version.awk $< > $@; \
125 else \
126 echo "#ifndef __VERSION_H__" > $@; \
127 echo "#define __VERSION_H__" >> $@; \
128 echo "// GIT_REVISION ${GIT_REVISION}" >> $@; \
129 echo "// BUILD_NUMBERs are empty when not using commit from svn..." >> $@; \
130 echo '#define SDCC_BUILD_NUMBER "${SVN_REVISION}"' >> $@; \
131 echo "#define SDCC_BUILD_NR ${SVN_REVISION}" >> $@;\
132 echo "#endif" >> $@; \
135 .l.c:
136 rm -f $*.cc
137 $(LEX) -t $< >$*.cc
140 # Remaking configuration
141 # ----------------------
142 checkconf:
143 @if [ -f $(top_builddir)/devel ]; then\
144 $(MAKE) -f $(srcdir)/conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" \
145 freshconf;\
148 Makefile: $(srcdir)/Makefile.in
149 cd $(top_builddir); ./config.status src/Makefile