This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 5.000
[perl5.git] / ext / SDBM_File / sdbm / Makefile.SH
similarity index 71%
rename from ext/dbm/sdbm/Makefile.SH
rename to ext/SDBM_File/sdbm/Makefile.SH
index 9a19fa2..521c972 100644 (file)
@@ -1,3 +1,10 @@
+: This forces SH files to create target in same directory as SH file.
+: This is so that make depend always knows where to find SH derivatives.
+
+case "$0" in
+*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
+esac
+
 if test -f config.sh; then TOP=.;
 elif test -f ../config.sh; then TOP=..;
 elif test -f ../../config.sh; then TOP=../..;
@@ -6,19 +13,18 @@ elif test -f ../../../../config.sh; then TOP=../../../..;
 else
        echo "Can't find config.sh."; exit 1
 fi
+
+: Find absolute path name for TOP.  This is needed when we cd to TOP
+: to run perl on autosplit.
+oldpwd=`pwd`; cd $TOP; ABSTOP=`pwd`; cd $oldpwd
+
 case $CONFIG in
 '')
        . $TOP/config.sh
        ;;
 esac
-: This forces SH files to create target in same directory as SH file.
-: This is so that make depend always knows where to find SH derivatives.
 
-case "$0" in
-*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
-esac
-
-echo "Extracting ext/dbm/sdbm/Makefile (with variable substitutions)"
+echo "Extracting ext/SDBM_File/sdbm/Makefile (with variable substitutions)"
 : This section of the file will have variable substitutions done on it.
 : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
 : Protect any dollar signs and backticks that you do not want interpreted
@@ -33,16 +39,23 @@ $spitshell >Makefile <<!GROK!THIS!
 #
 #
 CC = $cc
-ranlib = $ranlib
+RANLIB = $ranlib
 TOP = $TOP
+ABSTOP = $ABSTOP
 LDFLAGS = $ldflags
 CLDFLAGS = $ldflags
 SMALL = $small
 LARGE = $large $split
 
-# To use an alternate make, set $altmake in config.sh.
+# To use an alternate make, set \$altmake in config.sh.
 MAKE = ${altmake-make}
 
+# The following are used to build and install shared libraries for
+# dynamic loading.
+LDDLFLAGS = $lddlflags
+CCDLFLAGS = $ccdlflags
+CCCDLFLAGS = $cccdlflags
+
 !GROK!THIS!
 
 : In the following dollars and backticks do not need the extra backslash.
@@ -51,15 +64,17 @@ SHELL = /bin/sh
 CCCMD = `sh $(shellflags) $(TOP)/cflags $@`
 
 .c.o:
-       $(CCCMD) -I$(TOP) -DSDBM -DDUFF $*.c
+       $(CCCMD) $(CCCDLFLAGS) -I$(TOP) -DSDBM -DDUFF $*.c
 
 LIBOBJS = sdbm.o pair.o hash.o
 LIBSRCS = sdbm.c pair.c hash.c
 HDRS = tune.h sdbm.h pair.h $(TOP)/config.h
 
+all:   libsdbm.a
+
 libsdbm.a: $(LIBOBJS)
        ar cr libsdbm.a $(LIBOBJS)
-       $(ranlib) libsdbm.a
+       $(RANLIB) libsdbm.a
 
 $(LIBOBJS): $(HDRS)
 
@@ -75,6 +90,10 @@ realclean:   clean
 
 purge: realclean
 
+sdbm.o : sdbm.c $(TOP)/config.h sdbm.h tune.h pair.h 
+hash.o : hash.c $(TOP)/config.h sdbm.h 
+pair.o : pair.c $(TOP)/config.h sdbm.h tune.h pair.h 
+
 !NO!SUBS!
 chmod 755 Makefile
 $eunicefix Makefile