Re: [PATCH] Cray XT4/Catamount build
[p5sagit/p5-mst-13.2.git] / utils / Makefile.SH
1 case $PERL_CONFIG_SH in
2 '')
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         ;;
13 esac
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.
16 case "$0" in
17 */Makefile.SH) cd `expr X$0 : 'X\(.*\)/'` ;;
18 Makefile.SH) ;;
19 *) case `pwd` in
20    */utils) ;;
21    *) if test -d utils; then cd utils
22       else echo "Can't figure out where to write output."; exit 1
23           fi;;
24    esac;;
25 esac
26
27 echo "Extracting utils/Makefile (with variable substitutions)"
28 rm -f Makefile
29 cat >Makefile <<!GROK!THIS!
30
31 PERL = ../miniperl
32 REALPERL = ../perl
33 RUN = $run  # Used mainly cross-compilation setups.
34
35 !GROK!THIS!
36
37 cat >>Makefile <<'!NO!SUBS!'
38
39 # Files to be built with variable substitution after miniperl is
40 # available.  Dependencies handled manually below (for now).
41
42 pl = c2ph.PL config_data.PL corelist.PL cpan.PL h2ph.PL h2xs.PL instmodsh.PL perlbug.PL perldoc.PL perlivp.PL pl2pm.PL prove.PL ptar.PL ptardiff.PL cpanp-run-perl.PL cpanp.PL cpan2dist.PL shasum.PL splain.PL dprofpp.PL libnetcfg.PL piconv.PL enc2xs.PL xsubpp.PL
43 plextract = c2ph config_data corelist cpan h2ph h2xs instmodsh perlbug perldoc perlivp pl2pm prove ptar ptardiff cpanp-run-perl cpanp cpan2dist shasum splain dprofpp libnetcfg piconv enc2xs xsubpp
44 plextractexe = ./c2ph ./config_data ./corelist ./cpan ./h2ph ./h2xs ./instmodsh ./perlbug ./perldoc ./perlivp ./pl2pm ./prove ./ptar ./ptardiff ./cpanp-run-perl ./cpanp ./cpan2dist ./shasum ./splain ./dprofpp ./libnetcfg ./piconv ./enc2xs ./xsubpp
45
46 all: $(plextract) 
47
48 $(plextract):
49         $(RUN) $(PERL) -I../lib $@.PL
50
51 c2ph:           c2ph.PL ../config.sh
52
53 cpan:           cpan.PL ../config.sh
54
55 config_data:    config_data.PL ../config.sh
56
57 corelist:       corelist.PL ../config.sh
58
59 h2ph:           h2ph.PL ../config.sh
60
61 h2xs:           h2xs.PL ../config.sh
62
63 instmodsh:      instmodsh.PL ../config.sh
64
65 perlbug:        perlbug.PL ../config.sh ../patchlevel.h
66
67 perldoc:        perldoc.PL ../config.sh
68
69 perlivp:        perlivp.PL ../config.sh
70
71 prove:          prove.PL ../config.sh
72
73 ptar:           ptar.PL ../config.sh
74
75 ptardiff:       ptardiff.PL ../config.sh
76
77 cpanp-run-perl: cpanp-run-perl.PL ../config.sh
78
79 cpanp:  cpanp.PL ../config.sh
80
81 cpan2dist:      cpan2dist.PL ../config.sh
82
83 pl2pm:          pl2pm.PL ../config.sh
84
85 shasum:         shasum.PL ../config.sh
86
87 splain:         splain.PL ../config.sh ../lib/diagnostics.pm
88
89 dprofpp:        dprofpp.PL ../config.sh
90
91 libnetcfg:      libnetcfg.PL ../config.sh
92
93 piconv:         piconv.PL ../config.sh
94
95 enc2xs:         enc2xs.PL ../config.sh
96
97 xsubpp:         xsubpp.PL ../config.sh
98
99 clean:
100
101 realclean:
102         rm -rf $(plextract) pstruct $(plextractexe)
103         rm -f ../t/_h2ph_pre.ph
104
105 clobber:        realclean
106
107 distclean:      clobber
108
109 veryclean:      distclean
110         -rm -f *~ *.org
111 !NO!SUBS!
112 $eunicefix Makefile
113 case `pwd` in
114 *SH)
115     $rm -f ../Makefile
116     $ln Makefile ../Makefile
117     ;;
118 esac
119 rm -f $firstmakefile