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