13 top_srcdir
= @
srcdir@
/..
/..
14 SLIB
= $(top_srcdir
)/support
/util
15 SDCCLIB
= $(top_srcdir
)/src
21 exec_prefix = @
exec_prefix@
24 transform
= @program_transform_name@
26 STD_INC
= @sdcc_include_dir@
27 CPPFLAGS
= @CPPFLAGS@
-I.
-I
$(top_builddir
) -I
$(top_srcdir
) -I
$(SLIB
) -DHAVE_CONFIG_H
28 CFLAGS
= @CFLAGS@ @WALL_FLAG@
33 LIBS
= @LIBS@ @LIBREADLINE@
36 OBJECTS
= sdcdb.o symtab.o simi.o \
38 SLIBOBJS
= NewAlloc.o dbuf.o dbuf_string.o
39 SDCCOBJS
= SDCCset.o SDCChasht.o SDCCerr.o
41 SOURCES
= $(patsubst %.o
,%.c
,$(OBJECTS
))
42 SLIBSOURCES
= $(patsubst %.o
,$(SLIB
)/%.c
,$(SLIBOBJS
))
43 SDCCSOURCES
= $(patsubst %.o
,$(SDCCLIB
)/%.c
,$(SDCCOBJS
))
45 TARGET
= $(top_builddir
)/bin
/sdcdb
$(EXEEXT
)
48 # Compiling entire program or any subproject
49 # ------------------------------------------
50 all: checkconf
$(TARGET
)
52 # Compiling and installing everything and runing test
53 # ---------------------------------------------------
54 install: all installdirs
55 $(INSTALL
) $(TARGET
) $(DESTDIR
)$(bindir)/`echo sdcdb|sed '$(transform)'`$(EXEEXT
)
56 $(STRIP
) $(DESTDIR
)$(bindir)/`echo sdcdb|sed '$(transform)'`$(EXEEXT
)
57 cp
$(srcdir)/sdcdb.el
$(DESTDIR
)$(bindir)/`echo 'sdcdb'|sed '$(transform)'`.el
58 cp
$(srcdir)/sdcdbsrc.el
$(DESTDIR
)$(bindir)/`echo 'sdcdbsrc'|sed '$(transform)'`.el
61 # Deleting all the installed files
62 # --------------------------------
64 rm -f
$(DESTDIR
)$(bindir)/`echo sdcdb|sed '$(transform)'`$(EXEEXT
)
65 rm -f
$(DESTDIR
)$(bindir)/`echo 'sdcdb'|sed '$(transform)'`.el
66 rm -f
$(DESTDIR
)$(bindir)/`echo 'sdcdbsrc'|sed '$(transform)'`.el
68 # Performing self-test
69 # --------------------
73 # Performing installation test
74 # ----------------------------
78 # Creating installation directories
79 # ---------------------------------
81 $(INSTALL
) -d
$(DESTDIR
)$(bindir)
84 # Creating dependencies
85 # ---------------------
88 Makefile.dep
: $(SOURCES
) $(SLIBSOURCES
) $(SDCCSOURCES
) $(srcdir)/*.h
$(top_builddir
)/*.h
$(top_srcdir
)/*.h
89 $(MAKEDEP
) $(CPPFLAGS
) $(filter %.c
,$^
) >Makefile.dep
91 ifeq "$(findstring $(MAKECMDGOALS),uninstall installcheck installdirs checkconf \
92 clean distclean mostlyclean realclean)" ""
95 include $(srcdir)/clean.mk
99 $(TARGET
): $(OBJECTS
) $(SLIBOBJS
) $(SDCCOBJS
)
100 $(CC
) $(LDFLAGS
) -o
$@
$(OBJECTS
) $(SLIBOBJS
) $(SDCCOBJS
) $(LIBDIRS
) $(LIBS
)
103 $(CC
) $(CPPFLAGS
) $(CFLAGS
) -c
-o
$@
$<
105 $(SLIBOBJS
):%.o
:$(SLIB
)/%.c
106 $(CC
) $(CPPFLAGS
) $(CFLAGS
) -c
-o
$@
$<
108 $(SDCCOBJS
):%.o
:$(SDCCLIB
)/%.c
109 $(CC
) $(CPPFLAGS
) $(CFLAGS
) -c
-o
$@
$<
111 # Remaking configuration
112 # ----------------------
114 @if
[ -f
$(top_builddir
)/devel
]; then\
115 $(MAKE
) -f conf.mk
srcdir="$(srcdir)" top_builddir
="$(top_builddir)" freshconf
;\
118 # End of cpp/Makefile