diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2018-05-10 14:00:14 -0400 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2018-07-17 08:23:05 +0100 |
commit | 19d5c34a588f26b17caef75ec78b0754d71da212 (patch) | |
tree | c6c5b4a1930536247d0dde45f4c443359750f99d /win32 | |
parent | d29fa84aee8bfff9c27f68ec2d9292e1370e0924 (diff) | |
download | perl-19d5c34a588f26b17caef75ec78b0754d71da212.tar.gz |
win32/Makefile: put mini config.h in correct place in dep tree
I fixed this for GNUMakefile and makefile.mk when I added the parallel
building feature to those 2 but I left nmake unfixed. Now fix it. This
commit allow a "nmake CCTYPE=MSVC90 av.obj" or
"nmake CCTYPE=MSVC90 mini/av.obj" or other individual build product
targets to work on a cleaned src tree, while previously you'd get with
the above commands
cl -c -nologo -GF -W3 -I..\lib\CORE -I.\include -I. -I.. -DWIN32
-D_CONSOLE -DNO_STRICT -D_CRT_SECURE_NO_DEPRECATE
-D_CRT_NONSTDC_NO_DEPRECATE -DPERLDLL -DPERL_CORE -O1 -MD -Zi -DNDEBUG
-GL -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL -Fo.\mini\av.obj ..\av.c
av.c
c:\p525\src\perl.h(28) : fatal error C1083: Cannot open include file:
'config.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 12.0
\VC\BIN\cl.EXE"' : return code '0x2'
Basically, "all" was the only target that worked on a clean src tree with
the nmake makefile previously. Also collapse the catting recipies into
single lines to speed up the mini config.h generation through less proc
starts of cmd.exe by nmake.exe. This reduces the mini config.h target time,
see timings in ticket associated with this comit. Also sync the sentinal
command (.exists) between all 3 mkfs for less diff-ness between the 3
mkfs (debugging aid).
Diffstat (limited to 'win32')
-rw-r--r-- | win32/GNUmakefile | 2 | ||||
-rw-r--r-- | win32/Makefile | 226 | ||||
-rw-r--r-- | win32/makefile.mk | 2 |
3 files changed, 117 insertions, 113 deletions
diff --git a/win32/GNUmakefile b/win32/GNUmakefile index 9384120d8e..a5164a4a08 100644 --- a/win32/GNUmakefile +++ b/win32/GNUmakefile @@ -1449,7 +1449,7 @@ else echo #endif)>> config.h endif #separate line since this is sentinal that this target is done - rem. > $(MINIDIR)\.exists + @rem. > $(MINIDIR)\.exists $(MINICORE_OBJ) : $(CORE_NOCFG_H) $(CC) -c $(CFLAGS) $(MINIBUILDOPT) -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL $(OBJOUT_FLAG)$@ $(PDBOUT) ..\$(*F).c diff --git a/win32/Makefile b/win32/Makefile index 2b13545484..0b187fc98b 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -758,6 +758,7 @@ MAKE_BARE = nmake CFGSH_TMPL = config.vc CFGH_TMPL = config_H.vc +INT64 = __int64 XCOPY = xcopy /f /r /i /d /y RCOPY = xcopy /f /r /i /e /d /y @@ -938,7 +939,7 @@ CFG_VARS = \ # Top targets # -all : .\config.h ..\git_version.h $(GLOBEXE) $(CONFIGPM) \ +all : ..\git_version.h $(GLOBEXE) $(CONFIGPM) \ $(UNIDATAFILES) MakePPPort $(PERLEXE) Extensions_nonxs Extensions PostExt \ $(PERLSTATIC) @echo Everything is up to date. '$(MAKE_BARE) test' to run test suite. @@ -964,112 +965,6 @@ $(GLOBEXE) : perlglob$(o) perlglob$(o) : perlglob.c -# -# Copy the template config.h and set configurables at the end of it -# as per the options chosen and compiler used. -# Note: This config.h is only used to build miniperl.exe anyway, but -# it's as well to have its options correct to be sure that it builds -# and so that it's "-V" options are correct for use by makedef.pl. The -# real config.h used to build perl.exe is generated from the top-level -# config_h.SH by config_h.PL (run by miniperl.exe). -# -.\config.h : $(CFGH_TMPL) - -del /f config.h - copy $(CFGH_TMPL) config.h - @echo.>>$@ - @echo #ifndef _config_h_footer_>>$@ - @echo #define _config_h_footer_>>$@ -!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" - @echo #undef FILE_ptr>>$@ - @echo #define FILE_ptr(fp) PERLIO_FILE_ptr(fp)>>$@ - @echo #undef FILE_cnt>>$@ - @echo #define FILE_cnt(fp) PERLIO_FILE_cnt(fp)>>$@ - @echo #undef FILE_base>>$@ - @echo #define FILE_base(fp) PERLIO_FILE_base(fp)>>$@ - @echo #undef FILE_bufsiz>>$@ - @echo #define FILE_bufsiz(fp) (PERLIO_FILE_cnt(fp) + PERLIO_FILE_ptr(fp) - PERLIO_FILE_base(fp))>>$@ - @echo #define I_STDBOOL>>$@ -!ENDIF - @echo #undef Off_t>>$@ - @echo #undef LSEEKSIZE>>$@ - @echo #undef Off_t_size>>$@ - @echo #undef PTRSIZE>>$@ - @echo #undef SSize_t>>$@ - @echo #undef HAS_ATOLL>>$@ - @echo #undef HAS_STRTOLL>>$@ - @echo #undef HAS_STRTOULL>>$@ - @echo #undef IVTYPE>>$@ - @echo #undef UVTYPE>>$@ - @echo #undef IVSIZE>>$@ - @echo #undef UVSIZE>>$@ - @echo #undef NV_PRESERVES_UV>>$@ - @echo #undef NV_PRESERVES_UV_BITS>>$@ - @echo #undef IVdf>>$@ - @echo #undef UVuf>>$@ - @echo #undef UVof>>$@ - @echo #undef UVxf>>$@ - @echo #undef UVXf>>$@ - @echo #undef USE_64_BIT_INT>>$@ - @echo #undef Size_t_size>>$@ - @echo #undef USE_CPLUSPLUS>>$@ -!IF "$(USE_LARGE_FILES)"=="define" - @echo #define Off_t __int64>>$@ - @echo #define LSEEKSIZE ^8>>$@ - @echo #define Off_t_size ^8>>$@ -!ELSE - @echo #define Off_t long>>$@ - @echo #define LSEEKSIZE ^4>>$@ - @echo #define Off_t_size ^4>>$@ -!ENDIF -!IF "$(WIN64)"=="define" - @echo #define PTRSIZE ^8>>$@ - @echo #define SSize_t __int64>>$@ - @echo #define HAS_ATOLL>>$@ - @echo #define HAS_STRTOLL>>$@ - @echo #define HAS_STRTOULL>>$@ - @echo #define Size_t_size ^8>>$@ -!ELSE - @echo #define PTRSIZE ^4>>$@ - @echo #define SSize_t int>>$@ - @echo #undef HAS_ATOLL>>$@ - @echo #undef HAS_STRTOLL>>$@ - @echo #undef HAS_STRTOULL>>$@ - @echo #define Size_t_size ^4>>$@ -!ENDIF -!IF "$(USE_64_BIT_INT)"=="define" - @echo #define IVTYPE __int64>>$@ - @echo #define UVTYPE unsigned __int64>>$@ - @echo #define IVSIZE ^8>>$@ - @echo #define UVSIZE ^8>>$@ - @echo #undef NV_PRESERVES_UV>>$@ - @echo #define NV_PRESERVES_UV_BITS 53>>$@ - @echo #define IVdf "I64d">>$@ - @echo #define UVuf "I64u">>$@ - @echo #define UVof "I64o">>$@ - @echo #define UVxf "I64x">>$@ - @echo #define UVXf "I64X">>$@ - @echo #define USE_64_BIT_INT>>$@ -!ELSE - @echo #define IVTYPE long>>$@ - @echo #define UVTYPE unsigned long>>$@ - @echo #define IVSIZE ^4>>$@ - @echo #define UVSIZE ^4>>$@ - @echo #define NV_PRESERVES_UV>>$@ - @echo #define NV_PRESERVES_UV_BITS 32>>$@ - @echo #define IVdf "ld">>$@ - @echo #define UVuf "lu">>$@ - @echo #define UVof "lo">>$@ - @echo #define UVxf "lx">>$@ - @echo #define UVXf "lX">>$@ - @echo #undef USE_64_BIT_INT>>$@ -!ENDIF -!IF "$(USE_CPLUSPLUS)"=="define" - @echo #define USE_CPLUSPLUS>>$@ -!ELSE - @echo #undef USE_CPLUSPLUS>>$@ -!ENDIF - @echo #endif>>$@ - ..\git_version.h : $(MINIPERL) ..\make_patchnum.pl cd .. && miniperl -Ilib make_patchnum.pl && cd win32 @@ -1098,18 +993,127 @@ $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL -$(MINIPERL) -I..\lib config_h.PL if errorlevel 1 $(MAKE) /$(MAKEFLAGS) $(CONFIGPM) +.\config.h : $(CONFIGPM) + # See the comment in Makefile.SH explaining this seemingly cranky ordering -$(MINIPERL) : ..\lib\buildcustomize.pl +$(MINIPERL) : ..\lib\buildcustomize.pl -..\lib\buildcustomize.pl : $(MINIDIR) $(MINI_OBJ) ..\write_buildcustomize.pl +..\lib\buildcustomize.pl : $(MINI_OBJ) ..\write_buildcustomize.pl $(LINK32) -out:$(MINIPERL) @<< $(BLINK_FLAGS) $(DELAYLOAD) $(MINIDELAYLOAD) $(LIBFILES) $(MINI_OBJ) << $(EMBED_EXE_MANI:..\lib\buildcustomize.pl=..\miniperl.exe) $(MINIPERL) -I..\lib -f ..\write_buildcustomize.pl .. -$(MINIDIR) : +$(MINIDIR)\.exists : $(CFGH_TMPL) if not exist "$(MINIDIR)" mkdir "$(MINIDIR)" +# +# Copy the template config.h and set configurables at the end of it +# as per the options chosen and compiler used. +# Note: This config.h is only used to build miniperl.exe anyway, but +# it's as well to have its options correct to be sure that it builds +# and so that it's "-V" options are correct for use by makedef.pl. The +# real config.h used to build perl.exe is generated from the top-level +# config_h.SH by config_h.PL (run by miniperl.exe). +# + copy $(CFGH_TMPL) config.h + @(echo.&& \ + echo #ifndef _config_h_footer_&& \ + echo #define _config_h_footer_&& \ + echo #undef Off_t&& \ + echo #undef LSEEKSIZE&& \ + echo #undef Off_t_size&& \ + echo #undef PTRSIZE&& \ + echo #undef SSize_t&& \ + echo #undef HAS_ATOLL&& \ + echo #undef HAS_STRTOLL&& \ + echo #undef HAS_STRTOULL&& \ + echo #undef Size_t_size&& \ + echo #undef IVTYPE&& \ + echo #undef UVTYPE&& \ + echo #undef IVSIZE&& \ + echo #undef UVSIZE&& \ + echo #undef NV_PRESERVES_UV&& \ + echo #undef NV_PRESERVES_UV_BITS&& \ + echo #undef IVdf&& \ + echo #undef UVuf&& \ + echo #undef UVof&& \ + echo #undef UVxf&& \ + echo #undef UVXf&& \ + echo #undef USE_64_BIT_INT&& \ + echo #undef USE_LONG_DOUBLE&& \ + echo #undef USE_CPLUSPLUS)>> config.h +!IF "$(CCTYPE)" == "MSVC140" || "$(CCTYPE)" == "MSVC141" + @(echo #undef FILE_ptr&& \ + echo #undef FILE_cnt&& \ + echo #undef FILE_base&& \ + echo #undef FILE_bufsiz&& \ + echo #define FILE_ptr^(fp^) PERLIO_FILE_ptr^(fp^)&& \ + echo #define FILE_cnt^(fp^) PERLIO_FILE_cnt^(fp^)&& \ + echo #define FILE_base^(fp^) PERLIO_FILE_base^(fp^)&& \ + echo #define FILE_bufsiz^(fp^) ^(PERLIO_FILE_cnt^(fp^) + PERLIO_FILE_ptr^(fp^) - PERLIO_FILE_base^(fp^)^)&& \ + echo #define I_STDBOOL)>> config.h +!ENDIF +!IF "$(USE_LARGE_FILES)"=="define" + @(echo #define Off_t $(INT64)&& \ + echo #define LSEEKSIZE ^8&& \ + echo #define Off_t_size ^8)>> config.h +!ELSE + @(echo #define Off_t long&& \ + echo #define LSEEKSIZE ^4&& \ + echo #define Off_t_size ^4)>> config.h +!ENDIF +!IF "$(WIN64)"=="define" + @(echo #define PTRSIZE ^8&& \ + echo #define SSize_t $(INT64)&& \ + echo #define HAS_ATOLL&& \ + echo #define HAS_STRTOLL&& \ + echo #define HAS_STRTOULL&& \ + echo #define Size_t_size ^8)>> config.h +!ELSE + @(echo #define PTRSIZE ^4&& \ + echo #define SSize_t int&& \ + echo #undef HAS_ATOLL&& \ + echo #undef HAS_STRTOLL&& \ + echo #undef HAS_STRTOULL&& \ + echo #define Size_t_size ^4)>> config.h +!ENDIF +!IF "$(USE_64_BIT_INT)"=="define" + @(echo #define IVTYPE $(INT64)&& \ + echo #define UVTYPE unsigned $(INT64)&& \ + echo #define IVSIZE ^8&& \ + echo #define UVSIZE ^8&& \ + echo #undef NV_PRESERVES_UV&& \ + echo #define NV_PRESERVES_UV_BITS 53&& \ + echo #define IVdf "I64d"&& \ + echo #define UVuf "I64u"&& \ + echo #define UVof "I64o"&& \ + echo #define UVxf "I64x"&& \ + echo #define UVXf "I64X"&& \ + echo #define USE_64_BIT_INT)>> config.h +!ELSE + @(echo #define IVTYPE long&& \ + echo #define UVTYPE unsigned long&& \ + echo #define IVSIZE ^4&& \ + echo #define UVSIZE ^4&& \ + echo #define NV_PRESERVES_UV&& \ + echo #define NV_PRESERVES_UV_BITS 32&& \ + echo #define IVdf "ld"&& \ + echo #define UVuf "lu"&& \ + echo #define UVof "lo"&& \ + echo #define UVxf "lx"&& \ + echo #define UVXf "lX"&& \ + echo #undef USE_64_BIT_INT)>> config.h +!ENDIF +!IF "$(USE_CPLUSPLUS)"=="define" + @(echo #define USE_CPLUSPLUS&& \ + echo #endif)>> config.h +!ELSE + @(echo #undef USE_CPLUSPLUS&& \ + echo #endif)>> config.h +!ENDIF +#separate line since this is sentinal that this target is done + @rem. > $(MINIDIR)\.exists $(MINICORE_OBJ) : $(CORE_NOCFG_H) $(CC) -c $(CFLAGS) -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL $(OBJOUT_FLAG)$@ ..\$(*F).c @@ -1127,7 +1131,7 @@ perllib$(o) : perllib.c .\perlhost.h .\vdir.h .\vmem.h # 1. we don't want to rebuild miniperl.exe when config.h changes # 2. we don't want to rebuild miniperl.exe with non-default config.h # 3. we can't have miniperl.exe depend on git_version.h, as miniperl creates it -$(MINI_OBJ) : $(CORE_NOCFG_H) +$(MINI_OBJ) : $(MINIDIR)\.exists $(CORE_NOCFG_H) $(WIN32_OBJ) : $(CORE_H) $(CORE_OBJ) : $(CORE_H) diff --git a/win32/makefile.mk b/win32/makefile.mk index 293abf9ed9..4ddaa16f1c 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -1391,7 +1391,7 @@ $(MINIDIR)\.exists : $(CFGH_TMPL) echo #endif)>> config.h .ENDIF #separate line since this is sentinal that this target is done - rem. > $(MINIDIR)\.exists + @rem. > $(MINIDIR)\.exists $(MINICORE_OBJ) : $(CORE_NOCFG_H) $(CC) -c $(CFLAGS) $(MINIBUILDOPT) -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL $(OBJOUT_FLAG)$@ $(PDBOUT) ..\$(*B).c |