perl 5.003_03: hints/sco.sh
[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
5acd297e 20: ${bin_sh=/bin/sh}
21
8d063cd8 22echo "Extracting x2p/Makefile (with variable substitutions)"
bf10efe7 23rm -f Makefile
8d063cd8 24cat >Makefile <<!GROK!THIS!
5acd297e 25# $RCSfile: Makefile.SH,v $$Revision: 4.1 $$Date: 1996/07/05 23:49:56 $
8d063cd8 26#
27# $Log: Makefile.SH,v $
5acd297e 28# Revision 1.2 1996/07/05 23:49:56 gerti
29# OPENSTEP 4.0 patches
30#
8d063cd8 31
32CC = $cc
9c8d0b29 33BYACC = $byacc
8d063cd8 34LDFLAGS = $ldflags
35SMALL = $small
36LARGE = $large $split
5acd297e 37MAB = $mab
a1cc2bdc 38mallocsrc = $mallocsrc
39mallocobj = $mallocobj
bf10efe7 40shellflags = $shellflags
8d063cd8 41
b6ccd89c 42libs = $libs
cc72480d 43
44# These variables will be used in a future version to make
45# the make file more portable to non-unix systems.
46AR = $ar
47EXE_EXT = $exe_ext
48LIB_EXT = $lib_ext
49OBJ_EXT = $obj_ext
50PATH_SEP = $path_sep
51
52FIRSTMAKEFILE = $firstmakefile
53
54.SUFFIXES: .c \$(OBJ_EXT)
55
5acd297e 56# grrr
57SHELL = $bin_sh
58
8d063cd8 59!GROK!THIS!
60
61cat >>Makefile <<'!NO!SUBS!'
62
bf10efe7 63CCCMD = `sh $(shellflags) cflags $@`
d48672a2 64
fe14fcc3 65public = a2p s2p find2perl
8d063cd8 66
67private =
68
69manpages = a2p.man s2p.man
70
71util =
72
4633a7c4 73sh = Makefile.SH cflags.SH
74shextract = Makefile cflags
8d063cd8 75
4633a7c4 76pl = find2perl.PL s2p.PL
77plextract = find2perl s2p
78
79addedbyconf = $(shextract) $(plextract)
16d20bd9 80
bf10efe7 81h = EXTERN.h INTERN.h ../config.h handy.h hash.h a2p.h str.h util.h
8d063cd8 82
a1cc2bdc 83c = hash.c $(mallocsrc) str.c util.c walk.c
8d063cd8 84
cc72480d 85obj = hash$(OBJ_EXT) $(mallocobj) str$(OBJ_EXT) util$(OBJ_EXT) walk$(OBJ_EXT)
8d063cd8 86
87lintflags = -phbvxac
88
cc72480d 89.c$(OBJ_EXT):
760ac839 90 $(CCCMD) $(MAB) -DPERL_FOR_X2P $*.c
8d063cd8 91
92all: $(public) $(private) $(util)
93 touch all
94
cc72480d 95a2p: $(obj) a2p$(OBJ_EXT)
5acd297e 96 $(CC) $(MAB) $(LDFLAGS) $(obj) a2p$(OBJ_EXT) $(libs) -o a2p
8d063cd8 97
9c8d0b29 98# I now supply a2p.c with the kits, so the following section is
56febc5e 99# used only if you force byacc to run by saying
100# make run_byacc
101
232e078e 102run_byacc: FORCE
56febc5e 103 @ echo Expect many shift/reduce and reduce/reduce conflicts
104 $(BYACC) a2p.y
105 mv y.tab.c a2p.c
106
107# We don't want to regenerate a2p.c, but it might appear out-of-date
108# after a patch is applied or a new distribution is made.
109a2p.c: a2p.y
232e078e 110 -@touch a2p.c
8d063cd8 111
cc72480d 112a2p$(OBJ_EXT): a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h hash.h
760ac839 113 $(CCCMD) $(LARGE) $(MAB) -DPERL_FOR_X2P a2p.c
8d063cd8 114
8d063cd8 115clean:
cc72480d 116 rm -f a2p *$(OBJ_EXT)
8d063cd8 117
b6ccd89c 118realclean: clean
9c8d0b29 119 rm -f *.orig core $(addedbyconf) all malloc.c
cc72480d 120 rm -f $(FIRSTMAKEFILE) $(FIRSTMAKEFILE).old
8d063cd8 121
122# The following lint has practically everything turned on. Unfortunately,
123# you have to wade through a lot of mumbo jumbo that can't be suppressed.
124# If the source file has a /*NOSTRICT*/ somewhere, ignore the lint message
125# for that spot.
126
127lint:
128 lint $(lintflags) $(defs) $(c) > a2p.fuzz
129
f1ca563b 130depend: $(mallocsrc) ../makedepend
cc72480d 131 sh ../makedepend
8d063cd8 132
133clist:
134 echo $(c) | tr ' ' '\012' >.clist
135
136hlist:
137 echo $(h) | tr ' ' '\012' >.hlist
138
139shlist:
140 echo $(sh) | tr ' ' '\012' >.shlist
141
4633a7c4 142# These should be automatically generated
143
144$(plextract):
145 ../miniperl -I../lib $@.PL
146
f1ca563b 147malloc.c: ../malloc.c
748a9306 148 rm -f malloc.c
79072805 149 sed <../malloc.c >malloc.c \
150 -e 's/"perl.h"/"..\/perl.h"/' \
151 -e 's/my_exit/exit/'
f1ca563b 152
8d063cd8 153# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
154$(obj):
155 @ echo "You haven't done a "'"make depend" yet!'; exit 1
a0d0e21e 156makedepend: depend
8d063cd8 157!NO!SUBS!
158$eunicefix Makefile
159case `pwd` in
160*SH)
161 $rm -f ../Makefile
cc72480d 162 $ln Makefile ../Makefile
8d063cd8 163 ;;
164esac
cc72480d 165rm -f $firstmakefile