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