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