This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Refactor File::DosGlob to avoid an unescaped { in a regex.
[perl5.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 # These use the Cwd extension.  For statically-built perls, we
30 # need perl, not just miniperl.
31 case "$usedl" in
32     define) perl="../miniperl" ;;
33     *)      perl="../perl" ;;
34 esac
35 cat >Makefile <<!GROK!THIS!
36 # Generated from utils/Makefile.SH.  The generated file is
37 # shipped with the source kit for systems such as win32
38 # which don't do .SH extraction.
39
40 PERL = $perl
41 REALPERL = ../perl
42 RUN = $run  # Used mainly cross-compilation setups.
43
44 !GROK!THIS!
45
46 cat >>Makefile <<'!NO!SUBS!'
47
48 # Files to be built with variable substitution after miniperl is
49 # available.  Dependencies handled manually below (for now).
50
51 pl = c2ph.PL config_data.PL corelist.PL cpan.PL h2ph.PL h2xs.PL instmodsh.PL json_pp.PL perlbug.PL perldoc.PL perlivp.PL pl2pm.PL prove.PL ptar.PL ptardiff.PL ptargrep.PL cpanp-run-perl.PL cpanp.PL cpan2dist.PL shasum.PL splain.PL libnetcfg.PL piconv.PL enc2xs.PL xsubpp.PL pod2html.PL zipdetails.PL
52 plextract = c2ph config_data corelist cpan h2ph h2xs instmodsh json_pp perlbug perldoc perlivp pl2pm prove ptar ptardiff ptargrep cpanp-run-perl cpanp cpan2dist shasum splain libnetcfg piconv enc2xs xsubpp pod2html zipdetails
53 plextractexe = ./c2ph ./config_data ./corelist ./cpan ./h2ph ./h2xs ./json_pp ./instmodsh ./perlbug ./perldoc ./perlivp ./pl2pm ./prove ./ptar ./ptardiff ./ptargrep ./cpanp-run-perl ./cpanp ./cpan2dist ./shasum ./splain ./libnetcfg ./piconv ./enc2xs ./xsubpp ./pod2html ./zipdetails
54
55 all: $(plextract) 
56
57 $(plextract):
58         $(RUN) $(PERL) -I../lib $@.PL
59
60 c2ph:           c2ph.PL ../config.sh
61
62 cpan:           cpan.PL ../config.sh
63
64 config_data:    config_data.PL ../config.sh
65
66 corelist:       corelist.PL ../config.sh
67
68 h2ph:           h2ph.PL ../config.sh
69
70 h2xs:           h2xs.PL ../config.sh
71
72 instmodsh:      instmodsh.PL ../config.sh
73
74 json_pp:        json_pp.PL ../config.sh
75
76 perlbug:        perlbug.PL ../config.sh ../patchlevel.h
77
78 perldoc:        perldoc.PL ../config.sh
79
80 perlivp:        perlivp.PL ../config.sh
81
82 prove:          prove.PL ../config.sh
83
84 ptar:           ptar.PL ../config.sh
85
86 ptardiff:       ptardiff.PL ../config.sh
87
88 ptargrep:       ptargrep.PL ../config.sh
89
90 cpanp-run-perl: cpanp-run-perl.PL ../config.sh
91
92 cpanp:  cpanp.PL ../config.sh
93
94 cpan2dist:      cpan2dist.PL ../config.sh
95
96 pl2pm:          pl2pm.PL ../config.sh
97
98 shasum:         shasum.PL ../config.sh
99
100 splain:         splain.PL ../config.sh ../lib/diagnostics.pm
101
102 libnetcfg:      libnetcfg.PL ../config.sh
103
104 piconv:         piconv.PL ../config.sh
105
106 enc2xs:         enc2xs.PL ../config.sh
107
108 xsubpp:         xsubpp.PL ../config.sh
109
110 zipdetails:     zipdetails.PL ../config.sh
111
112 pod2html:       pod2html.PL ../config.sh ../ext/Pod-Html/bin/pod2html
113
114 clean:
115
116 realclean:
117         rm -rf $(plextract) pstruct $(plextractexe)
118         rm -f ../t/_h2ph_pre.ph
119
120 clobber:        realclean
121
122 distclean:      clobber
123
124 veryclean:      distclean
125         -rm -f *~ *.org
126 !NO!SUBS!
127 $eunicefix Makefile
128 case `pwd` in
129 *SH)
130     $rm -f ../Makefile
131     $ln Makefile ../Makefile
132     ;;
133 esac
134 rm -f $firstmakefile