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