Commit | Line | Data |
8d063cd8 |
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 |
378cc40b |
9 | . ./config.sh |
8d063cd8 |
10 | ;; |
11 | esac |
12 | case "$0" in |
13 | */*) cd `expr X$0 : 'X\(.*\)/'` ;; |
14 | esac |
2e1b3b7e |
15 | |
16 | case "$d_symlink" in |
17 | *define*) sln='ln -s' ;; |
18 | *) sln='ln';; |
19 | esac |
20 | |
8d063cd8 |
21 | echo "Extracting Makefile (with variable substitutions)" |
22 | cat >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 | |
31 | CC = $cc |
32 | bin = $bin |
378cc40b |
33 | lib = $privlib |
8d063cd8 |
34 | mansrc = $mansrc |
35 | manext = $manext |
36 | CFLAGS = $ccflags -O |
37 | LDFLAGS = $ldflags |
38 | SMALL = $small |
39 | LARGE = $large $split |
a1cc2bdc |
40 | mallocsrc = $mallocsrc |
41 | mallocobj = $mallocobj |
2e1b3b7e |
42 | SLN = $sln |
8d063cd8 |
43 | |
44 | libs = $libnm -lm |
45 | !GROK!THIS! |
46 | |
47 | cat >>Makefile <<'!NO!SUBS!' |
48 | |
a559c259 |
49 | public = perl perldb |
8d063cd8 |
50 | |
51 | private = |
52 | |
a559c259 |
53 | manpages = perl.man perldb.man |
8d063cd8 |
54 | |
55 | util = |
56 | |
57 | sh = Makefile.SH makedepend.SH |
58 | |
59 | h1 = EXTERN.h INTERN.h arg.h array.h cmd.h config.h form.h handy.h |
378cc40b |
60 | h2 = hash.h perl.h regexp.h spat.h stab.h str.h util.h |
8d063cd8 |
61 | |
62 | h = $(h1) $(h2) |
63 | |
378cc40b |
64 | c1 = arg.c array.c cmd.c dump.c eval.c form.c hash.c $(mallocsrc) |
65 | c2 = perly.c regexp.c stab.c str.c toke.c util.c version.c |
8d063cd8 |
66 | |
67 | c = $(c1) $(c2) |
68 | |
378cc40b |
69 | obj1 = arg.o array.o cmd.o dump.o eval.o form.o hash.o $(mallocobj) |
70 | obj2 = perly.o regexp.o stab.o str.o toke.o util.o version.o |
8d063cd8 |
71 | |
72 | obj = $(obj1) $(obj2) |
73 | |
74 | lintflags = -phbvxac |
75 | |
76 | addedbyconf = Makefile.old bsd eunice filexp loc pdp11 usg v7 |
77 | |
78 | # grrr |
79 | SHELL = /bin/sh |
80 | |
81 | .c.o: |
82 | $(CC) -c $(CFLAGS) $(LARGE) $*.c |
83 | |
84 | all: $(public) $(private) $(util) |
85 | touch all |
86 | |
87 | perl: $(obj) perl.o |
88 | $(CC) $(LDFLAGS) $(LARGE) $(obj) perl.o $(libs) -o perl |
89 | |
378cc40b |
90 | perl.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 |
96 | perl.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 | |
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 |
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); \ |
112 | for pub in $(public); do \ |
378cc40b |
113 | chmod +x `basename $$pub`; \ |
8d063cd8 |
114 | done |
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 | - \ |
120 | if test `pwd` != $(lib); then \ |
121 | cp $(private) lib/*.pl $(lib); \ |
122 | fi |
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 \ |
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 | |
378cc40b |
144 | lint: perl.c $(c) |
145 | lint $(lintflags) $(defs) perl.c $(c) > perl.fuzz |
8d063cd8 |
146 | |
147 | depend: 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 | |
152 | test: 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 | |
156 | clist: |
157 | echo $(c) | tr ' ' '\012' >.clist |
158 | |
159 | hlist: |
160 | echo $(h) | tr ' ' '\012' >.hlist |
161 | |
162 | shlist: |
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 |
168 | makedepend: makedepend.SH |
169 | /bin/sh makedepend.SH |
170 | !NO!SUBS! |
171 | $eunicefix Makefile |
172 | case `pwd` in |
173 | *SH) |
174 | $rm -f ../Makefile |
175 | ln Makefile ../Makefile |
176 | ;; |
177 | esac |