source: git/omalloc/Makefile.in @ 07a5f8

spielwiese
Last change on this file since 07a5f8 was 07a5f8, checked in by Hans Schoenemann <hannes@…>, 14 years ago
tr 241/ par. build of omalloc git-svn-id: file:///usr/local/Singular/svn/trunk@12965 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 10.2 KB
RevLine 
[66502b8]1#################################################################
2### File:    Makefile.in
3### Purpose: Makefile for omalloc
4### Author:  obachman@mathematik.uni-kl.de (Olaf Bachmann)
5### Created: 11/99
[341696]6### Version: $Id$
[66502b8]7#################################################################
8
9SHELL           = /bin/sh
[3df5b10]10VERSION         = @VERSION@
[66502b8]11
12##
13## various paths
14##
[3df5b10]15prefix          = @prefix@
16exec_prefix     = @exec_prefix@
17
[66502b8]18# header file is installed here
19includedir      = @includedir@
20# library is installed here
21libdir          = @libdir@
22
23##
24## various programs
25##
26@SET_MAKE@
27CC              = @CC@
28AR              = @AR@
29RANLIB          = @RANLIB@
30PERL            = @PERL@
[be7466]31LN_S            = @LN_S@
[3df5b10]32INSTALL         = @INSTALL@
[13fe1b]33INSTALL_PROGRAM = @INSTALL_PROGRAM@
[3df5b10]34INSTALL_DATA    = @INSTALL_DATA@
35MKINSTALLDIRS   = ./mkinstalldirs
[66502b8]36##
37## compiler and linker options
38##
[13fe1b]39CFLAGS          = @CFLAGS@
[3df5b10]40CPPFLAGS        = -I. @CPPFLAGS@
41DEFS            = @DEFS@
[66502b8]42
[be7466]43##
44## external config and and malloc files
45##
46EXTERNAL_CONFIG_SOURCE = @EXTERNAL_CONFIG_SOURCE@
[3df5b10]47EXTERNAL_CONFIG_HEADER = @EXTERNAL_CONFIG_HEADER@
[be7466]48
49OM_MALLOC_HEADER = @OM_MALLOC_HEADER@
50OM_MALLOC_SOURCE = @OM_MALLOC_SOURCE@
51
[66502b8]52##
53## End configuration dependend stuff
54#################################################################
55
56###
57### file sets
58###
59
[be7466]60# normal C source files
[3df5b10]61CSOURCES=                                                          \
62omBinPage.c      omList.c         omAllocEmulate.c omDebug.c       \
[e6ad6a7]63om_Alloc.c        omDebugCheck.c   omOpts.c         omGetBackTrace.c\
[3df5b10]64omAllocSystem.c  omError.c        omStats.c        omRet2Info.c   \
65omBin.c          omFindExec.c     omDebugTrack.c                   \
[d83977]66omalloc_provide.c omAllocFunc.c
[be7466]67
68ifdef EXTERNAL_CONFIG_SOURCE
69GSOURCES := ${GSOURCES} omExternalConfig.c
70endif
71ifdef OM_MALLOC_SOURCE
72GSOURCES := ${GSOURCES} omMalloc.c
73endif
[66502b8]74
75# ASO_SOURCES
[13fe1b]76ASO_SOURCES =
[66502b8]77
[a90dc0]78HEADERS=               mylimits.h             omlimits.h \
[8d0069]79om_Alloc.h             omList.h               omDerivedConfig.h \
[be7466]80omAllocDecl.h          omConfig.h             omMemOps.h        \
[3df5b10]81omDebug.h              omOpts.h               omInlineDecl.h    \
[be7466]82omAllocPrivate.h       omError.h              omPage.h          \
83omAllocSystem.h        omFindExec.h           omStats.h         \
84omBin.h                omDefaultConfig.h      omStructs.h       \
[3df5b10]85omBinPage.h            omInline.h             omGetBackTrace.h  \
[d83977]86omReturn.h             omRet2Info.h           omAllocFunc.h             
[be7466]87
[13fe1b]88OBJS := $(CSOURCES:.c=.o)  $(GSOURCES:.c=.o)
89OBJS_NDEBUG := $(CSOURCES:.c=.o_ndebug) $(GSOURCES:.c=.o_ndebug)
[66502b8]90
[be7466]91SOURCES=${CSOURCES} omGetPageSize.h omMallocSystem.h gmalloc.c dlmalloc.h dlmalloc.c \
[3df5b10]92        omMmap.c gmalloc.c omTables.c pmalloc.h pmalloc.c omalloc.c omalloc_debug.c  \
[13fe1b]93        $(TESTSOURCES) omtTestAlloc.c
[66502b8]94
[13fe1b]95ASO_OBJS := $(ASO_SOURCES:.aso.cc=.aso)
[66502b8]96
[6e9d845]97DISTFILES=$(SOURCES) $(HEADERS) omtTest.h makeheader Makefile.in \
[a90dc0]98           omConfig.h.in omlimits.h.in mylimits.h configure.in mkinstalldirs install-sh configure
[3df5b10]99
[66502b8]100##
101## Build Targets
102##
[a90dc0]103%.o: %.c omConfig.h omlimits.h omTables.h omalloc.h omTables.inc
[66502b8]104        ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $<
105
[a90dc0]106%.o_ndebug: %.c omConfig.h omlimits.h mylimits.h omTables.h omalloc.h omTables.inc
[3df5b10]107        ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -DOM_NDEBUG -c $< -o $@
108
[13fe1b]109%.aso.o: %.aso.cc mmtables.inc
[66502b8]110        ${CXX} ${CXXFLAGS} ${CXXTEMPLFLAGS} ${CPPFLAGS} ${DEFS} $< -o $@
111.PRECIOUS: %.aso.o
112
113%.aso: %.aso.o
114        ./$< > $@
115
[3df5b10]116all:    libomalloc.a libomalloc_ndebug.a omalloc.h omalloc.o omalloc_debug.o
[66502b8]117
118lib: libomalloc.a
119
[a90dc0]120libomalloc.a: $(OBJS) Makefile omConfig.h omlimits.h mylimits.h
[66502b8]121        rm -f $@
[13fe1b]122        $(AR) cr $@ $(OBJS)
[66502b8]123        $(RANLIB) $@
124
[a90dc0]125libomalloc_ndebug.a: $(OBJS_NDEBUG) Makefile omConfig.h omlimits.h mylimits.h
[3df5b10]126        rm -f $@
[13fe1b]127        $(AR) cr $@ $(OBJS_NDEBUG)
[3df5b10]128        $(RANLIB) $@
129
[13fe1b]130omalloc.h: $(HEADERS)
[6e9d845]131        ./makeheader om_Alloc.h $@
[3df5b10]132
133omalloc.o: omalloc.c
134        ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -DOM_NDEBUG -c $< -o $@
135
[13fe1b]136omalloc_debug.o: omalloc_debug.c
[3df5b10]137        ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $< -o $@
[66502b8]138
139omTables.inc: omTables
[07a5f8]140        ./omTables > omTables.xx && mv omTables.xx  $@
[66502b8]141
[3df5b10]142omTables.h: omTables
[07a5f8]143        ./omTables 1 >omTables.yy 77 mv omTables.yy $@
[3df5b10]144
[a90dc0]145omTables: omAllocPrivate.h omConfig.h omTables.c omlimits.h mylimits.h
[66502b8]146        ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -DOM_GENERATE_INC omTables.c -o omTables
147
[be7466]148#
149# targets to generate omExternalConfig.[c,h]
150#
[2c72eb]151om_Alloc.h: omMalloc.h
[66502b8]152
[be7466]153ifdef OM_MALLOC_SOURCE
[13fe1b]154omMalloc.c: $(OM_MALLOC_SOURCE)
[be7466]155        cp $(OM_MALLOC_SOURCE) omMalloc.c
156endif
157ifdef EXTERNAL_CONFIG_SOURCE
158omExternalConfig.c: $(EXTERNAL_CONFIG_SOURCE)
159        cp $(EXTERNAL_CONFIG_SOURCE) omExternalConfig.c
160endif
[3df5b10]161
[be7466]162ifdef EXTERNAL_CONFIG_HEADER
[3df5b10]163omExternalConfig.h: $(EXTERNAL_CONFIG_HEADER)
164        cp $(EXTERNAL_CONFIG_HEADER) omExternalConfig.h
165omDerivedConfig.h: omExternalConfig.h
[be7466]166endif
167
168#
169# configure related stuff
170#
[a90dc0]171omConfig.h omMalloc.h omlimits.h mylimits.h: stamp-h
[be7466]172
[a90dc0]173stamp-h : config.status omConfig.h.in omlimits.h.in ${OM_MALLOC_HEADER}
174        CONFIG_FILES= CONFIG_HEADERS="omConfig.h omlimits.h omMalloc.h:${OM_MALLOC_HEADER}" ./config.status
[66502b8]175
176Makefile: Makefile.in config.status
177        CONFIG_FILES="Makefile" CONFIG_HEADERS= ./config.status
178
179config.status: configure
180        ./config.status --recheck
181
182configure: configure.in
183        @echo "WARNING: You need to rerun autoconf. I am proceeding, for now."
184        @touch configure
185#       autoconf
186
187##
188## install targets
189##
[a1ab2a]190install-nolns: install
191
192install-libsingular:
193        $(MKINSTALLDIRS) $(includedir)/singular
194        $(INSTALL) omalloc.h $(includedir)/singular
195
[be6689f]196install: all
[66502b8]197        $(MKINSTALLDIRS) $(libdir)
198        $(MKINSTALLDIRS) $(includedir)
199        $(INSTALL_DATA) libomalloc.a $(libdir)
200        $(RANLIB) $(libdir)/libomalloc.a
[3df5b10]201        $(INSTALL_DATA) libomalloc_ndebug.a $(libdir)
202        $(RANLIB) $(libdir)/libomalloc_ndebug.a
[c753931]203        $(INSTALL_DATA) omalloc.o $(libdir)
204        $(INSTALL_DATA) omalloc_debug.o $(libdir)
205        $(INSTALL_DATA) omalloc.h $(includedir)
206        $(INSTALL_DATA) omalloc.c $(includedir)
207        $(INSTALL_DATA) omlimits.h $(includedir)
208        $(INSTALL_DATA) mylimits.h $(includedir)
[3df5b10]209
[be6689f]210install_all: install libomalloc_p.a
211        $(INSTALL_DATA) libomalloc_p.a $(libdir)
212        $(RANLIB) $(libdir)/libomalloc_p.a
213
[c1c2691]214install_min: libomalloc_ndebug.a omalloc.o
[ee2c29]215        $(MKINSTALLDIRS) $(libdir)
216        $(MKINSTALLDIRS) $(includedir)
217        $(INSTALL_DATA) libomalloc_ndebug.a $(libdir)
218        $(RANLIB) $(libdir)/libomalloc_ndebug.a
219        $(INSTALL_DATA) omalloc.o $(libdir)
[c753931]220        $(INSTALL_DATA) omalloc.h $(includedir)
221        $(INSTALL_DATA) omalloc.c $(includedir)
222        $(INSTALL_DATA) omlimits.h $(includedir)
223        $(INSTALL_DATA) mylimits.h $(includedir)
[66502b8]224
[13fe1b]225uninstall:
[3df5b10]226        rm -f $(includedir)/omalloc.h $(includedir)/omalloc.c
227        rm -f $(libdir)/libomalloc.a $(libdir)/libomalloc_ndebug.a $(libdir)/libomalloc_p.a $(libdir)/omalloc.o $(libdir)/omalloc_debug.o
228
229##
230## dist targets
231##
232dist: omalloc-$(VERSION).tgz
233omalloc-$(VERSION).tgz: $(DISTFILES)
234        rm -rf omalloc-$(VERSION)
235        mkdir omalloc-$(VERSION)
236        cp $(DISTFILES) omalloc-$(VERSION)
237        tar czf omalloc-$(VERSION).tgz omalloc-$(VERSION)
[66502b8]238
239##
240## clean targest
241##
[13fe1b]242mostlyclean:
[ebdf1d]243        -rm -f core *.d *.o *.og *.op *_d.c *.a depend *.out *.tgz omTables *.o_ndebug *.gp *.gprof
[3df5b10]244        -rm -f omtTest omtTest_* libomalloc* *.bprof omtTest omtTest_*
245        -rm -f omMalloc.c omExternalConfig.h omExternalConfig.c
[66502b8]246
247clean: mostlyclean
248
249distclean: clean
[82e3b3]250        -rm -f  *~ .\#*  stamp-h omMalloc.h
[3df5b10]251        rm -rf omalloc-$(VERSION)
[e5ee9ad]252        -rm -f omalloc.h omTables.h omTables.inc
[a90dc0]253        -rm -f omConfig.h omlimits.h Makefile TAGS* tags config.status config.cache config.log
[66502b8]254
255srcclean: distclean
256
[13fe1b]257maintainer-clean: distclean
[66502b8]258        rm configure
259
[be7466]260.PHONY: TAGS
261
[a90dc0]262TAGS:   omConfig.h.in omlimits.h.in
263        etags omConfig.h.in omlimits.h.in $(SOURCES) $(HEADERS)
[be7466]264
[3df5b10]265##
266## check
267##
268
269check: omtTest omtTest_ndebug
270        ./omtTest
271        ./omtTest_ndebug
272
[66502b8]273##
274## Below here is stuff for developpers
275#################################################################
276
277##
278## compiler and linker options for debug version
279##
280
[ebdf1d]281CCG             = ${CC}
[66502b8]282CCM             = gcc -MM -DGENERATE_DEPEND
283
[9289f11]284CFLAGSG         = -g -O -fno-inline-functions -Wall
[66502b8]285DEFSG           =  @DEFS@
286
[be7466]287OBJG := $(CSOURCES:.c=.og) $(GSOURCES:.c=.og)
[66502b8]288
[a90dc0]289%.og: %.c omConfig.h omTables.h omalloc.h mylimits.h omlimits.h
[66502b8]290        $(CCG) ${CFLAGSG} ${CPPFLAGS} ${DEFSG} -c $< -o $@
291
292libg: libomalloc_g.a
293
[a90dc0]294libomalloc_g.a: $(OBJG) Makefile omConfig.h mylimits.h omlimits.h
[66502b8]295        rm -f $@
[13fe1b]296        $(AR) cr $@ $(OBJG)
[66502b8]297        $(RANLIB) $@
298
299
300##
[3df5b10]301## expanded macros
[66502b8]302##
[3df5b10]303OBJD := $(CSOURCES:%.c=%_d.og) $(GSOURCES:%.c=%_d.og)
[66502b8]304
[a90dc0]305%_d.c : %.c omConfig.h omTables.h omalloc.h mylimits.h omlimits.h
[66502b8]306        $(CCG) -E -P $< | $(PERL) -p -e 's/;/;\n/g' | $(PERL) -p -e 's/\{/\n\{/g' | $(PERL) -p -e 's/\}/\n\}/g' > $@
307.PRECIOUS: %_d.c
308
309libd: libomalloc_d.a
310
[a90dc0]311libomalloc_d.a: $(OBJD) Makefile omConfig.h mylimits.h omlimits.h
[66502b8]312        rm -f $@
[13fe1b]313        $(AR) cr $@ $(OBJD)
[66502b8]314        $(RANLIB) $@
315
[be7466]316####################################################
317## compiler and linker options for profile version
318##
319
[ebdf1d]320CCP             = ${CC}
[be7466]321
[b24b1af]322CFLAGSP         = -g -pg -O3
[be7466]323DEFSP           =  @DEFS@
324
325OBJP := $(CSOURCES:.c=.op) $(GSOURCES:.c=.op)
326
327
328##
329## Profile Targets
330##
[a90dc0]331%.op: %.c omConfig.h omTables.h omalloc.h mylimits.h omlimits.h
[be7466]332        $(CCP) ${CFLAGSP} ${CPPFLAGS} ${DEFSP} -c $< -o $@
333
334libp: libomalloc_p.a
335
[a90dc0]336libomalloc_p.a: $(OBJP) Makefile omConfig.h mylimits.h omlimits.h
[be7466]337        rm -f $@
[13fe1b]338        $(AR) cr $@ $(OBJP)
[be7466]339        $(RANLIB) $@
340
341####################################################
[66502b8]342## Test program
343##
[13fe1b]344TESTSOURCES     = omtTest.c omtTestReal.c omtTestDebug.c omtTestKeep.c omtTestError.c
[66502b8]345
[13fe1b]346TEST_D := $(TESTSOURCES:.c=_d.og)
347omtTest_d: libd $(TEST_D)
[3df5b10]348        $(CCG) ${CFLAGSG} ${CPPFLAGS} ${DEFSG} $(TEST_D) -L. -lomalloc_d -o omtTest_d
[66502b8]349
[13fe1b]350TEST_G := $(TESTSOURCES:.c=.og)
[3df5b10]351omtTest_g: libg $(TEST_G)
352        $(CCG) ${CFLAGSG} ${CPPFLAGS} ${DEFSG} $(TEST_G) -L. -lomalloc_g -o omtTest_g
[66502b8]353
[13fe1b]354TEST_P := $(TESTSOURCES:.c=.op)
[3df5b10]355omtTest_p: libp $(TEST_P)
356        $(CCG) ${CFLAGSP} ${CPPFLAGS} ${DEFSP} $(TEST_P) -L. -lomalloc_p -o omtTest_p
[be7466]357
[13fe1b]358TEST_O := $(TESTSOURCES:.c=.o)
[3df5b10]359omtTest: lib  $(TEST_O)
360        $(CC) ${CFLAGS} ${CPPFLAGS} ${DEFS} $(TEST_O) -L. -lomalloc -o omtTest
[be7466]361
[3df5b10]362TEST_NDEBUG_O := $(TESTSOURCES:.c=.o_ndebug)
363omtTest_ndebug: libomalloc_ndebug.a $(TEST_NDEBUG_O)
364        $(CC) ${CFLAGS} ${CPPFLAGS} ${DEFS} $(TEST_NDEBUG_O) -DOM_NDEBUG -L. -lomalloc_ndebug -o omtTest_ndebug
[66502b8]365
[3df5b10]366%.om : %.c omalloc.h
367        $(CC) ${CFLAGS} ${CPPFLAGS} ${DEFS} -DOM_TEST_MALLOC -c $< -o $@
368TEST_M := $(TESTSOURCES:.c=.om)
[13fe1b]369omtTest_m: lib $(TEST_M)
[3df5b10]370        $(CC) ${CFLAGS} ${CPPFLAGS} ${DEFS} -DOM_TEST_MALLOC $(TEST_M) -L. -lomalloc -o omtTest_m
[66502b8]371
372##
[3df5b10]373## backup
[66502b8]374##
375
[3df5b10]376backup: omalloc-$(VERSION).tgz
377        mcopy -o omalloc-$(VERSION).tgz a:
[66502b8]378
379##
[13fe1b]380## Dependencies
381##
[a90dc0]382%.d: %.c omConfig.h mylimits.h Makefile omTables.h omTables.inc omalloc.h omlimits.h
[ebdf1d]383        echo $(@:.d=.o_ndebug) $(@:.d=.og) $(@:.d=.od)  $(@:.d=.op) $(@:.d=_d.c) $(@:.d=.om)" " \\ > $@
[66502b8]384        $(CCM) ${CPPFLAGS} ${DEFSG} $< >> $@
385
[a90dc0]386depend:   $(CSOURCES:.c=.d) omConfig.h omlimits.h mylimits.h $(TESTSOURCES:.c=.d)
[66502b8]387        cat *.d >depend
388
389ifeq (depend,$(wildcard depend))
390include depend
391endif
392
393
394
Note: See TracBrowser for help on using the repository browser.