perl 5.000
[p5sagit/p5-mst-13.2.git] / ext / SDBM_File / sdbm / Makefile.SH
CommitLineData
a0d0e21e 1: This forces SH files to create target in same directory as SH file.
2: This is so that make depend always knows where to find SH derivatives.
3
4case "$0" in
5*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
6esac
7
85e6fe83 8if test -f config.sh; then TOP=.;
9elif test -f ../config.sh; then TOP=..;
10elif test -f ../../config.sh; then TOP=../..;
11elif test -f ../../../config.sh; then TOP=../../..;
12elif test -f ../../../../config.sh; then TOP=../../../..;
13else
14 echo "Can't find config.sh."; exit 1
15fi
a0d0e21e 16
17: Find absolute path name for TOP. This is needed when we cd to TOP
18: to run perl on autosplit.
19oldpwd=`pwd`; cd $TOP; ABSTOP=`pwd`; cd $oldpwd
20
85e6fe83 21case $CONFIG in
22'')
23 . $TOP/config.sh
24 ;;
25esac
85e6fe83 26
a0d0e21e 27echo "Extracting ext/SDBM_File/sdbm/Makefile (with variable substitutions)"
85e6fe83 28: This section of the file will have variable substitutions done on it.
29: Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
30: Protect any dollar signs and backticks that you do not want interpreted
31: by putting a backslash in front. You may delete these comments.
32$spitshell >Makefile <<!GROK!THIS!
33#
34# This Makefile is for the library part of sdbm. For the
35# Full package, see makefile.sdbm.
36#
37# Makefile for public domain ndbm-clone: sdbm
38# DUFF: use duff's device (loop unroll) in parts of the code
39#
40#
41CC = $cc
a0d0e21e 42RANLIB = $ranlib
85e6fe83 43TOP = $TOP
a0d0e21e 44ABSTOP = $ABSTOP
85e6fe83 45LDFLAGS = $ldflags
46CLDFLAGS = $ldflags
47SMALL = $small
48LARGE = $large $split
49
a0d0e21e 50# To use an alternate make, set \$altmake in config.sh.
85e6fe83 51MAKE = ${altmake-make}
52
a0d0e21e 53# The following are used to build and install shared libraries for
54# dynamic loading.
55LDDLFLAGS = $lddlflags
56CCDLFLAGS = $ccdlflags
57CCCDLFLAGS = $cccdlflags
58
85e6fe83 59!GROK!THIS!
60
61: In the following dollars and backticks do not need the extra backslash.
62$spitshell >>Makefile <<'!NO!SUBS!'
63SHELL = /bin/sh
64CCCMD = `sh $(shellflags) $(TOP)/cflags $@`
65
66.c.o:
a0d0e21e 67 $(CCCMD) $(CCCDLFLAGS) -I$(TOP) -DSDBM -DDUFF $*.c
85e6fe83 68
69LIBOBJS = sdbm.o pair.o hash.o
70LIBSRCS = sdbm.c pair.c hash.c
71HDRS = tune.h sdbm.h pair.h $(TOP)/config.h
72
a0d0e21e 73all: libsdbm.a
74
85e6fe83 75libsdbm.a: $(LIBOBJS)
76 ar cr libsdbm.a $(LIBOBJS)
a0d0e21e 77 $(RANLIB) libsdbm.a
85e6fe83 78
79$(LIBOBJS): $(HDRS)
80
81lint:
82 lint -abchx $(LIBSRCS)
83
84clean:
85 rm -f *.o *.a mon.out core
86
87realclean: clean
88 rm -f dbu libsdbm.a dbd dba dbe x-dbu *.dir *.pag
89 rm -f makefile Makefile
90
91purge: realclean
92
a0d0e21e 93sdbm.o : sdbm.c $(TOP)/config.h sdbm.h tune.h pair.h
94hash.o : hash.c $(TOP)/config.h sdbm.h
95pair.o : pair.c $(TOP)/config.h sdbm.h tune.h pair.h
96
85e6fe83 97!NO!SUBS!
98chmod 755 Makefile
99$eunicefix Makefile