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: libperls.a (for static linking),
7 # ld2, perlld (dynamic linking tools)
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
26 $spitshell >>Makefile <<!GROK!THIS!
28 # shell script feeding perlld to decent perl
29 ld2: $& Makefile perlld ${src}/cygwin32/ld2.in
30 @echo "extracting ld2 (with variable substitutions)"
31 @$sed s,@buildpath@,$addtopath,g <${src}/cygwin32/ld2.in >ld2
34 $spitshell >>Makefile <<!GROK!THIS!
38 # this one is pretty mandatory
41 # following are optional.
46 # if some of extensions are empty,
47 # no corresponding output will be done.
48 # most probably, you'd like to have an export library
52 perlld: $& Makefile ${src}/cygwin32/perlld.in
53 @echo "extracting perlld (with variable substitutions)"
54 @$sed -e s,@CC@,\${CC}, -e s,@DLLWRAP@,\${DLLWRAP},g \\
55 -e s,@WRAPDRIVER@,\${WRAPDRIVER},g -e s,@DLLTOOL@,\${DLLTOOL},g \\
56 -e s,@AS@,\${AS},g -e s,@EXPORT_ALL@,\${EXPORT_ALL},g \\
57 -e s,@DEF_EXT@,\${DEF_EXT},g -e s,@EXP_EXT@,\${EXP_EXT},g \\
58 -e s,@LIB_EXT@,\${LIB_EXT},g \\
59 ${src}/cygwin32/perlld.in >perlld
63 # make sure that all library names are not malformed
64 libperl=`echo $libperl|sed -e s,\\\..*,,`
66 # it would be nice to allow dll to have any name,
67 # but for now i insist on 'lib<whatever>.dll'
68 if ( ! ( echo $libperl | grep '^lib' >/dev/null ) )
72 linklibperl=-l`echo $libperl|sed -e s,^lib,,`
74 $spitshell >>Makefile <<!GROK!THIS!
76 LLIBPERL= $linklibperl
77 LDLIBPTH= PATH=$addtopath:\${PATH}
78 CLDFLAGS= -L$addtopath $ldflags
85 $spitshell >>Makefile <<'!NO!SUBS!'
88 # override default rule (NB: make croaks!) to force dll usage
89 perlmain$(OBJ_EXT): perlmain.c
90 $(CCCMD) $(PLDLFLAGS) -DUSEIMPORTLIB=\"$(LIBPERL)$(LIB_EXT)\" $*.c
92 # library used to make statically linked executables
93 # miniperl is linked against it to avoid libperl.dll locking
94 $(LIBPERL)s$(LIB_EXT): $& perl$(OBJ_EXT) $(cwobj)
95 $(AR) rcu $@ perl$(OBJ_EXT) $(cwobj)
97 # dll and import library
98 $(LIBPERL)$(LIB_EXT): $& perl$(OBJ_EXT) $(cwobj) ld2
99 $(LDLIBPTH) ld2 $(SHRPLDFLAGS) -o $(LIBPERL)$(DLSUFFIX) \
100 perl$(OBJ_EXT) $(cwobj) $(libs)
102 # How to build executables.
104 # The miniperl -w -MExporter line is a basic cheap test to catch errors
105 # before make goes on to run preplibrary and then MakeMaker on extensions.
106 # This is very handy because later errors are often caused by miniperl
107 # build problems but that's not obvious to the novice.
108 # The Module used here must not depend on Config or any extensions.
110 miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL)s$(LIB_EXT)
111 $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) $(LLIBPERL)s $(libs)
112 $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e 0 || $(MAKE) minitest
117 $spitshell >>Makefile <<'!NO!SUBS!'
120 $(LIBPERL)$(LIB_EXT): $& perl$(OBJ_EXT) $(cwobj)
121 $(AR) rcu $@ perl$(OBJ_EXT) $(cwobj)
123 # How to build executables.
125 # The miniperl -w -MExporter line is a basic cheap test to catch errors
126 # before make goes on to run preplibrary and then MakeMaker on extensions.
127 # This is very handy because later errors are often caused by miniperl
128 # build problems but that's not obvious to the novice.
129 # The Module used here must not depend on Config or any extensions.
131 miniperl: $& miniperlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT)
132 $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) -o miniperl miniperlmain$(OBJ_EXT) $(LLIBPERL) $(libs)
133 $(LDLIBPTH) ./miniperl -w -Ilib -MExporter -e 0 || $(MAKE) minitest
139 # libperl.a is _the_ library both in dll and static cases
140 # $(LIBPERL)$(LIB_EXT) expands to this name dependless of build model
142 $spitshell >>Makefile <<'!NO!SUBS!'
144 perl: $& perlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
145 $(SHRPENV) $(LDLIBPTH) $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o perl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
147 pureperl: $& perlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
148 $(SHRPENV) $(LDLIBPTH) purify $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o pureperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
150 purecovperl: $& perlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
151 $(SHRPENV) $(LDLIBPTH) purecov $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o purecovperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
153 quantperl: $& perlmain$(OBJ_EXT) $(LIBPERL)$(LIB_EXT) $(DYNALOADER) $(static_ext) ext.libs
154 $(SHRPENV) $(LDLIBPTH) quantify $(CC) $(LARGE) $(CLDFLAGS) $(CCDLFLAGS) -o quantperl perlmain$(OBJ_EXT) $(DYNALOADER) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs)
158 # suid perl is removed - i've never seen suid scripts for win32
160 ##############################################
163 $spitshell >>Makefile <<'!NO!SUBS!'
165 DIST_DIRECTORY = .dist
168 -mkdir $(DIST_DIRECTORY)
169 ./miniperl '-MExtUtils::Manifest' \
170 -e "ExtUtils::Manifest::manicopy(ExtUtils::Manifest::maniread(),'$(DIST_DIRECTORY)')"