This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl 4.0 patch 21: patch #20, continued
[perl5.git] / x2p / Makefile.SH
1 case "$0" in
2 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
3 esac
4 case $CONFIG in
5 '')
6     if test ! -f config.sh; then
7         ln ../config.sh . || \
8         ln -s ../config.sh . || \
9         ln ../../config.sh . || \
10         ln ../../../config.sh . || \
11         (echo "Can't find config.sh."; exit 1)
12     fi 2>/dev/null
13     . ./config.sh
14     ;;
15 esac
16 echo "Extracting x2p/Makefile (with variable substitutions)"
17 rm -f Makefile
18 cat >Makefile <<!GROK!THIS!
19 # $RCSfile: Makefile.SH,v $$Revision: 4.0.1.3 $$Date: 92/06/08 16:11:32 $
20 #
21 # $Log: Makefile.SH,v $
22 # Revision 4.0.1.3  92/06/08  16:11:32  lwall
23 # patch20: SH files didn't work well with symbolic links
24 # patch20: cray didn't give enough memory to /bin/sh
25 # patch20: makefiles now display new shift/reduce expectations
26
27 # Revision 4.0.1.2  91/11/05  19:19:04  lwall
28 # patch11: random cleanup
29
30 # Revision 4.0.1.1  91/06/07  12:12:14  lwall
31 # patch4: cflags now emits entire cc command except for the filename
32
33 # Revision 4.0  91/03/20  01:57:03  lwall
34 # 4.0 baseline.
35
36
37
38 CC = $cc
39 YACC = $yacc
40 bin = $bin
41 lib = $lib
42 mansrc = $mansrc
43 manext = $manext
44 LDFLAGS = $ldflags
45 SMALL = $small
46 LARGE = $large $split
47 mallocsrc = $mallocsrc
48 mallocobj = $mallocobj
49 shellflags = $shellflags
50
51 libs = $libs
52 !GROK!THIS!
53
54 cat >>Makefile <<'!NO!SUBS!'
55
56 CCCMD = `sh $(shellflags) cflags $@`
57
58 public = a2p s2p find2perl
59
60 private = 
61
62 manpages = a2p.man s2p.man
63
64 util =
65
66 sh = Makefile.SH makedepend.SH
67
68 h = EXTERN.h INTERN.h ../config.h handy.h hash.h a2p.h str.h util.h
69
70 c = hash.c $(mallocsrc) str.c util.c walk.c
71
72 obj = hash.o $(mallocobj) str.o util.o walk.o
73
74 lintflags = -phbvxac
75
76 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
77
78 # grrr
79 SHELL = /bin/sh
80
81 .c.o:
82         $(CCCMD) $*.c
83
84 all: $(public) $(private) $(util)
85         touch all
86
87 a2p: $(obj) a2p.o
88         $(CC) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p
89
90 a2p.c: a2p.y
91         @ echo Expect 231 shift/reduce conflicts...
92         $(YACC) a2p.y
93         mv y.tab.c a2p.c
94
95 a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h hash.h
96         $(CCCMD) $(LARGE) a2p.c
97
98 install: a2p s2p
99 # won't work with csh
100         export PATH || exit 1
101         - mv $(bin)/a2p $(bin)/a2p.old 2>/dev/null
102         - mv $(bin)/s2p $(bin)/s2p.old 2>/dev/null
103         - if test `pwd` != $(bin); then cp $(public) $(bin); fi
104         cd $(bin); \
105 for pub in $(public); do \
106 chmod +x `basename $$pub`; \
107 done
108         - if test `pwd` != $(mansrc); then \
109 for page in $(manpages); do \
110 cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
111 done; \
112 fi
113
114 clean:
115         rm -f a2p *.o a2p.c
116
117 realclean: clean
118         rm -f *.orig */*.orig core $(addedbyconf) a2p.c s2p find2perl all cflags
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
125 lint:
126         lint $(lintflags) $(defs) $(c) > a2p.fuzz
127
128 depend: $(mallocsrc) ../makedepend
129         ../makedepend
130
131 clist:
132         echo $(c) | tr ' ' '\012' >.clist
133
134 hlist:
135         echo $(h) | tr ' ' '\012' >.hlist
136
137 shlist:
138         echo $(sh) | tr ' ' '\012' >.shlist
139
140 config.sh: ../config.sh
141         rm -f config.sh
142         ln ../config.sh .
143
144 malloc.c: ../malloc.c
145         sed 's/"perl.h"/"..\/perl.h"/' ../malloc.c >malloc.c
146
147 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
148 $(obj):
149         @ echo "You haven't done a "'"make depend" yet!'; exit 1
150 makedepend: makedepend.SH
151         /bin/sh $(shellflags) makedepend.SH
152 !NO!SUBS!
153 $eunicefix Makefile
154 case `pwd` in
155 *SH)
156     $rm -f ../Makefile
157     ln Makefile ../Makefile
158     ;;
159 esac
160 rm -f makefile