13 top_srcdir = @srcdir@/../..
14 SLIB = $(top_srcdir)/support/Util
15 SDCCLIB = $(top_srcdir)/src
21 exec_prefix = @exec_prefix@
24 STD_INC = @sdcc_include_dir@
25 CPPFLAGS = @CPPFLAGS@ -I. -I$(top_builddir) -I$(top_srcdir) -I$(SLIB) -DHAVE_CONFIG_H
32 LIBS = @LIBS@ @LIBREADLINE@
35 OBJECTS = sdcdb.o symtab.o simi.o \
38 SDCCOBJS = SDCCset.o SDCChasht.o SDCCerr.o
40 SOURCES = $(patsubst %.o,%.c,$(OBJECTS))
41 SLIBSOURCES = $(patsubst %.o,$(SLIB)/%.c,$(SLIBOBJS))
42 SDCCSOURCES = $(patsubst %.o,$(SDCCLIB)/%.c,$(SDCCOBJS))
44 TARGET = $(top_builddir)/bin/sdcdb$(EXEEXT)
47 # Compiling entire program or any subproject
48 # ------------------------------------------
49 all: checkconf $(TARGET)
51 # Compiling and installing everything and runing test
52 # ---------------------------------------------------
53 install: all installdirs
54 $(INSTALL) $(TARGET) $(DESTDIR)$(bindir)/sdcdb$(EXEEXT)
55 $(STRIP) $(DESTDIR)$(bindir)/sdcdb$(EXEEXT)
56 cp $(srcdir)/sdcdb.el $(DESTDIR)$(bindir)/sdcdb.el
57 cp $(srcdir)/sdcdbsrc.el $(DESTDIR)$(bindir)/sdcdbsrc.el
60 # Deleting all the installed files
61 # --------------------------------
63 rm -f $(DESTDIR)$(bindir)/sdcdb$(EXEEXT)
64 rm -f $(DESTDIR)$(bindir)/sdcdb.el
65 rm -f $(DESTDIR)$(bindir)/sdcdbsrc.el
67 # Performing self-test
68 # --------------------
72 # Performing installation test
73 # ----------------------------
77 # Creating installation directories
78 # ---------------------------------
80 $(INSTALL) -d $(DESTDIR)$(bindir)
83 # Creating dependencies
84 # ---------------------
87 Makefile.dep: $(SOURCES) $(SLIBSOURCES) $(SDCCSOURCES) $(srcdir)/*.h $(top_builddir)/*.h $(top_srcdir)/*.h
88 $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
90 ifeq "$(findstring $(MAKECMDGOALS),uninstall installcheck installdirs checkconf \
91 clean distclean mostlyclean realclean)" ""
94 include $(srcdir)/clean.mk
98 $(TARGET): $(OBJECTS) $(SLIBOBJS) $(SDCCOBJS)
99 $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(SLIBOBJS) $(SDCCOBJS) $(LIBDIRS) $(LIBS)
102 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
104 $(SLIBOBJS):%.o:$(SLIB)/%.c
105 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
107 $(SDCCOBJS):%.o:$(SDCCLIB)/%.c
108 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
110 # Remaking configuration
111 # ----------------------
113 @if [ -f $(top_builddir)/devel ]; then\
114 $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
117 # End of cpp/Makefile