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,``echo $vers|sed -e s,_[0-9]$,,`
38 # append "d" suffix to -DDEBUGGING build: cygperl5_10d.dll
44 # added -mms-bitfields to be able to link to MSVC win32 bitfields libs
45 # (4 byte instead of 2 byte alignment)
47 $spitshell >>Makefile <<!GROK!THIS!
49 LLIBPERL= $linklibperl
51 CLDFLAGS= -L$addtopath $ldflags
52 LDDLFLAGS = --shared -L$addtopath $ldflags
53 CCFLAGS=$ccflags -mms-bitfields
61 $spitshell >>Makefile <<'!NO!SUBS!'
64 # override default rule (NB: make croaks!) to force dll usage
65 perlmain$(OBJ_EXT): perlmain.c
66 $(CCCMD) $(PLDLFLAGS) -DUSEIMPORTLIB $*.c
68 # library used to make statically linked executables
69 # miniperl is linked against it to avoid libperl.dll locking
70 $(LIBPERL)$(LIB_EXT): $& $(cwobj)
73 # dll and import library
74 $(LIBPERL).dll$(LIB_EXT): $& $(cwobj)
75 $(LDLIBPTH) $(CC) $(SHRPLDFLAGS) -o $(DLLNAME)$(DLSUFFIX) -Wl,--out-implib=$@ \
78 # How to build executables.
80 # The miniperl -w -MExporter line is a basic cheap test to catch errors
81 # before make goes on to run preplibrary and then MakeMaker on extensions.
82 # This is very handy because later errors are often caused by miniperl
83 # build problems but that's not obvious to the novice.
84 # The Module used here must not depend on Config or any extensions.
87 miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) opmini$(OBJ_EXT)
88 $(LDLIBPTH) $(CC) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(libs)
89 $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
92 perl: $& perlmain$(OBJ_EXT) $(LIBPERL).dll$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
93 $(SHRPENV) $(LDLIBPTH) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
95 pureperl: $& perlmain$(OBJ_EXT) $(LIBPERL).dll$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
96 $(SHRPENV) $(LDLIBPTH) purify $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
98 purecovperl: $& perlmain$(OBJ_EXT) $(LIBPERL).dll$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
99 $(SHRPENV) $(LDLIBPTH) purecov $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o purecovperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
101 quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL).dll$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
102 $(SHRPENV) $(LDLIBPTH) quantify $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
107 $spitshell >>Makefile <<'!NO!SUBS!'
111 $(LIBPERL)$(LIB_EXT): $& $(cwobj)
112 $(AR) rcu $@ $(cwobj)
114 # How to build executables.
116 # The miniperl -w -MExporter line is a basic cheap test to catch errors
117 # before make goes on to run preplibrary and then MakeMaker on extensions.
118 # This is very handy because later errors are often caused by miniperl
119 # build problems but that's not obvious to the novice.
120 # The Module used here must not depend on Config or any extensions.
123 miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) opmini$(OBJ_EXT)
124 $(LDLIBPTH) $(CC) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) opmini$(OBJ_EXT) $(LLIBPERL) $(libs)
125 $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e '<?>' || $(MAKE) minitest
128 perl: $& perlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
129 $(SHRPENV) $(LDLIBPTH) $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) -Wl,-Bstatic $(LLIBPERL) -Wl,-Bdynamic `cat ext.libs` $(libs)
131 pureperl: $& perlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
132 $(SHRPENV) $(LDLIBPTH) purify $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
134 purecovperl: $& perlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
135 $(SHRPENV) $(LDLIBPTH) purecov $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o purecovperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
137 quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
138 $(SHRPENV) $(LDLIBPTH) quantify $(CC) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
144 # libperl.a is _the_ library both in dll and static cases
145 # $(LIBPERL)$(LIB_EXT) expands to this name dependless of build model
147 # NOTE: The "-Wl,-Bstatic $(LLIBPERL) -Wl,-Bdynamic" is required to give
148 # the import library linking priority over the dynamic library, since both
149 # the .dll and .a are in the same directory. When the new standard for
150 # naming import/dynamic/static libraries emerges this should be updated.
152 $spitshell >>Makefile <<'!NO!SUBS!'
157 # suid perl is removed - i've never seen suid scripts for win32
159 ##############################################
162 $spitshell >>Makefile <<'!NO!SUBS!'
164 DIST_DIRECTORY = .dist
167 -mkdir $(DIST_DIRECTORY)
168 ./miniperl -Ilib '-MExtUtils::Manifest' \
169 -e "ExtUtils::Manifest::manicopy(ExtUtils::Manifest::maniread(),'$(DIST_DIRECTORY)')"