1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
|
## ====================================================================
## Copyright (c) 1999-2000 Ralf S. Engelschall. All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions
## are met:
##
## 1. Redistributions of source code must retain the above copyright
## notice, this list of conditions and the following disclaimer.
##
## 2. Redistributions in binary form must reproduce the above copyright
## notice, this list of conditions and the following disclaimer in
## the documentation and/or other materials provided with the
## distribution.
##
## 3. All advertising materials mentioning features or use of this
## software must display the following acknowledgment:
## "This product includes software developed by
## Ralf S. Engelschall <rse@engelschall.com>."
##
## 4. Redistributions of any form whatsoever must retain the following
## acknowledgment:
## "This product includes software developed by
## Ralf S. Engelschall <rse@engelschall.com>."
##
## THIS SOFTWARE IS PROVIDED BY RALF S. ENGELSCHALL ``AS IS'' AND ANY
## EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
## PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RALF S. ENGELSCHALL OR
## ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
## NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
## LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
## STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
## OF THE POSSIBILITY OF SUCH DAMAGE.
## ====================================================================
##
## Makefile
##
@SET_MAKE@
TOP = .
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
mandir = @mandir@
SHELL = /bin/sh
CC = @CC@
CFLAGS = @CFLAGS@ -D_REENTRANT
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
RM = rm -f
LIBTOOL = @LIBTOOL@
SHTOOL = @SHTOOL@
MAN = mm.3 mm-config.1
OBJ = mm_global.o mm_alloc.o mm_core.o mm_lib.o mm_vers.o
LOBJ = mm_global.lo mm_alloc.lo mm_core.lo mm_lib.lo mm_vers.lo
_VERSION_FILE = \
mm_vers.c
_VERSION = \
$(SHTOOL) version -l c -n MM -p mm_ $$OPT $(_VERSION_FILE);\
V=`$(SHTOOL) version -l c -d long $(_VERSION_FILE)`;\
sed -e "s/Version .*(.*)/Version $$V/g" <README >README.n && mv README.n README
.SUFFIXES: .o .lo
.c.o:
$(LIBTOOL) --quiet --mode=compile $(CC) -c $(CFLAGS) $<
.c.lo:
$(LIBTOOL) --quiet --mode=compile $(CC) -c $(CFLAGS) $<
all: libmm.la $(MAN) mm_test
libmm.la: $(OBJ) $(LOBJ)
$(LIBTOOL) --quiet --mode=link $(CC) -o libmm.la $(LOBJ) \
-rpath $(libdir) -version-info `$(SHTOOL) version -l c -d libtool mm_vers.c`
mm_alloc.c mm_core.c mm_global.c: mm_conf.h mm.h mm_vers.c
check: test
test: mm_test
-@./mm_test; \
if [ $$? -eq 0 ]; then \
PLATFORM=`$(SHELL) ./config.guess`; \
PLATFORM=`$(SHELL) ./config.sub $$PLATFORM`; \
if [ ".`grep $$PLATFORM PORTING`" = . ]; then \
echo "Please send the following summary via Email to the author"; \
echo "Ralf S. Engelschall <rse@engelschall.com> for inclusion into"; \
echo "the list of successfully tested platforms (see PORTING file):"; \
echo ""; \
echo "Ok" >.fbtool; \
$(SHELL) ./fbtool -d; \
fi; \
else \
echo "Please send the following summary together with as much other"; \
echo "details about the configuration, build and test steps to the author"; \
echo "Ralf S. Engelschall <rse@engelschall.com> to help him in tracking"; \
echo "down your platform problem."; \
echo ""; \
echo "Failed" >.fbtool; \
$(SHELL) ./fbtool -d; \
fi; \
exit 0
debug: mm_test
@$(LIBTOOL) --mode=execute gdb mm_test
mm_test: mm_test.lo libmm.la
$(LIBTOOL) --quiet --mode=link $(CC) -o $@ mm_test.lo libmm.la
mm.3: mm.pod
V1=`$(SHTOOL) version -l c -d short $(_VERSION_FILE)`; \
V2=`$(SHTOOL) version -l c -d long $(_VERSION_FILE)`; \
D=`$(SHTOOL) version -l c -d long $(_VERSION_FILE) | sed -e 's;.*(;;' -e 's;).*;;'`; \
pod2man --section=3 --center="Shared Memory Library" --release="$$D" --date="MM $$V1" mm.pod |\
perl -p -e 's;^(\\\&\s+.+?)([Mm][Mm]_[a-zA-Z0-9_]+)(\(.+?)$$;$$1\\fB$$2\\fR$$3;' |\
sed -e "s;MM_VERSION_STR;$$V2;" >mm.3
mm-config.1: mm-config.pod
V1=`$(SHTOOL) version -l c -d short $(_VERSION_FILE)`; \
V2=`$(SHTOOL) version -l c -d long $(_VERSION_FILE)`; \
D=`$(SHTOOL) version -l c -d long $(_VERSION_FILE) | sed -e 's;.*(;;' -e 's;).*;;'`; \
pod2man --section=1 --center="Shared Memory Library" --release="$$D" --date="MM $$V1" mm-config.pod |\
perl -p -e 's;^(\\\&\s+.+?)([Mm][Mm]_[a-zA-Z0-9_]+)(\(.+?)$$;$$1\\fB$$2\\fR$$3;' |\
sed -e "s;MM_VERSION_STR;$$V2;" >mm-config.1
update:
@$(RM) ltmain.sh ltconfig shtool
@$(MAKE) $(MFLAGS) ltmain.sh ltconfig configure shtool
configure: configure.in aclocal.m4
$(RM) configure
autoconf
ltmain.sh:
@F=`libtoolize -n -c -f | grep 'cp.*ltmain.sh' |\
sed -e 's;[^/]*;;' -e 's; .*;;'`; \
echo "ltmain.sh <-- $$F"; cat $$F |\
sed -e 's:/bin/sh; then:/bin/sh || test "$$nonopt" = ./shtool;then:' \
-e 's:exec \$$SHELL \$$0 --finish:exit 0 #:' >ltmain.sh
ltconfig:
@F=`libtoolize -n -c -f | grep 'cp.*ltconfig' | sed -e 's;[^/]*;;' -e 's; .*;;'`; \
echo "ltconfig <-- $$F"; cp $$F .
shtool:
shtoolize -o shtool version echo mkdir install fixperm tarball
install: all
$(SHTOOL) mkdir -f -p -m 755 $(bindir)
$(SHTOOL) mkdir -f -p -m 755 $(includedir)
$(SHTOOL) mkdir -f -p -m 755 $(libdir)
$(SHTOOL) mkdir -f -p -m 755 $(mandir)/man1
$(SHTOOL) mkdir -f -p -m 755 $(mandir)/man3
$(SHTOOL) install -c -m 755 mm-config $(bindir)/mm-config
$(SHTOOL) install -c -m 644 mm-config.1 $(mandir)/man1/mm-config.1
$(SHTOOL) install -c -m 644 mm.3 $(mandir)/man3/mm.3
$(SHTOOL) install -c -m 644 mm.h $(includedir)/mm.h
@$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 libmm.la $(libdir)/libmm.la
clean:
$(RM) mm_test mm_test.o mm_test.lo
$(RM) core *.core *.bak *~
$(RM) $(LOBJ)
$(RM) $(OBJ)
$(RM) libmm.la
$(RM) -r .libs
distclean: clean
$(RM) Makefile
$(RM) mm-config mm_conf.h
$(RM) config.h config.cache config.status config.log
$(RM) libtool
$(RM) .fbtool
realclean: distclean
$(RM) $(MAN)
dist: distclean
@$(SHTOOL) fixperm -v *; \
V=`$(SHTOOL) version -l c -d short $(_VERSION_FILE)`; \
$(SHTOOL) tarball -o mm-$${V}.tar.gz -d mm-$${V} -u rse -g mm \
-e 'CVS,\.cvsignore,\.[ao],^\.' -c 'gzip --best' .; \
ls -l mm-$${V}.tar.gz
snap: distclean
@$(SHTOOL) fixperm *; \
V=`$(SHTOOL) version -l c -d short $(_VERSION_FILE)`; \
$(SHTOOL) tarball -o mm-$${V}-SNAP.tar.gz -d mm-$${V}-SNAP -u rse -g mm \
-e 'CVS,\.cvsignore,\.[ao],^\.' -c 'gzip --best' .; \
ls -l mm-$${V}-SNAP.tar.gz
new-version:
@V="$(VERSION)"; \
if [ ".$$V" != . ]; then \
OPT="-s$$V"; \
else \
OPT="-e"; \
fi; \
$(_VERSION)
update-version:
OPT="-s `$(SHTOOL) version -l c -d short $(_VERSION_FILE)`" && $(_VERSION)
|