6 VERSIONHI = @VERSIONHI@
7 VERSIONLO = @VERSIONLO@
17 top_builddir = @top_builddir@
18 top_srcdir = @top_srcdir@
19 SLIB = $(top_builddir)support/Util
20 SDCCLIB = $(top_builddir)src
26 exec_prefix = @exec_prefix@
30 includedir = @includedir@
32 man1dir = $(mandir)/man1
33 man2dir = $(mandir)/man2
36 STD_INC = @sdcc_include_dir@
37 CPPFLAGS = @CPPFLAGS@ -I$(top_builddir) -I$(top_srcdir) -I$(srcdir)/$(SLIB)
47 OBJECTS = sdcdb.o symtab.o simi.o \
49 SLIBOBJS = NewAlloc.o SDCCerr.o
50 SDCCOBJS = SDCCset.o SDCChasht.o
52 SOURCES = $(patsubst %.o,%.c,$(OBJECTS))
53 SLIBSOURCES = $(patsubst %.o,$(SLIB)/%.c,$(SLIBOBJS))
54 SDCCSOURCES = $(patsubst %.o,$(SDCCLIB)/%.c,$(SDCCOBJS))
56 TARGET = $(top_builddir)bin/sdcdb$(EXEEXT)
59 # Compiling entire program or any subproject
60 # ------------------------------------------
61 all: checkconf $(TARGET)
63 # Compiling and installing everything and runing test
64 # ---------------------------------------------------
65 install: all installdirs
66 $(INSTALL) $(TARGET) $(DESTDIR)$(bindir)/sdcdb$(EXEEXT)
67 $(STRIP) $(DESTDIR)$(bindir)/sdcdb$(EXEEXT)
68 cp $(srcdir)/sdcdb.el $(DESTDIR)$(bindir)/sdcdb.el
69 cp $(srcdir)/sdcdbsrc.el $(DESTDIR)$(bindir)/sdcdbsrc.el
72 # Deleting all the installed files
73 # --------------------------------
75 rm -f $(DESTDIR)$(bindir)/sdcdb$(EXEEXT)
76 rm -f $(DESTDIR)$(bindir)/sdcdb.el
77 rm -f $(DESTDIR)$(bindir)/sdcdbsrc.el
79 # Performing self-test
80 # --------------------
84 # Performing installation test
85 # ----------------------------
89 # Creating installation directories
90 # ---------------------------------
92 $(INSTALL) -d $(DESTDIR)$(bindir)
95 # Creating dependencies
96 # ---------------------
99 Makefile.dep: $(SOURCES) $(SLIBSOURCES) $(SDCCSOURCES) $(srcdir)/*.h $(top_builddir)*.h $(top_srcdir)/*.h
100 $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
102 ifeq "$(findstring $(MAKECMDGOALS),uninstall installcheck installdirs checkconf \
103 clean distclean mostlyclean realclean)" ""
106 include $(srcdir)/clean.mk
110 $(TARGET): $(OBJECTS) $(SLIBOBJS) $(SDCCOBJS)
111 $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(SLIBOBJS) $(SDCCOBJS) $(LIBDIRS) $(LIBS)
114 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
116 $(SLIBOBJS):%.o:$(SLIB)/%.c
117 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
119 $(SDCCOBJS):%.o:$(SDCCLIB)/%.c
120 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
122 # Remaking configuration
123 # ----------------------
125 @if [ -f $(top_builddir)devel ]; then\
126 $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
129 # End of cpp/Makefile