perl 2.0 (no announcement message available)
[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
378cc40b 9 . ./config.sh
8d063cd8 10 ;;
11esac
12case "$0" in
13*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
14esac
2e1b3b7e 15
16case "$d_symlink" in
17*define*) sln='ln -s' ;;
18*) sln='ln';;
19esac
20
8d063cd8 21echo "Extracting Makefile (with variable substitutions)"
22cat >Makefile <<!GROK!THIS!
378cc40b 23# $Header: Makefile.SH,v 2.0 88/06/05 00:07:54 root Exp $
8d063cd8 24#
25# $Log: Makefile.SH,v $
378cc40b 26# Revision 2.0 88/06/05 00:07:54 root
27# Baseline version 2.0.
2e1b3b7e 28#
8d063cd8 29#
8d063cd8 30
31CC = $cc
32bin = $bin
378cc40b 33lib = $privlib
8d063cd8 34mansrc = $mansrc
35manext = $manext
36CFLAGS = $ccflags -O
37LDFLAGS = $ldflags
38SMALL = $small
39LARGE = $large $split
a1cc2bdc 40mallocsrc = $mallocsrc
41mallocobj = $mallocobj
2e1b3b7e 42SLN = $sln
8d063cd8 43
44libs = $libnm -lm
45!GROK!THIS!
46
47cat >>Makefile <<'!NO!SUBS!'
48
a559c259 49public = perl perldb
8d063cd8 50
51private =
52
a559c259 53manpages = perl.man perldb.man
8d063cd8 54
55util =
56
57sh = Makefile.SH makedepend.SH
58
59h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h
378cc40b 60h2 = hash.h perl.h regexp.h spat.h stab.h str.h util.h
8d063cd8 61
62h = $(h1) $(h2)
63
378cc40b 64c1 = arg.c array.c cmd.c dump.c eval.c form.c hash.c $(mallocsrc)
65c2 = perly.c regexp.c stab.c str.c toke.c util.c version.c
8d063cd8 66
67c = $(c1) $(c2)
68
378cc40b 69obj1 = arg.o array.o cmd.o dump.o eval.o form.o hash.o $(mallocobj)
70obj2 = perly.o regexp.o stab.o str.o toke.o util.o version.o
8d063cd8 71
72obj = $(obj1) $(obj2)
73
74lintflags = -phbvxac
75
76addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7
77
78# grrr
79SHELL = /bin/sh
80
81.c.o:
82 $(CC) -c $(CFLAGS) $(LARGE) $*.c
83
84all: $(public) $(private) $(util)
85 touch all
86
87perl: $(obj) perl.o
88 $(CC) $(LDFLAGS) $(LARGE) $(obj) perl.o $(libs) -o perl
89
378cc40b 90perl.c perly.h: perl.y
91 @ echo Expect 37 shift/reduce errors...
92 yacc -d perl.y
8d063cd8 93 mv y.tab.c perl.c
378cc40b 94 mv y.tab.h perly.h
8d063cd8 95
378cc40b 96perl.o: perl.c perly.h perl.h EXTERN.h regexp.h util.h INTERN.h handy.h config.h
8d063cd8 97 $(CC) -c $(CFLAGS) $(LARGE) perl.c
98
99# if a .h file depends on another .h file...
100$(h):
101 touch $@
102
103perl.man: perl.man.1 perl.man.2
104 cat perl.man.1 perl.man.2 >perl.man
105
106install: perl perl.man
107# won't work with csh
108 export PATH || exit 1
378cc40b 109 - mv $(bin)/perl $(bin)/perl.old 2>/dev/null
8d063cd8 110 - if test `pwd` != $(bin); then cp $(public) $(bin); fi
111 cd $(bin); \
112for pub in $(public); do \
378cc40b 113chmod +x `basename $$pub`; \
8d063cd8 114done
378cc40b 115 - test $(bin) = /usr/bin || rm -f /usr/bin/perl
116 - test $(bin) = /usr/bin || $(SLN) $(bin)/perl /usr/bin || cp $(bin)/perl /usr/bin
117 chmod +x makedir
118 - ./makedir $(lib)
119 - \
120if test `pwd` != $(lib); then \
121cp $(private) lib/*.pl $(lib); \
122fi
123# cd $(lib); \
8d063cd8 124#for priv in $(private); do \
378cc40b 125#chmod +x `basename $$priv`; \
8d063cd8 126#done
127 - if test `pwd` != $(mansrc); then \
128for page in $(manpages); do \
129cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
130done; \
131fi
132
133clean:
134 rm -f *.o
135
136realclean:
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
378cc40b 144lint: perl.c $(c)
145 lint $(lintflags) $(defs) perl.c $(c) > perl.fuzz
8d063cd8 146
147depend: makedepend
378cc40b 148 - test -f perly.h || cp /dev/null perly.h
fdf95cbb 149 ./makedepend
378cc40b 150 - test -s perly.h || /bin/rm -f perly.h
8d063cd8 151
152test: perl
378cc40b 153 chmod +x t/TEST t/base.* t/comp.* t/cmd.* t/io.* t/op.*
2e1b3b7e 154 cd t && (rm -f perl; $(SLN) ../perl .) && ./perl TEST
8d063cd8 155
156clist:
157 echo $(c) | tr ' ' '\012' >.clist
158
159hlist:
160 echo $(h) | tr ' ' '\012' >.hlist
161
162shlist:
163 echo $(sh) | tr ' ' '\012' >.shlist
164
165# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
166$(obj):
167 @ echo "You haven't done a "'"make depend" yet!'; exit 1
168makedepend: makedepend.SH
169 /bin/sh makedepend.SH
170!NO!SUBS!
171$eunicefix Makefile
172case `pwd` in
173*SH)
174 $rm -f ../Makefile
175 ln Makefile ../Makefile
176 ;;
177esac