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