#DEBUG_MSTATS = define
#
+# set this to additionally provide a statically linked perl-static.exe.
+# Note that dynamic loading will not work with this perl, so you must
+# include required modules statically using STATIC_EXT variable below.
+# A static library perl59s.lib will also be created.
+# Ordinary perl.exe is not affected by this option.
+#
+#BUILD_STATIC = define
+
+#
#
# set the install locations of the compiler include/libraries
# Running VCVARS32.BAT is *required* when using Visual C.
LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) \
-libpath:"$(INST_COREDIR)" \
-machine:$(PROCESSOR_ARCHITECTURE)
+LIB_FLAGS = -nologo
OBJOUT_FLAG = -Fo
EXEOUT_FLAG = -Fe
# makedef.pl must be updated if this changes, and this should normally
# only change when there is an incompatible revision of the public API.
PERLIMPLIB = ..\perl59.lib
+PERLSTATICLIB = ..\perl59s.lib
PERLDLL = ..\perl59.dll
MINIPERL = ..\miniperl.exe
MINIDIR = .\mini
PERLEXE = ..\perl.exe
WPERLEXE = ..\wperl.exe
+PERLEXESTATIC = ..\perl-static.exe
GLOBEXE = ..\perlglob.exe
CONFIGPM = ..\lib\Config.pm ..\lib\Config_heavy.pl
MINIMOD = ..\lib\ExtUtils\Miniperl.pm
X2P = ..\x2p\a2p.exe
+!IF "$(BUILD_STATIC)" == "define"
+PERLSTATIC = static
+!ELSE
+PERLSTATIC =
+!ENDIF
# Unicode data files generated by mktables
FIRSTUNIFILE = ..\lib\unicore\Canonical.pl
PERLDLL_OBJ = $(CORE_OBJ)
PERLEXE_OBJ = perlmain$(o)
+PERLEXEST_OBJ = perlmainst$(o)
PERLDLL_OBJ = $(PERLDLL_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
-#PERLEXE_OBJ = $(PERLEXE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
!IF "$(USE_SETARGV)" != ""
SETARGV_OBJ = setargv$(o)
!ENDIF
# specify static extensions here
-#STATIC_EXT = Cwd Compress/Zlib
+#STATIC_EXT = Cwd Compress/Raw/Zlib
STATIC_EXT =
DYNALOADER = $(EXTDIR)\DynaLoader\DynaLoader
#
all : .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(UNIDATAFILES) $(PERLEXE) \
- $(X2P) MakePPPort Extensions
+ $(X2P) MakePPPort Extensions $(PERLSTATIC)
@echo Everything is up to date. '$(MAKE_BARE) test' to run test suite.
..\regnodes.h : ..\regcomp.sym
$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
+static: $(PERLEXESTATIC)
+
#------------------------------------------------------------
$(GLOBEXE) : perlglob$(o)
$(EMBED_DLL_MANI)
$(XCOPY) $(PERLIMPLIB) $(COREDIR)
+$(PERLSTATICLIB): Extensions_static
+ $(LIB32) $(LIB_FLAGS) -out:$@ @Extensions_static @<<
+ $(PERLDLL_OBJ)
+<<
+ $(XCOPY) $(PERLSTATICLIB) $(COREDIR)
+
$(PERLEXE_ICO): $(MINIPERL) makeico.pl
$(MINIPERL) makeico.pl > $@
perlmain$(o) : perlmain.c
$(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c
+perlmainst.c : runperl.c
+ copy runperl.c perlmainst.c
+
+perlmainst$(o) : perlmainst.c
+ $(CC) $(CFLAGS_O) -DPERLDLL $(OBJOUT_FLAG)$@ -c perlmainst.c
+
$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES)
$(LINK32) -subsystem:console -out:$@ -stack:0x1000000 $(LINK_FLAGS) \
$(LIBFILES) $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES)
copy splittree.pl ..
$(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
+$(PERLEXESTATIC): $(PERLSTATICLIB) $(CONFIGPM) $(PERLEXEST_OBJ) $(PERLEXE_RES)
+ $(LINK32) -subsystem:console -out:$@ -stack:0x1000000 $(LINK_FLAGS) \
+ @Extensions_static $(PERLSTATICLIB) \
+ $(LIBFILES) $(PERLEXEST_OBJ) $(SETARGV_OBJ) $(PERLEXE_RES)
+ $(EMBED_EXE_MANI)
+
$(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
if not exist $(AUTODIR) mkdir $(AUTODIR)
cd $(EXTDIR)\$(*B)
$(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --dynamic +re
$(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic +re
-Extensions_static : buildext.pl
+Extensions_static : MakePPPort buildext.pl
$(XCOPY) ..\*.h $(COREDIR)\*.*
$(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --static
$(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --static
distclean: realclean
-del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
- $(PERLIMPLIB) ..\miniperl.lib $(MINIMOD)
+ $(PERLIMPLIB) ..\miniperl.lib $(MINIMOD) \
+ $(PERLEXESTATIC) $(PERLSTATICLIB)
-del /f *.def *.map
-del /f $(EXTENSION_DLL)
-del /f $(EXTENSION_C) $(DYNALOADER).c $(ERRNO).pm
perldoc perlivp dprofpp libnetcfg enc2xs piconv cpan *.bat \
xsubpp instmodsh prove ptar ptardiff shasum corelist config_data
-cd ..\x2p && del /f find2perl s2p psed *.bat
- -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
+ -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new \
+ perlmainst.c
-del /f $(CONFIGPM)
-del /f bin\*.bat
-del /f perllibst.h
-@$(DEL) $(MINIPERL)
-@$(DEL) perlglob$(o)
-@$(DEL) perlmain$(o)
+ -@$(DEL) perlmainst$(o)
-@$(DEL) config.w32
-@$(DEL) config.h
-@$(DEL) $(GLOBEXE)
-@$(DEL) $(PERLEXE)
-@$(DEL) $(WPERLEXE)
+ -@$(DEL) $(PERLEXESTATIC)
+ -@$(DEL) $(PERLSTATICLIB)
-@$(DEL) $(PERLDLL)
-@$(DEL) $(CORE_OBJ)
-if exist $(MINIDIR) rmdir /s /q $(MINIDIR)