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