Commit | Line | Data |
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 | |
4 | case "$0" in |
5 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; |
6 | esac |
7 | |
85e6fe83 |
8 | if test -f config.sh; then TOP=.; |
9 | elif test -f ../config.sh; then TOP=..; |
10 | elif test -f ../../config.sh; then TOP=../..; |
11 | elif test -f ../../../config.sh; then TOP=../../..; |
12 | elif test -f ../../../../config.sh; then TOP=../../../..; |
13 | else |
14 | echo "Can't find config.sh."; exit 1 |
15 | fi |
a0d0e21e |
16 | |
17 | : Find absolute path name for TOP. This is needed when we cd to TOP |
18 | : to run perl on autosplit. |
19 | oldpwd=`pwd`; cd $TOP; ABSTOP=`pwd`; cd $oldpwd |
20 | |
85e6fe83 |
21 | case $CONFIG in |
22 | '') |
23 | . $TOP/config.sh |
24 | ;; |
25 | esac |
85e6fe83 |
26 | |
a0d0e21e |
27 | echo "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 | # |
41 | CC = $cc |
a0d0e21e |
42 | RANLIB = $ranlib |
85e6fe83 |
43 | TOP = $TOP |
a0d0e21e |
44 | ABSTOP = $ABSTOP |
85e6fe83 |
45 | LDFLAGS = $ldflags |
46 | CLDFLAGS = $ldflags |
47 | SMALL = $small |
48 | LARGE = $large $split |
49 | |
a0d0e21e |
50 | # To use an alternate make, set \$altmake in config.sh. |
85e6fe83 |
51 | MAKE = ${altmake-make} |
52 | |
a0d0e21e |
53 | # The following are used to build and install shared libraries for |
54 | # dynamic loading. |
55 | LDDLFLAGS = $lddlflags |
56 | CCDLFLAGS = $ccdlflags |
57 | CCCDLFLAGS = $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!' |
63 | SHELL = /bin/sh |
64 | CCCMD = `sh $(shellflags) $(TOP)/cflags $@` |
65 | |
66 | .c.o: |
a0d0e21e |
67 | $(CCCMD) $(CCCDLFLAGS) -I$(TOP) -DSDBM -DDUFF $*.c |
85e6fe83 |
68 | |
69 | LIBOBJS = sdbm.o pair.o hash.o |
70 | LIBSRCS = sdbm.c pair.c hash.c |
71 | HDRS = tune.h sdbm.h pair.h $(TOP)/config.h |
72 | |
a0d0e21e |
73 | all: libsdbm.a |
74 | |
85e6fe83 |
75 | libsdbm.a: $(LIBOBJS) |
76 | ar cr libsdbm.a $(LIBOBJS) |
a0d0e21e |
77 | $(RANLIB) libsdbm.a |
85e6fe83 |
78 | |
79 | $(LIBOBJS): $(HDRS) |
80 | |
81 | lint: |
82 | lint -abchx $(LIBSRCS) |
83 | |
84 | clean: |
85 | rm -f *.o *.a mon.out core |
86 | |
87 | realclean: clean |
88 | rm -f dbu libsdbm.a dbd dba dbe x-dbu *.dir *.pag |
89 | rm -f makefile Makefile |
90 | |
91 | purge: realclean |
92 | |
a0d0e21e |
93 | sdbm.o : sdbm.c $(TOP)/config.h sdbm.h tune.h pair.h |
94 | hash.o : hash.c $(TOP)/config.h sdbm.h |
95 | pair.o : pair.c $(TOP)/config.h sdbm.h tune.h pair.h |
96 | |
85e6fe83 |
97 | !NO!SUBS! |
98 | chmod 755 Makefile |
99 | $eunicefix Makefile |