1 | ################################################################# |
---|
2 | ### File: Makefile.in |
---|
3 | ### Purpose: Makefile for omalloc |
---|
4 | ### Author: obachman@mathematik.uni-kl.de (Olaf Bachmann) |
---|
5 | ### Created: 11/99 |
---|
6 | ### Version: $Id: Makefile.in,v 1.2 1999-11-23 20:40:11 obachman Exp $ |
---|
7 | ################################################################# |
---|
8 | |
---|
9 | SHELL = /bin/sh |
---|
10 | |
---|
11 | ## |
---|
12 | ## various paths |
---|
13 | ## |
---|
14 | # header file is installed here |
---|
15 | includedir = @includedir@ |
---|
16 | # library is installed here |
---|
17 | libdir = @libdir@ |
---|
18 | |
---|
19 | ## |
---|
20 | ## various programs |
---|
21 | ## |
---|
22 | @SET_MAKE@ |
---|
23 | CC = @CC@ |
---|
24 | AR = @AR@ |
---|
25 | RANLIB = @RANLIB@ |
---|
26 | PERL = @PERL@ |
---|
27 | INSTALL = ../install-sh -c |
---|
28 | INSTALL_PROGRAM = ${INSTALL} |
---|
29 | INSTALL_DATA = ${INSTALL} -m 644 |
---|
30 | MKINSTALLDIRS = ../mkinstalldirs |
---|
31 | |
---|
32 | ## |
---|
33 | ## compiler and linker options |
---|
34 | ## |
---|
35 | CFLAGS = @CFLAGS@ |
---|
36 | CPPFLAGS = @CPPFLAGS@ |
---|
37 | DEFS = -DNDEBUG @DEFS@ |
---|
38 | |
---|
39 | ## |
---|
40 | ## End configuration dependend stuff |
---|
41 | ################################################################# |
---|
42 | |
---|
43 | ### |
---|
44 | ### file sets |
---|
45 | ### |
---|
46 | |
---|
47 | # normal C source files |
---|
48 | CSOURCES=omAlloc.c omList.c omDebug.c omPage.c omLocal.c omFindExec.c \ |
---|
49 | omTrack.c omCheck.c gmalloc.c |
---|
50 | |
---|
51 | SOURCES=${CSOURCES} |
---|
52 | |
---|
53 | # ASO_SOURCES |
---|
54 | ASO_SOURCES = |
---|
55 | |
---|
56 | HEADERS=omPrivate.h omList.h omAlloc.h omPage.c omLocal.h omMemOps.h \ |
---|
57 | omDebug.h omTrack.h omFindExec.h |
---|
58 | |
---|
59 | OBJS := $(CSOURCES:.c=.o) |
---|
60 | |
---|
61 | ASO_OBJS := $(ASO_SOURCES:.aso.cc=.aso) |
---|
62 | |
---|
63 | DISTFILES=$(SOURCES) $(HEADERS) makeheader.pl Makefile.in \ |
---|
64 | omConfig.h.in omTables.c omTest.c |
---|
65 | ## |
---|
66 | ## Build Targets |
---|
67 | ## |
---|
68 | |
---|
69 | %.o: %.c omConfig.h omTables.inc |
---|
70 | ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $< |
---|
71 | |
---|
72 | %.aso.o: %.aso.cc mmtables.inc |
---|
73 | ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} $< -o $@ |
---|
74 | .PRECIOUS: %.aso.o |
---|
75 | |
---|
76 | %.aso: %.aso.o |
---|
77 | ./$< > $@ |
---|
78 | |
---|
79 | all: lib libomalloc.h libg |
---|
80 | |
---|
81 | lib: libomalloc.a |
---|
82 | |
---|
83 | libomalloc.a: $(OBJS) Makefile omConfig.h |
---|
84 | rm -f $@ |
---|
85 | $(AR) cr $@ $(OBJS) |
---|
86 | $(RANLIB) $@ |
---|
87 | |
---|
88 | libomalloc.h: $(HEADERS) |
---|
89 | $(PERL) makeheader.pl omAlloc.h $@ |
---|
90 | |
---|
91 | omTables.inc: omTables |
---|
92 | ./omTables > $@ |
---|
93 | |
---|
94 | omTables: omPrivate.h omConfig.h omTables.c |
---|
95 | ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -DOM_GENERATE_INC omTables.c -o omTables |
---|
96 | |
---|
97 | omConfig.h: stamp-h |
---|
98 | |
---|
99 | stamp-h : config.status omConfig.h.in |
---|
100 | CONFIG_FILES= CONFIG_HEADERS="omConfig.h" ./config.status |
---|
101 | |
---|
102 | Makefile: Makefile.in config.status |
---|
103 | CONFIG_FILES="Makefile" CONFIG_HEADERS= ./config.status |
---|
104 | |
---|
105 | config.status: configure |
---|
106 | ./config.status --recheck |
---|
107 | |
---|
108 | configure: configure.in |
---|
109 | @echo "WARNING: You need to rerun autoconf. I am proceeding, for now." |
---|
110 | @touch configure |
---|
111 | # autoconf |
---|
112 | |
---|
113 | ## |
---|
114 | ## install targets |
---|
115 | ## |
---|
116 | install: all |
---|
117 | $(MKINSTALLDIRS) $(libdir) |
---|
118 | $(MKINSTALLDIRS) $(includedir) |
---|
119 | $(INSTALL_DATA) libomalloc.a $(libdir) |
---|
120 | $(RANLIB) $(libdir)/libomalloc.a |
---|
121 | $(INSTALL_DATA) libmalloc.h $(includedir)/omAlloc.h |
---|
122 | |
---|
123 | uninstall: |
---|
124 | rm -f $(includedir)/omAlloc.h $(libdir)/libomalloc.a |
---|
125 | |
---|
126 | ## |
---|
127 | ## clean targest |
---|
128 | ## |
---|
129 | mostlyclean: |
---|
130 | -rm -f core *.d *.o *.og *.op *_d.c *.a depend a.out *.tgz omTables |
---|
131 | -rm -f omTest omTest_* libomalloc* |
---|
132 | |
---|
133 | clean: mostlyclean |
---|
134 | |
---|
135 | distclean: clean |
---|
136 | -rm -f *~ .\#* stamp-h configure |
---|
137 | -rm -f omConfig.h Makefile TAGS* tags config.status config.cache config.log |
---|
138 | |
---|
139 | srcclean: distclean |
---|
140 | |
---|
141 | maintainer-clean: distclean |
---|
142 | rm configure |
---|
143 | |
---|
144 | ## |
---|
145 | ## Below here is stuff for developpers |
---|
146 | ################################################################# |
---|
147 | |
---|
148 | ## |
---|
149 | ## compiler and linker options for debug version |
---|
150 | ## |
---|
151 | |
---|
152 | CCG = gcc |
---|
153 | CCM = gcc -MM -DGENERATE_DEPEND |
---|
154 | |
---|
155 | CFLAGSG = -g -Wall -Wno-unused -pipe |
---|
156 | DEFSG = @DEFS@ |
---|
157 | |
---|
158 | ## |
---|
159 | ## .og files for having -O and -g object versions available at the same time |
---|
160 | ## |
---|
161 | OBJG := $(CSOURCES:.c=.og) |
---|
162 | |
---|
163 | |
---|
164 | ## |
---|
165 | ## Debug Targets |
---|
166 | ## |
---|
167 | %.og: %.c |
---|
168 | $(CCG) ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@ |
---|
169 | |
---|
170 | libg: libomalloc_g.a |
---|
171 | |
---|
172 | libomalloc_g.a: $(OBJG) Makefile omConfig.h |
---|
173 | rm -f $@ |
---|
174 | $(AR) cr $@ $(OBJG) |
---|
175 | $(RANLIB) $@ |
---|
176 | |
---|
177 | |
---|
178 | ## |
---|
179 | ## Debug Targets |
---|
180 | ## |
---|
181 | OBJD := $(CSOURCES:%.c=%_d.og) |
---|
182 | |
---|
183 | %_d.c : %.c |
---|
184 | $(CCG) -E -P $< | $(PERL) -p -e 's/;/;\n/g' | $(PERL) -p -e 's/\{/\n\{/g' | $(PERL) -p -e 's/\}/\n\}/g' > $@ |
---|
185 | .PRECIOUS: %_d.c |
---|
186 | |
---|
187 | |
---|
188 | |
---|
189 | libd: libomalloc_d.a |
---|
190 | |
---|
191 | libomalloc_d.a: $(OBJD) Makefile omConfig.h |
---|
192 | rm -f $@ |
---|
193 | $(AR) cr $@ $(OBJD) |
---|
194 | $(RANLIB) $@ |
---|
195 | |
---|
196 | |
---|
197 | ## |
---|
198 | ## Test program |
---|
199 | ## |
---|
200 | |
---|
201 | omTest_d: libd omTest.c |
---|
202 | $(CCG) ${CFLAGSG} ${CPPFLAGS} ${DEFSG} omTest.c -L. -lomalloc_d -o omTest_d |
---|
203 | |
---|
204 | omTest_g: libg omTest.c |
---|
205 | $(CCG) ${CFLAGSG} ${CPPFLAGS} ${DEFSG} omTest.c -L. -lomalloc_g -o omTest_g |
---|
206 | |
---|
207 | omTest: lib omTest.c |
---|
208 | $(CC) ${CFLAGS} ${CPPFLAGS} ${DEFS} omTest.c -L. -lomalloc -o omTest |
---|
209 | |
---|
210 | |
---|
211 | ## |
---|
212 | ## tar and backup |
---|
213 | ## |
---|
214 | |
---|
215 | tar: |
---|
216 | tar czvf omalloc.tgz $(DISTFILES) |
---|
217 | |
---|
218 | backup: tar |
---|
219 | mcopy omalloc.tgz a: |
---|
220 | |
---|
221 | ## |
---|
222 | ## Dependencies |
---|
223 | ## |
---|
224 | %.d: %.c omConfig.h Makefile |
---|
225 | echo $(@:.d=.og) $(@:.d=.od) $(@:.d=_d.c) $(@:.d=.ot)" " \\ > $@ |
---|
226 | $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@ |
---|
227 | |
---|
228 | depend: $(CSOURCES:.c=.d) omConfig.h |
---|
229 | cat *.d >depend |
---|
230 | |
---|
231 | ifeq (depend,$(wildcard depend)) |
---|
232 | include depend |
---|
233 | endif |
---|
234 | |
---|
235 | |
---|
236 | |
---|