* device/lib/pic16/Makefile.common.in: added $(MM) to fix `make clean`
[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 PRJDIR          = ../..
17 SLIB            = $(PRJDIR)/support/Util
18
19 srcdir          = @srcdir@
20 prefix          = @prefix@
21 exec_prefix     = @exec_prefix@
22 bindir          = @bindir@
23 libdir          = @libdir@
24 datadir         = @datadir@
25 includedir      = @includedir@
26 mandir          = @mandir@
27 man1dir         = $(mandir)/man1
28 man2dir         = $(mandir)/man2
29 infodir         = @infodir@
30
31 STD_INC         = @sdcc_include_dir@
32 CPPFLAGS        = @CPPFLAGS@ -I. -I$(PRJDIR) -I$(PRJDIR)/support -I$(SLIB)
33 CFLAGS          = @CFLAGS@
34 M_OR_MM         = @M_OR_MM@
35 LDFLAGS         = @LDFLAGS@
36
37 EXEEXT          = @EXEEXT@
38
39 LIBS            = @LIBS@
40 LIBDIRS         =
41
42 SLIBOBJS                = NewAlloc.o
43
44 OBJECTS         = sdcdb.o symtab.o simi.o $(PRJDIR)/src/SDCCset.o \
45                   break.o cmd.o $(PRJDIR)/src/SDCChasht.o \
46                   $(PRJDIR)/support/Util/SDCCerr.o
47 SOURCES         = $(patsubst %.o,%.c,$(OBJECTS))
48
49 TARGET          = $(PRJDIR)/bin/sdcdb$(EXEEXT)
50
51
52 # Compiling entire program or any subproject
53 # ------------------------------------------
54 all: checkconf $(TARGET)
55
56 # Compiling and installing everything and runing test
57 # ---------------------------------------------------
58 install: all installdirs
59         $(INSTALL) $(TARGET) $(DESTDIR)$(bindir)/sdcdb$(EXEEXT)
60         $(STRIP) $(DESTDIR)$(bindir)/sdcdb$(EXEEXT)
61         cp $(PRJDIR)/debugger/mcs51/sdcdb.el $(DESTDIR)$(bindir)/sdcdb.el
62         cp $(PRJDIR)/debugger/mcs51/sdcdbsrc.el $(DESTDIR)$(bindir)/sdcdbsrc.el
63
64
65 # Deleting all the installed files
66 # --------------------------------
67 uninstall:
68         rm -f $(DESTDIR)$(bindir)/sdcdb$(EXEEXT)
69         rm -f $(DESTDIR)$(bindir)/sdcdb.el
70         rm -f $(DESTDIR)$(bindir)/sdcdbsrc.el
71
72 # Performing self-test
73 # --------------------
74 check:
75
76
77 # Performing installation test
78 # ----------------------------
79 installcheck:
80
81
82 # Creating installation directories
83 # ---------------------------------
84 installdirs:
85         $(INSTALL) -d $(DESTDIR)$(bindir)
86
87
88 # Creating dependencies
89 # ---------------------
90 dep: Makefile.dep
91
92 Makefile.dep: $(SOURCES) *.h $(PRJDIR)/*.h
93         $(CPP) $(CPPFLAGS) $(M_OR_MM) $(SOURCES) >Makefile.dep
94
95 include Makefile.dep
96 include clean.mk
97
98 # My rules
99 # --------
100 $(TARGET): $(OBJECTS) $(SLIBOBJS)
101         $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(SLIBOBJS) $(LIBDIRS) $(LIBS)
102
103 .c.o:
104         $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
105
106 $(SLIBOBJS):%.o:$(SLIB)/%.c
107         $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
108
109 # Remaking configuration
110 # ----------------------
111 checkconf:
112         @if [ -f $(PRJDIR)/devel ]; then\
113           $(MAKE) -f conf.mk srcdir="$(srcdir)" PRJDIR="$(PRJDIR)" freshconf;\
114         fi
115
116 # End of cpp/Makefile