perl 1.0 patch 10: if your libc is in a strange place, Configure blows up
[p5sagit/p5-mst-13.2.git] / Makefile.SH
CommitLineData
8d063cd8 1case $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 ;;
11esac
12case "$0" in
13*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
14esac
15echo "Extracting Makefile (with variable substitutions)"
16cat >Makefile <<!GROK!THIS!
a559c259 17# $Header: Makefile.SH,v 1.0.1.4 88/01/28 10:17:59 root Exp $
8d063cd8 18#
19# $Log: Makefile.SH,v $
a559c259 20# Revision 1.0.1.4 88/01/28 10:17:59 root
21# patch8: added perldb.man
22#
a1cc2bdc 23# Revision 1.0.1.3 88/01/26 14:14:52 root
24# Added mallocsrc stuff.
25#
fdf95cbb 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#
135863df 29# Revision 1.0.1.1 88/01/24 03:55:18 root
30# patch 2: remove extra Log lines.
8d063cd8 31#
135863df 32# Revision 1.0 87/12/18 16:11:50 root
8d063cd8 33# Initial revision
34#
8d063cd8 35
36CC = $cc
37bin = $bin
38lib = $lib
39mansrc = $mansrc
40manext = $manext
41CFLAGS = $ccflags -O
42LDFLAGS = $ldflags
43SMALL = $small
44LARGE = $large $split
a1cc2bdc 45mallocsrc = $mallocsrc
46mallocobj = $mallocobj
8d063cd8 47
48libs = $libnm -lm
49!GROK!THIS!
50
51cat >>Makefile <<'!NO!SUBS!'
52
a559c259 53public = perl perldb
8d063cd8 54
55private =
56
a559c259 57manpages = perl.man perldb.man
8d063cd8 58
59util =
60
61sh = Makefile.SH makedepend.SH
62
63h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h
64h2 = hash.h perl.h search.h spat.h stab.h str.h util.h
65
66h = $(h1) $(h2)
67
a1cc2bdc 68c1 = arg.c array.c cmd.c dump.c form.c hash.c $(mallocsrc)
8d063cd8 69c2 = search.c stab.c str.c util.c version.c
70
71c = $(c1) $(c2)
72
a1cc2bdc 73obj1 = arg.o array.o cmd.o dump.o form.o hash.o $(mallocobj)
8d063cd8 74obj2 = search.o stab.o str.o util.o version.o
75
76obj = $(obj1) $(obj2)
77
78lintflags = -phbvxac
79
80addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
81
82# grrr
83SHELL = /bin/sh
84
85.c.o:
86 $(CC) -c $(CFLAGS) $(LARGE) $*.c
87
88all: $(public) $(private) $(util)
89 touch all
90
91perl: $(obj) perl.o
92 $(CC) $(LDFLAGS) $(LARGE) $(obj) perl.o $(libs) -o perl
93
94perl.c: perl.y
95 @ echo Expect 2 shift/reduce errors...
96 yacc perl.y
97 mv y.tab.c perl.c
98
99perl.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
106perl.man: perl.man.1 perl.man.2
107 cat perl.man.1 perl.man.2 >perl.man
108
109install: 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); \
115for pub in $(public); do \
116chmod 755 `basename $$pub`; \
117done
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 \
131for page in $(manpages); do \
132cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
133done; \
134fi
135
136clean:
137 rm -f *.o
138
139realclean:
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
147lint:
148 lint $(lintflags) $(defs) $(c) > perl.fuzz
149
150depend: makedepend
fdf95cbb 151 ./makedepend
8d063cd8 152
153test: 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
157clist:
158 echo $(c) | tr ' ' '\012' >.clist
159
160hlist:
161 echo $(h) | tr ' ' '\012' >.hlist
162
163shlist:
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
169makedepend: makedepend.SH
170 /bin/sh makedepend.SH
171!NO!SUBS!
172$eunicefix Makefile
173case `pwd` in
174*SH)
175 $rm -f ../Makefile
176 ln Makefile ../Makefile
177 ;;
178esac