summaryrefslogtreecommitdiff
path: root/x2p/Makefile.SH
diff options
context:
space:
mode:
authorAndy Dougherty <doughera@lafcol.lafayette.edu>1995-01-18 02:37:01 +0000
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1995-01-18 02:37:01 +0000
commit9c8d0b29b7bd1493cc1d95591b17902820e5579c (patch)
treef8671d758a3a5d07d4fef72c609650aa9af8f7e1 /x2p/Makefile.SH
parentf4cb4c40de81ad9c5a8e775c2298ec5a52130124 (diff)
downloadperl-9c8d0b29b7bd1493cc1d95591b17902820e5579c.tar.gz
perl5.000 patch.0e: fix various non-broken things in the x2p/ directory
This patch fixes various non-broken things in the x2p/ directory. Mostly, I've supplied function prototypes to satisfy particularly picky compilers. I've also updated Makefile.SH to know that the byacc-generated a2p.c is now included with the distribution so that we no longer need to go looking for yacc/bison/byacc and deal with various library issues or command line options to support those various compiler compilers. I've included a2p.c generated by byacc-1.9. Larry, feel free to use your own from byacc-1.8 instead.
Diffstat (limited to 'x2p/Makefile.SH')
-rwxr-xr-xx2p/Makefile.SH45
1 files changed, 38 insertions, 7 deletions
diff --git a/x2p/Makefile.SH b/x2p/Makefile.SH
index 5b8041c78b..52a44b5b59 100755
--- a/x2p/Makefile.SH
+++ b/x2p/Makefile.SH
@@ -17,6 +17,11 @@ case "$0" in
*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
esac
+: Configure sets byacc=byacc if byacc is not found. We reset it to ''
+case "$byacc" in
+'byacc') byacc='';;
+esac
+
echo "Extracting x2p/Makefile (with variable substitutions)"
rm -f Makefile
cat >Makefile <<!GROK!THIS!
@@ -25,7 +30,7 @@ cat >Makefile <<!GROK!THIS!
# $Log: Makefile.SH,v $
CC = $cc
-YACC = $yacc
+BYACC = $byacc
mansrc = $mansrc
manext = $manext
LDFLAGS = $ldflags
@@ -72,19 +77,45 @@ all: $(public) $(private) $(util)
a2p: $(obj) a2p.o
$(CC) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p
-a2p.c: a2p.y
- @ echo Expect many shift/reduce and reduce/reduce conflicts...
- $(YACC) a2p.y
- mv y.tab.c a2p.c
+!NO!SUBS!
+
+: Only print out the rules for running byacc if the user _has_ byacc.
+: Otherwise, comment them out. Users who really know what they are
+: doing can uncomment them and run yacc or bison or whatever.
+: Configure sets byacc=byacc if byacc is not found.
+case "$byacc" in
+'')
+ comment1='#'
+ comment2='' ;;
+*) comment1=''
+ comment2='#' ;;
+esac
+
+$spitshell >>Makefile <<!GROK!THIS!
+
+# I now supply a2p.c with the kits, so the following section is
+# commented out if you don't have byacc.
+
+${comment1}a2p.c: a2p.y
+${comment1} @ echo Expect many shift/reduce and reduce/reduce conflicts
+${comment1} \$(BYACC) a2p.y
+${comment1} mv y.tab.c a2p.c
+
+# This version is used if you do not have byacc.
+${comment2}a2p.c: a2p.y
+${comment2} touch a2p.c
+
+!GROK!THIS!
+cat >>Makefile <<'!NO!SUBS!'
a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h hash.h
$(CCCMD) $(LARGE) a2p.c
clean:
- rm -f a2p *.o a2p.c
+ rm -f a2p *.o
realclean: clean
- rm -f *.orig */*.orig core $(addedbyconf) a2p.c all malloc.c
+ rm -f *.orig core $(addedbyconf) all malloc.c
rm -f Makefile cflags find2perl s2p makefile makefile.old
# The following lint has practically everything turned on. Unfortunately,