perl 4.0 patch 8: patch #4, continued
[p5sagit/p5-mst-13.2.git] / x2p / Makefile.SH
CommitLineData
a687059c 1case "$0" in
2*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
3esac
8d063cd8 4case $CONFIG in
5'')
6 if test ! -f config.sh; then
7 ln ../config.sh . || \
7e1cf235 8 ln -s ../config.sh . || \
8d063cd8 9 ln ../../config.sh . || \
10 ln ../../../config.sh . || \
11 (echo "Can't find config.sh."; exit 1)
fe14fcc3 12 fi 2>/dev/null
378cc40b 13 . ./config.sh
8d063cd8 14 ;;
15esac
a1cc2bdc 16case "$mallocsrc" in
17'') ;;
18*) mallocsrc="../$mallocsrc";;
19esac
8d063cd8 20echo "Extracting x2p/Makefile (with variable substitutions)"
21cat >Makefile <<!GROK!THIS!
fe14fcc3 22# $Header: Makefile.SH,v 4.0 91/03/20 01:57:03 lwall Locked $
8d063cd8 23#
24# $Log: Makefile.SH,v $
fe14fcc3 25# Revision 4.0 91/03/20 01:57:03 lwall
26# 4.0 baseline.
8d063cd8 27#
28#
29
30CC = $cc
d8f2e4cc 31YACC = $yacc
8d063cd8 32bin = $bin
33lib = $lib
34mansrc = $mansrc
35manext = $manext
a687059c 36CFLAGS = $ccflags $optimize
8d063cd8 37LDFLAGS = $ldflags
38SMALL = $small
39LARGE = $large $split
a1cc2bdc 40mallocsrc = $mallocsrc
41mallocobj = $mallocobj
8d063cd8 42
b6ccd89c 43libs = $libs
8d063cd8 44!GROK!THIS!
45
46cat >>Makefile <<'!NO!SUBS!'
47
fe14fcc3 48public = a2p s2p find2perl
8d063cd8 49
50private =
51
52manpages = a2p.man s2p.man
53
54util =
55
56sh = Makefile.SH makedepend.SH
57
58h = EXTERN.h INTERN.h config.h handy.h hash.h a2p.h str.h util.h
59
a1cc2bdc 60c = hash.c $(mallocsrc) str.c util.c walk.c
8d063cd8 61
a1cc2bdc 62obj = hash.o $(mallocobj) str.o util.o walk.o
8d063cd8 63
64lintflags = -phbvxac
65
66addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
67
68# grrr
69SHELL = /bin/sh
70
71.c.o:
72 $(CC) -c $(CFLAGS) $(LARGE) $*.c
73
74all: $(public) $(private) $(util)
75 touch all
76
77a2p: $(obj) a2p.o
a687059c 78 $(CC) $(LARGE) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p
8d063cd8 79
80a2p.c: a2p.y
6eb13c3b 81 @ echo Expect 226 shift/reduce conflicts...
d8f2e4cc 82 $(YACC) a2p.y
8d063cd8 83 mv y.tab.c a2p.c
84
b6ccd89c 85a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h hash.h
8d063cd8 86 $(CC) -c $(CFLAGS) $(LARGE) a2p.c
87
8d063cd8 88install: a2p s2p
89# won't work with csh
90 export PATH || exit 1
378cc40b 91 - mv $(bin)/a2p $(bin)/a2p.old 2>/dev/null
a687059c 92 - mv $(bin)/s2p $(bin)/s2p.old 2>/dev/null
8d063cd8 93 - if test `pwd` != $(bin); then cp $(public) $(bin); fi
94 cd $(bin); \
95for pub in $(public); do \
378cc40b 96chmod +x `basename $$pub`; \
8d063cd8 97done
378cc40b 98# chmod +x makedir
99# - ./makedir `filexp $(lib)`
8d063cd8 100# - \
101#if test `pwd` != `filexp $(lib)`; then \
102#cp $(private) `filexp $(lib)`; \
103#fi
104# cd `filexp $(lib)`; \
105#for priv in $(private); do \
378cc40b 106#chmod +x `basename $$priv`; \
8d063cd8 107#done
108 - if test `pwd` != $(mansrc); then \
109for page in $(manpages); do \
110cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
111done; \
112fi
113
114clean:
5303340c 115 rm -f a2p *.o
8d063cd8 116
b6ccd89c 117realclean: clean
5303340c 118 rm -f *.orig */*.orig core $(addedbyconf) a2p.c s2p all
8d063cd8 119
120# The following lint has practically everything turned on. Unfortunately,
121# you have to wade through a lot of mumbo jumbo that can't be suppressed.
122# If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
123# for that spot.
124
125lint:
126 lint $(lintflags) $(defs) $(c) > a2p.fuzz
127
128depend: ../makedepend
129 ../makedepend
130
131clist:
132 echo $(c) | tr ' ' '\012' >.clist
133
134hlist:
135 echo $(h) | tr ' ' '\012' >.hlist
136
137shlist:
138 echo $(sh) | tr ' ' '\012' >.shlist
139
03a14243 140config.sh: ../config.sh
141 rm -f config.sh
142 ln ../config.sh .
143
8d063cd8 144# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
145$(obj):
146 @ echo "You haven't done a "'"make depend" yet!'; exit 1
147makedepend: makedepend.SH
148 /bin/sh makedepend.SH
149!NO!SUBS!
150$eunicefix Makefile
151case `pwd` in
152*SH)
153 $rm -f ../Makefile
154 ln Makefile ../Makefile
155 ;;
156esac