1 # This file is read by Makefile.SH to produce rules for $(LIBPERL) (and
2 # some additional rules as well).
4 # Rerun `sh Makefile.SH; make depend' after making any change.
6 # Additional rules supported: libperl.a (for static linking),
7 # ld2 and perlld removed
11 case $PERL_CONFIG_SH in
13 if test -f config.sh; then TOP=.;
14 elif test -f ../config.sh; then TOP=..;
15 elif test -f ../../config.sh; then TOP=../..;
16 elif test -f ../../../config.sh; then TOP=../../..;
17 elif test -f ../../../../config.sh; then TOP=../../../..;
19 echo "Can't find config.sh."; exit 1
25 addtopath=`pwd | sed -e 's/ /\\\ /g'`
26 $spitshell >>Makefile <<!GROK!THIS!
28 cygwin.c: cygwin/cygwin.c
29 \$(LNS) cygwin/cygwin.c
33 # make sure that all library names are not malformed
34 libperl=`echo $libperl|sed -e s,\\\..*,,`
35 linklibperl=-l`echo $libperl|sed -e s,^lib,,`
36 vers=`echo $version|tr '.' '_'`
37 dllname=`echo $libperl|sed -e s,^lib,cyg,`$vers
39 $spitshell >>Makefile <<!GROK!THIS!
41 LLIBPERL= $linklibperl
43 CLDFLAGS= -L$addtopath $ldflags
44 LDDLFLAGS = --shared -L$addtopath $ldflags
52 $spitshell >>Makefile <<'!NO!SUBS!'
55 # override default rule (NB: make croaks!) to force dll usage
56 perlmain$(OBJ_EXT): perlmain.c
57 $(CCCMD) $(PLDLFLAGS) -DUSEIMPORTLIB $*.c
59 # library used to make statically linked executables
60 # miniperl is linked against it to avoid libperl.dll locking
61 $(LIBPERL)$(LIB_EXT): $& $(cwobj)
64 # dll and import library
65 $(LIBPERL).dll$(LIB_EXT): $& $(cwobj)
66 $(LDLIBPTH) $(CC) $(SHRPLDFLAGS) -o $(DLLNAME)$(DLSUFFIX) -Wl,--out-implib=$@ \
69 # How to build executables.
71 # The miniperl -w -MExporter line is a basic cheap test to catch errors
72 # before make goes on to run preplibrary and then MakeMaker on extensions.
73 # This is very handy because later errors are often caused by miniperl
74 # build problems but that's not obvious to the novice.
75 # The Module used here must not depend on Config or any extensions.
78 miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) opmini$(OBJ_EXT)
79 $(LDLIBPTH) $(CC) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(libs)
80 $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
83 perl: $& perlmain$(OBJ_EXT) $(LIBPERL).dll$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
84 $(SHRPENV) $(LDLIBPTH) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
86 pureperl: $& perlmain$(OBJ_EXT) $(LIBPERL).dll$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
87 $(SHRPENV) $(LDLIBPTH) purify $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
89 purecovperl: $& perlmain$(OBJ_EXT) $(LIBPERL).dll$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
90 $(SHRPENV) $(LDLIBPTH) purecov $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o purecovperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
92 quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL).dll$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
93 $(SHRPENV) $(LDLIBPTH) quantify $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
98 $spitshell >>Makefile <<'!NO!SUBS!'
102 $(LIBPERL)$(LIB_EXT): $& $(cwobj)
103 $(AR) rcu $@ $(cwobj)
105 # How to build executables.
107 # The miniperl -w -MExporter line is a basic cheap test to catch errors
108 # before make goes on to run preplibrary and then MakeMaker on extensions.
109 # This is very handy because later errors are often caused by miniperl
110 # build problems but that's not obvious to the novice.
111 # The Module used here must not depend on Config or any extensions.
114 miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) opmini$(OBJ_EXT)
115 $(LDLIBPTH) $(CC) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LLIBPERL) $(libs)
116 $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
119 perl: $& perlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
120 $(SHRPENV) $(LDLIBPTH) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) -Wl,-Bstatic $(LLIBPERL) -Wl,-Bdynamic `cat ext.libs` $(libs)
122 pureperl: $& perlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
123 $(SHRPENV) $(LDLIBPTH) purify $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
125 purecovperl: $& perlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
126 $(SHRPENV) $(LDLIBPTH) purecov $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o purecovperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
128 quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
129 $(SHRPENV) $(LDLIBPTH) quantify $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
135 # libperl.a is _the_ library both in dll and static cases
136 # $(LIBPERL)$(LIB_EXT) expands to this name dependless of build model
138 # NOTE: The "-Wl,-Bstatic $(LLIBPERL) -Wl,-Bdynamic" is required to give
139 # the import library linking priority over the dynamic library, since both
140 # the .dll and .a are in the same directory. When the new standard for
141 # naming import/dynamic/static libraries emerges this should be updated.
143 $spitshell >>Makefile <<'!NO!SUBS!'
148 # suid perl is removed - i've never seen suid scripts for win32
150 ##############################################
153 $spitshell >>Makefile <<'!NO!SUBS!'
155 DIST_DIRECTORY = .dist
158 -mkdir $(DIST_DIRECTORY)
159 ./miniperl -Ilib '-MExtUtils::Manifest' \
160 -e "ExtUtils::Manifest::manicopy(ExtUtils::Manifest::maniread(),'$(DIST_DIRECTORY)')"