perl 5.003_01: t/lib/filehand.t
[p5sagit/p5-mst-13.2.git] / x2p / Makefile.SH
CommitLineData
8d063cd8 1case $CONFIG in
2'')
a0d0e21e 3 if test -f config.sh; then TOP=.;
4 elif test -f ../config.sh; then TOP=..;
5 elif test -f ../../config.sh; then TOP=../..;
6 elif test -f ../../../config.sh; then TOP=../../..;
7 elif test -f ../../../../config.sh; then TOP=../../../..;
8 else
9 echo "Can't find config.sh."; exit 1
10 fi
11 . $TOP/config.sh
12 ;;
8d063cd8 13esac
a0d0e21e 14: This forces SH files to create target in same directory as SH file.
15: This is so that make depend always knows where to find SH derivatives.
16case "$0" in
17*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
18esac
19
8d063cd8 20echo "Extracting x2p/Makefile (with variable substitutions)"
bf10efe7 21rm -f Makefile
8d063cd8 22cat >Makefile <<!GROK!THIS!
79072805 23# $RCSfile: Makefile.SH,v $$Revision: 4.1 $$Date: 92/08/07 18:29:07 $
8d063cd8 24#
25# $Log: Makefile.SH,v $
8d063cd8 26
27CC = $cc
9c8d0b29 28BYACC = $byacc
8d063cd8 29LDFLAGS = $ldflags
30SMALL = $small
31LARGE = $large $split
a1cc2bdc 32mallocsrc = $mallocsrc
33mallocobj = $mallocobj
bf10efe7 34shellflags = $shellflags
8d063cd8 35
b6ccd89c 36libs = $libs
cc72480d 37
38# These variables will be used in a future version to make
39# the make file more portable to non-unix systems.
40AR = $ar
41EXE_EXT = $exe_ext
42LIB_EXT = $lib_ext
43OBJ_EXT = $obj_ext
44PATH_SEP = $path_sep
45
46FIRSTMAKEFILE = $firstmakefile
47
48.SUFFIXES: .c \$(OBJ_EXT)
49
8d063cd8 50!GROK!THIS!
51
52cat >>Makefile <<'!NO!SUBS!'
53
bf10efe7 54CCCMD = `sh $(shellflags) cflags $@`
d48672a2 55
fe14fcc3 56public = a2p s2p find2perl
8d063cd8 57
58private =
59
60manpages = a2p.man s2p.man
61
62util =
63
4633a7c4 64sh = Makefile.SH cflags.SH
65shextract = Makefile cflags
8d063cd8 66
4633a7c4 67pl = find2perl.PL s2p.PL
68plextract = find2perl s2p
69
70addedbyconf = $(shextract) $(plextract)
16d20bd9 71
bf10efe7 72h = EXTERN.h INTERN.h ../config.h handy.h hash.h a2p.h str.h util.h
8d063cd8 73
a1cc2bdc 74c = hash.c $(mallocsrc) str.c util.c walk.c
8d063cd8 75
cc72480d 76obj = hash$(OBJ_EXT) $(mallocobj) str$(OBJ_EXT) util$(OBJ_EXT) walk$(OBJ_EXT)
8d063cd8 77
78lintflags = -phbvxac
79
8d063cd8 80# grrr
81SHELL = /bin/sh
82
cc72480d 83.c$(OBJ_EXT):
d48672a2 84 $(CCCMD) $*.c
8d063cd8 85
86all: $(public) $(private) $(util)
87 touch all
88
cc72480d 89a2p: $(obj) a2p$(OBJ_EXT)
90 $(CC) $(LDFLAGS) $(obj) a2p$(OBJ_EXT) $(libs) -o a2p
8d063cd8 91
9c8d0b29 92# I now supply a2p.c with the kits, so the following section is
56febc5e 93# used only if you force byacc to run by saying
94# make run_byacc
95
232e078e 96run_byacc: FORCE
56febc5e 97 @ echo Expect many shift/reduce and reduce/reduce conflicts
98 $(BYACC) a2p.y
99 mv y.tab.c a2p.c
100
101# We don't want to regenerate a2p.c, but it might appear out-of-date
102# after a patch is applied or a new distribution is made.
103a2p.c: a2p.y
232e078e 104 -@touch a2p.c
8d063cd8 105
cc72480d 106a2p$(OBJ_EXT): a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h hash.h
d48672a2 107 $(CCCMD) $(LARGE) a2p.c
8d063cd8 108
8d063cd8 109clean:
cc72480d 110 rm -f a2p *$(OBJ_EXT)
8d063cd8 111
b6ccd89c 112realclean: clean
9c8d0b29 113 rm -f *.orig core $(addedbyconf) all malloc.c
cc72480d 114 rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old
8d063cd8 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
f1ca563b 124depend: $(mallocsrc) ../makedepend
cc72480d 125 sh ../makedepend
8d063cd8 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
4633a7c4 136# These should be automatically generated
137
138$(plextract):
139 ../miniperl -I../lib $@.PL
140
f1ca563b 141malloc.c: ../malloc.c
748a9306 142 rm -f malloc.c
79072805 143 sed <../malloc.c >malloc.c \
144 -e 's/"perl.h"/"..\/perl.h"/' \
145 -e 's/my_exit/exit/'
f1ca563b 146
8d063cd8 147# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
148$(obj):
149 @ echo "You haven't done a "'"make depend" yet!'; exit 1
a0d0e21e 150makedepend: depend
8d063cd8 151!NO!SUBS!
152$eunicefix Makefile
153case `pwd` in
154*SH)
155 $rm -f ../Makefile
cc72480d 156 $ln Makefile ../Makefile
8d063cd8 157 ;;
158esac
cc72480d 159rm -f $firstmakefile