summaryrefslogtreecommitdiff
path: root/win32/makefile.mk
diff options
context:
space:
mode:
Diffstat (limited to 'win32/makefile.mk')
-rw-r--r--win32/makefile.mk93
1 files changed, 64 insertions, 29 deletions
diff --git a/win32/makefile.mk b/win32/makefile.mk
index 5aceb31794..d027ce5b2d 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -17,7 +17,7 @@ INST_TOP *= $(INST_DRV)\perl5004.5x
#
# uncomment to enable threads-capabilities
-#USE_THREADS *= -DUSE_THREADS
+USE_THREADS *= define
#
# uncomment one
@@ -45,6 +45,13 @@ CCTYPE *= BORLAND
#CRYPT_LIB *= des_fcrypt.lib
#
+# set this if you wish to use perl's malloc
+# WARNING: Turning this on/off WILL break binary compatibility with extensions
+# you may have compiled with/without it. Be prepared to recompile all extensions
+# if you change the default.
+PERL_MALLOC *= define
+
+#
# set the install locations of the compiler include/libraries
#CCHOME *= f:\msdev\vc
CCHOME *= C:\bc5
@@ -71,19 +78,26 @@ D_CRYPT=define
CRYPT_FLAG=-DHAVE_DES_FCRYPT
.ENDIF
-BUILDOPT *= $(USE_THREADS)
-#BUILDOPT *= $(USE_THREADS) -DMULTIPLICITY
-#BUILDOPT *= $(USE_THREADS) -DPERL_GLOBAL_STRUCT -DMULTIPLICITY
+.IF "$(PERL_MALLOC)" == ""
+PERL_MALLOC *= undef
+.ENDIF
+
+#BUILDOPT *= -DMULTIPLICITY
+#BUILDOPT *= -DPERL_GLOBAL_STRUCT -DMULTIPLICITY
# -DUSE_PERLIO -D__STDC__=1 -DUSE_SFIO -DI_SFIO -I\sfio97\include
+.IF "$(USE_THREADS)" == ""
+USE_THREADS = undef
+.ENDIF
+
.IMPORT .IGNORE : PROCESSOR_ARCHITECTURE
PROCESSOR_ARCHITECTURE *= x86
-.IF "$(USE_THREADS)" == ""
-ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)
-.ELSE
+.IF "$(USE_THREADS)" == "define"
ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-thread
+.ELSE
+ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)
.ENDIF
ARCHDIR = ..\lib\$(ARCHNAME)
@@ -296,7 +310,6 @@ CFGH_TMPL = config_H.gc
.ELSE
-MAKE = nmake -nologo
CFGSH_TMPL = config.vc
CFGH_TMPL = config_H.vc
PERL95EXE=..\perl95.exe
@@ -312,12 +325,18 @@ NOOP=@echo
CRYPT_OBJ=$(CRYPT_SRC:db:+$(o))
.ENDIF
+.IF "$(PERL_MALLOC)" == "define"
+MALLOC_SRC = ..\malloc.c
+MALLOC_OBJ = ..\malloc$(o)
+.ENDIF
+
#
# filenames given to xsubpp must have forward slashes (since it puts
# full pathnames in #line strings)
XSUBPP=..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp -C++ -prototypes
CORE_C= ..\av.c \
+ ..\byterun.c \
..\deb.c \
..\doio.c \
..\doop.c \
@@ -343,10 +362,11 @@ CORE_C= ..\av.c \
..\toke.c \
..\universal.c \
..\util.c \
- ..\malloc.c \
+ $(MALLOC_SRC) \
$(CRYPT_SRC)
CORE_OBJ= ..\av$(o) \
+ ..\byterun$(o) \
..\deb$(o) \
..\doio$(o) \
..\doop$(o) \
@@ -372,7 +392,7 @@ CORE_OBJ= ..\av$(o) \
..\toke$(o) \
..\universal$(o)\
..\util$(o) \
- ..\malloc$(o) \
+ $(MALLOC_OBJ) \
$(CRYPT_OBJ)
WIN32_C = perllib.c \
@@ -398,6 +418,8 @@ X2P_OBJ = ..\x2p\a2p$(o) \
..\x2p\walk$(o)
CORE_H = ..\av.h \
+ ..\byterun.h \
+ ..\bytecode.h \
..\cop.h \
..\cv.h \
..\dosish.h \
@@ -472,6 +494,24 @@ POD2MAN=$(PODDIR)\pod2man
POD2LATEX=$(PODDIR)\pod2latex
POD2TEXT=$(PODDIR)\pod2text
+CFG_VARS= "INST_DRV=$(INST_DRV)" \
+ "INST_TOP=$(INST_TOP)" \
+ "archname=$(ARCHNAME)" \
+ "cc=$(CC)" \
+ "ccflags=$(OPTIMIZE) $(DEFINES)" \
+ "cf_email=$(EMAIL)" \
+ "d_crypt=$(D_CRYPT)" \
+ "d_mymalloc=$(PERL_MALLOC)" \
+ "libs=$(LIBFILES:f)" \
+ "incpath=$(CCINCDIR)" \
+ "libpth=$(strip $(CCLIBDIR) $(LIBFILES:d))" \
+ "libc=$(LIBC)" \
+ "static_ext=$(STATIC_EXT)" \
+ "dynamic_ext=$(DYNAMIC_EXT)" \
+ "usethreads=$(USE_THREADS)" \
+ "LINK_FLAGS=$(LINK_FLAGS)" \
+ "optimize=$(OPTIMIZE)"
+
#
# Top targets
#
@@ -507,23 +547,19 @@ config.w32 : $(CFGSH_TMPL)
copy $(CFGH_TMPL) config.h
..\config.sh : config.w32 $(MINIPERL) config_sh.PL
- $(MINIPERL) -I..\lib config_sh.PL \
- "INST_DRV=$(INST_DRV)" \
- "INST_TOP=$(INST_TOP)" \
- "archname=$(ARCHNAME)" \
- "cc=$(CC)" \
- "ccflags=$(OPTIMIZE) $(DEFINES)" \
- "cf_email=$(EMAIL)" \
- "d_crypt=$(D_CRYPT)" \
- "libs=$(LIBFILES:f)" \
- "incpath=$(CCINCDIR)" \
- "libpth=$(strip $(CCLIBDIR) $(LIBFILES:d))" \
- "libc=$(LIBC)" \
- "static_ext=$(STATIC_EXT)" \
- "dynamic_ext=$(DYNAMIC_EXT)" \
- "LINK_FLAGS=$(LINK_FLAGS)" \
- "optimize=$(OPTIMIZE)" \
- config.w32 > ..\config.sh
+ $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) config.w32 > ..\config.sh
+
+# this target is for when changes to the main config.sh happen
+# edit config.{b,v,g}c and make this target once for each supported
+# compiler (e.g. `dmake CCTYPE=BORLAND regen_config_h`)
+regen_config_h:
+ perl config_sh.PL $(CFG_VARS) $(CFGSH_TMPL) > ..\config.sh
+ -cd .. && del /f perl.exe
+ cd .. && perl configpm
+ -del /f $(CFGH_TMPL)
+ -mkdir ..\lib\CORE
+ -perl -I..\lib config_h.PL
+ rename config.h $(CFGH_TMPL)
$(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
cd .. && miniperl configpm
@@ -531,8 +567,7 @@ $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
$(XCOPY) ..\*.h $(COREDIR)\*.*
$(XCOPY) *.h $(COREDIR)\*.*
$(RCOPY) include $(COREDIR)\*.*
- $(MINIPERL) -I..\lib config_h.PL || $(MAKE) CCTYPE=$(CCTYPE) \
- CFG=$(CFG) $(CONFIGPM)
+ $(MINIPERL) -I..\lib config_h.PL || $(MAKE) $(MAKEMACROS) $(CONFIGPM)
LKPRE = INPUT (
LKPOST = )