perl 1.0 patch 12: scripts made by a2p doen't handle leading white space right on...
[p5sagit/p5-mst-13.2.git] / Makefile.SH
1 case $CONFIG in
2 '')
3     if test ! -f config.sh; then
4         ln ../config.sh . || \
5         ln ../../config.sh . || \
6         ln ../../../config.sh . || \
7         (echo "Can't find config.sh."; exit 1)
8     fi
9     . config.sh
10     ;;
11 esac
12 case "$0" in
13 */*) cd `expr X$0 : 'X\(.*\)/'` ;;
14 esac
15 echo "Extracting Makefile (with variable substitutions)"
16 cat >Makefile <<!GROK!THIS!
17 # $Header: Makefile.SH,v 1.0.1.4 88/01/28 10:17:59 root Exp $
18 #
19 # $Log: Makefile.SH,v $
20 # Revision 1.0.1.4  88/01/28  10:17:59  root
21 # patch8: added perldb.man
22
23 # Revision 1.0.1.3  88/01/26  14:14:52  root
24 # Added mallocsrc stuff.
25
26 # Revision 1.0.1.2  88/01/26  08:46:04  root
27 # patch 4: make depend didn't work right if . wasn't in PATH.
28
29 # Revision 1.0.1.1  88/01/24  03:55:18  root
30 # patch 2: remove extra Log lines.
31
32 # Revision 1.0  87/12/18  16:11:50  root
33 # Initial revision
34
35
36 CC = $cc
37 bin = $bin
38 lib = $lib
39 mansrc = $mansrc
40 manext = $manext
41 CFLAGS = $ccflags -O
42 LDFLAGS = $ldflags
43 SMALL = $small
44 LARGE = $large $split
45 mallocsrc = $mallocsrc
46 mallocobj = $mallocobj
47
48 libs = $libnm -lm
49 !GROK!THIS!
50
51 cat >>Makefile <<'!NO!SUBS!'
52
53 public = perl perldb
54
55 private = 
56
57 manpages = perl.man perldb.man
58
59 util =
60
61 sh = Makefile.SH makedepend.SH
62
63 h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h
64 h2 = hash.h perl.h search.h spat.h stab.h str.h util.h
65
66 h = $(h1) $(h2)
67
68 c1 = arg.c array.c cmd.c dump.c form.c hash.c $(mallocsrc)
69 c2 = search.c stab.c str.c util.c version.c
70
71 c = $(c1) $(c2)
72
73 obj1 = arg.o array.o cmd.o dump.o form.o hash.o $(mallocobj)
74 obj2 = search.o stab.o str.o util.o version.o
75
76 obj = $(obj1) $(obj2)
77
78 lintflags = -phbvxac
79
80 addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
81
82 # grrr
83 SHELL = /bin/sh
84
85 .c.o:
86         $(CC) -c $(CFLAGS) $(LARGE) $*.c
87
88 all: $(public) $(private) $(util)
89         touch all
90
91 perl: $(obj) perl.o
92         $(CC) $(LDFLAGS) $(LARGE) $(obj) perl.o $(libs) -o perl
93
94 perl.c: perl.y
95         @ echo Expect 2 shift/reduce errors...
96         yacc perl.y
97         mv y.tab.c perl.c
98
99 perl.o: perl.c perly.c perl.h EXTERN.h search.h util.h INTERN.h handy.h
100         $(CC) -c $(CFLAGS) $(LARGE) perl.c
101
102 # if a .h file depends on another .h file...
103 $(h):
104         touch $@
105
106 perl.man: perl.man.1 perl.man.2
107         cat perl.man.1 perl.man.2 >perl.man
108
109 install: perl perl.man
110 # won't work with csh
111         export PATH || exit 1
112         - mv $(bin)/perl $(bin)/perl.old
113         - if test `pwd` != $(bin); then cp $(public) $(bin); fi
114         cd $(bin); \
115 for pub in $(public); do \
116 chmod 755 `basename $$pub`; \
117 done
118         - test $(bin) = /bin || rm -f /bin/perl
119         - test $(bin) = /bin || ln -s $(bin)/perl /bin || cp $(bin)/perl /bin
120 #       chmod 755 makedir
121 #       - makedir `filexp $(lib)`
122 #       - \
123 #if test `pwd` != `filexp $(lib)`; then \
124 #cp $(private) `filexp $(lib)`; \
125 #fi
126 #       cd `filexp $(lib)`; \
127 #for priv in $(private); do \
128 #chmod 755 `basename $$priv`; \
129 #done
130         - if test `pwd` != $(mansrc); then \
131 for page in $(manpages); do \
132 cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
133 done; \
134 fi
135
136 clean:
137         rm -f *.o
138
139 realclean:
140         rm -f perl *.orig */*.orig *.o core $(addedbyconf)
141
142 # The following lint has practically everything turned on.  Unfortunately,
143 # you have to wade through a lot of mumbo jumbo that can't be suppressed.
144 # If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
145 # for that spot.
146
147 lint:
148         lint $(lintflags) $(defs) $(c) > perl.fuzz
149
150 depend: makedepend
151         ./makedepend
152
153 test: perl
154         chmod 755 t/TEST t/base.* t/comp.* t/cmd.* t/io.* t/op.*
155         cd t && (rm -f perl; ln -s ../perl . || ln ../perl .) && TEST
156
157 clist:
158         echo $(c) | tr ' ' '\012' >.clist
159
160 hlist:
161         echo $(h) | tr ' ' '\012' >.hlist
162
163 shlist:
164         echo $(sh) | tr ' ' '\012' >.shlist
165
166 # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
167 $(obj):
168         @ echo "You haven't done a "'"make depend" yet!'; exit 1
169 makedepend: makedepend.SH
170         /bin/sh makedepend.SH
171 !NO!SUBS!
172 $eunicefix Makefile
173 case `pwd` in
174 *SH)
175     $rm -f ../Makefile
176     ln Makefile ../Makefile
177     ;;
178 esac