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