source: git/omalloc/Makefile.in @ ba6f0c

fieker-DuValspielwiese
Last change on this file since ba6f0c was e36e3a, checked in by Olaf Bachmann <obachman@…>, 25 years ago
* .. git-svn-id: file:///usr/local/Singular/svn/trunk@3903 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 4.5 KB
Line 
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
9SHELL           = /bin/sh
10
11##
12## various paths
13##
14# header file is installed here
15includedir      = @includedir@
16# library is installed here
17libdir          = @libdir@
18
19##
20## various programs
21##
22@SET_MAKE@
23CC              = @CC@
24AR              = @AR@
25RANLIB          = @RANLIB@
26PERL            = @PERL@
27INSTALL         = ../install-sh -c
28INSTALL_PROGRAM = ${INSTALL}
29INSTALL_DATA    = ${INSTALL} -m 644
30MKINSTALLDIRS   = ../mkinstalldirs
31
32##
33## compiler and linker options
34##
35CFLAGS          = @CFLAGS@
36CPPFLAGS        = @CPPFLAGS@
37DEFS            = -DNDEBUG @DEFS@
38
39##
40## End configuration dependend stuff
41#################################################################
42
43###
44### file sets
45###
46
47# normal C source files
48CSOURCES=omAlloc.c omList.c  omDebug.c omPage.c omLocal.c omFindExec.c \
49         omTrack.c omCheck.c gmalloc.c
50
51SOURCES=${CSOURCES}
52
53# ASO_SOURCES
54ASO_SOURCES =
55
56HEADERS=omPrivate.h omList.h omAlloc.h omPage.c omLocal.h omMemOps.h \
57        omDebug.h omTrack.h omFindExec.h
58
59OBJS := $(CSOURCES:.c=.o)
60
61ASO_OBJS := $(ASO_SOURCES:.aso.cc=.aso)
62
63DISTFILES=$(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
79all:    lib libomalloc.h libg
80
81lib: libomalloc.a
82
83libomalloc.a: $(OBJS) Makefile omConfig.h
84        rm -f $@
85        $(AR) cr $@ $(OBJS)
86        $(RANLIB) $@
87
88libomalloc.h: $(HEADERS)
89        $(PERL) makeheader.pl omAlloc.h $@
90
91omTables.inc: omTables
92        ./omTables > $@
93
94omTables: omPrivate.h omConfig.h omTables.c
95        ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -DOM_GENERATE_INC omTables.c -o omTables
96
97omConfig.h: stamp-h
98
99stamp-h : config.status omConfig.h.in
100        CONFIG_FILES= CONFIG_HEADERS="omConfig.h" ./config.status
101
102Makefile: Makefile.in config.status
103        CONFIG_FILES="Makefile" CONFIG_HEADERS= ./config.status
104
105config.status: configure
106        ./config.status --recheck
107
108configure: 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##
116install: 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
123uninstall:
124        rm -f $(includedir)/omAlloc.h $(libdir)/libomalloc.a
125
126##
127## clean targest
128##
129mostlyclean:
130        -rm -f core *.d *.o *.og *.op *_d.c *.a depend a.out *.tgz omTables
131        -rm -f omTest omTest_* libomalloc*
132
133clean: mostlyclean
134
135distclean: clean
136        -rm -f  *~ .\#*  stamp-h configure
137        -rm -f omConfig.h Makefile TAGS* tags config.status config.cache config.log
138
139srcclean: distclean
140
141maintainer-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
152CCG             = gcc
153CCM             = gcc -MM -DGENERATE_DEPEND
154
155CFLAGSG         = -g -Wall -Wno-unused -pipe
156DEFSG           =  @DEFS@
157
158##
159## .og files for having -O and -g object versions available at the same time
160##
161OBJG := $(CSOURCES:.c=.og)
162
163
164##
165## Debug Targets
166##
167%.og: %.c
168        $(CCG) ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
169
170libg: libomalloc_g.a
171
172libomalloc_g.a: $(OBJG) Makefile omConfig.h
173        rm -f $@
174        $(AR) cr $@ $(OBJG)
175        $(RANLIB) $@
176
177
178##
179## Debug Targets
180##
181OBJD := $(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
189libd: libomalloc_d.a
190
191libomalloc_d.a: $(OBJD) Makefile omConfig.h
192        rm -f $@
193        $(AR) cr $@ $(OBJD)
194        $(RANLIB) $@
195
196
197##
198## Test program
199##
200
201omTest_d: libd omTest.c
202        $(CCG) ${CFLAGSG} ${CPPFLAGS} ${DEFSG} omTest.c -L. -lomalloc_d -o omTest_d
203
204omTest_g: libg omTest.c
205        $(CCG) ${CFLAGSG} ${CPPFLAGS} ${DEFSG} omTest.c -L. -lomalloc_g -o omTest_g
206
207omTest: lib omTest.c
208        $(CC) ${CFLAGS} ${CPPFLAGS} ${DEFS} omTest.c -L. -lomalloc -o omTest
209
210
211##
212## tar and backup
213##
214
215tar:
216        tar czvf omalloc.tgz $(DISTFILES)
217
218backup: 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
228depend:   $(CSOURCES:.c=.d) omConfig.h
229        cat *.d >depend
230
231ifeq (depend,$(wildcard depend))
232include depend
233endif
234
235
236
Note: See TracBrowser for help on using the repository browser.