* debugger/mcs51/acinclude.m4, debugger/mcs51/aclocal.m4,
[fw/sdcc] / debugger / mcs51 / Makefile.in
1 #
2 #
3 #
4
5 SHELL           = /bin/sh
6 CC              = @CC@
7 CPP             = @CPP@
8 INSTALL         = @INSTALL@
9 STRIP           = @STRIP@
10
11
12 top_builddir    = ../../
13 top_srcdir      = @srcdir@/../..
14 SLIB            = $(top_builddir)support/Util
15 SDCCLIB         = $(top_builddir)src
16
17 VPATH           = @srcdir@
18 srcdir          = @srcdir@
19
20 bindir          = @bindir@
21
22 STD_INC         = @sdcc_include_dir@
23 CPPFLAGS        = @CPPFLAGS@ -I. -I$(top_builddir) -I$(top_srcdir) -I$(srcdir)/$(SLIB) -DHAVE_CONFIG_H
24 CFLAGS          = @CFLAGS@
25 M_OR_MM         = @M_OR_MM@
26 LDFLAGS         = @LDFLAGS@
27
28 EXEEXT          = @EXEEXT@
29
30 LIBS            = @LIBS@ @LIBREADLINE@
31 LIBDIRS         =
32
33 OBJECTS         = sdcdb.o symtab.o simi.o \
34                   break.o cmd.o
35 SLIBOBJS        = NewAlloc.o SDCCerr.o
36 SDCCOBJS        = SDCCset.o SDCChasht.o
37
38 SOURCES         = $(patsubst %.o,%.c,$(OBJECTS))
39 SLIBSOURCES     = $(patsubst %.o,$(SLIB)/%.c,$(SLIBOBJS))
40 SDCCSOURCES     = $(patsubst %.o,$(SDCCLIB)/%.c,$(SDCCOBJS))
41
42 TARGET          = $(top_builddir)bin/sdcdb$(EXEEXT)
43
44
45 # Compiling entire program or any subproject
46 # ------------------------------------------
47 all: checkconf $(TARGET)
48
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
56
57
58 # Deleting all the installed files
59 # --------------------------------
60 uninstall:
61         rm -f $(DESTDIR)$(bindir)/sdcdb$(EXEEXT)
62         rm -f $(DESTDIR)$(bindir)/sdcdb.el
63         rm -f $(DESTDIR)$(bindir)/sdcdbsrc.el
64
65 # Performing self-test
66 # --------------------
67 check:
68
69
70 # Performing installation test
71 # ----------------------------
72 installcheck:
73
74
75 # Creating installation directories
76 # ---------------------------------
77 installdirs:
78         $(INSTALL) -d $(DESTDIR)$(bindir)
79
80
81 # Creating dependencies
82 # ---------------------
83 dep: Makefile.dep
84
85 Makefile.dep: $(SOURCES) $(SLIBSOURCES) $(SDCCSOURCES) $(srcdir)/*.h $(top_builddir)*.h $(top_srcdir)/*.h
86         $(CPP) $(CPPFLAGS) $(M_OR_MM) $(filter %.c,$^) >Makefile.dep
87
88 ifeq "$(findstring $(MAKECMDGOALS),uninstall installcheck installdirs checkconf \
89                                    clean distclean mostlyclean realclean)" ""
90   include Makefile.dep
91 endif
92 include $(srcdir)/clean.mk
93
94 # My rules
95 # --------
96 $(TARGET): $(OBJECTS) $(SLIBOBJS) $(SDCCOBJS)
97         $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(SLIBOBJS) $(SDCCOBJS) $(LIBDIRS) $(LIBS)
98
99 .c.o:
100         $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
101
102 $(SLIBOBJS):%.o:$(SLIB)/%.c
103         $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
104
105 $(SDCCOBJS):%.o:$(SDCCLIB)/%.c
106         $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
107
108 # Remaking configuration
109 # ----------------------
110 checkconf:
111         @if [ -f $(top_builddir)devel ]; then\
112           $(MAKE) -f conf.mk srcdir="$(srcdir)" top_builddir="$(top_builddir)" freshconf;\
113         fi
114
115 # End of cpp/Makefile