13 top_srcdir = @srcdir@/../..
14 SLIB = $(top_builddir)support/Util
15 SDCCLIB = $(top_builddir)src
22 STD_INC = @sdcc_include_dir@
23 CPPFLAGS = @CPPFLAGS@ -I. -I$(top_builddir) -I$(top_srcdir) -I$(srcdir)/$(SLIB) -DHAVE_CONFIG_H
30 LIBS = @LIBS@ @LIBREADLINE@
33 OBJECTS = sdcdb.o symtab.o simi.o \
35 SLIBOBJS = NewAlloc.o SDCCerr.o
36 SDCCOBJS = SDCCset.o SDCChasht.o
38 SOURCES = $(patsubst %.o,%.c,$(OBJECTS))
39 SLIBSOURCES = $(patsubst %.o,$(SLIB)/%.c,$(SLIBOBJS))
40 SDCCSOURCES = $(patsubst %.o,$(SDCCLIB)/%.c,$(SDCCOBJS))
42 TARGET = $(top_builddir)bin/sdcdb$(EXEEXT)
45 # Compiling entire program or any subproject
46 # ------------------------------------------
47 all: checkconf $(TARGET)
49 # Compiling and installing everything and runing test
50 # ---------------------------------------------------
51 install: all installdirs
52 $(INSTALL) $(TARGET) $(DESTDIR)$(bindir)/sdcdb$(EXEEXT)
53 $(STRIP) $(DESTDIR)$(bindir)/sdcdb$(EXEEXT)
54 cp $(srcdir)/sdcdb.el $(DESTDIR)$(bindir)/sdcdb.el
55 cp $(srcdir)/sdcdbsrc.el $(DESTDIR)$(bindir)/sdcdbsrc.el
58 # Deleting all the installed files
59 # --------------------------------
61 rm -f $(DESTDIR)$(bindir)/sdcdb$(EXEEXT)
62 rm -f $(DESTDIR)$(bindir)/sdcdb.el
63 rm -f $(DESTDIR)$(bindir)/sdcdbsrc.el
65 # Performing self-test
66 # --------------------
70 # Performing installation test
71 # ----------------------------
75 # Creating installation directories
76 # ---------------------------------
78 $(INSTALL) -d $(DESTDIR)$(bindir)
81 # Creating dependencies
82 # ---------------------
85 Makefile.dep: $(SOURCES) $(SLIBSOURCES) $(SDCCSOURCES) $(srcdir)/*.h $(top_builddir)*.h $(top_srcdir)/*.h
86 $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
88 ifeq "$(findstring $(MAKECMDGOALS),uninstall installcheck installdirs checkconf \
89 clean distclean mostlyclean realclean)" ""
92 include $(srcdir)/clean.mk
96 $(TARGET): $(OBJECTS) $(SLIBOBJS) $(SDCCOBJS)
97 $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(SLIBOBJS) $(SDCCOBJS) $(LIBDIRS) $(LIBS)
100 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
102 $(SLIBOBJS):%.o:$(SLIB)/%.c
103 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
105 $(SDCCOBJS):%.o:$(SDCCLIB)/%.c
106 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
108 # Remaking configuration
109 # ----------------------
111 @if [ -f $(top_builddir)devel ]; then\
112 $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
115 # End of cpp/Makefile