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