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