This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
win32/GNUmakefile collapse shell echos into one liners
authorDaniel Dragan <bulk88@hotmail.com>
Mon, 4 Jan 2016 19:20:14 +0000 (14:20 -0500)
committerTony Cook <tony@develop-help.com>
Mon, 25 Jan 2016 00:13:28 +0000 (11:13 +1100)
Previously each line was 1 shell process launch. By grouping all the echos
together, CPU and IO are saved by doing alot less cmd.exe process launches.
makefile.mk does the same thing already. See #126632 for benchmark details.

win32/GNUmakefile

index 06322c8..ecd25de 100644 (file)
@@ -1171,152 +1171,158 @@ $(MINIDIR)\.exists : $(CFGH_TMPL)
 # MINIDIR generates config.h so miniperl.exe is not rebuilt when the 2nd
 # config.h is generated in CONFIGPM target, see also the comments for $(MINI_OBJ).
        copy $(CFGH_TMPL) config.h
-       @echo.>> config.h
-       @echo #ifndef _config_h_footer_>> config.h
-       @echo #define _config_h_footer_>> config.h
-       @echo #undef Off_t>> config.h
-       @echo #undef LSEEKSIZE>> config.h
-       @echo #undef Off_t_size>> config.h
-       @echo #undef PTRSIZE>> config.h
-       @echo #undef SSize_t>> config.h
-       @echo #undef HAS_ATOLL>> config.h
-       @echo #undef HAS_STRTOLL>> config.h
-       @echo #undef HAS_STRTOULL>> config.h
-       @echo #undef Size_t_size>> config.h
-       @echo #undef IVTYPE>> config.h
-       @echo #undef UVTYPE>> config.h
-       @echo #undef IVSIZE>> config.h
-       @echo #undef UVSIZE>> config.h
-       @echo #undef NV_PRESERVES_UV>> config.h
-       @echo #undef NV_PRESERVES_UV_BITS>> config.h
-       @echo #undef IVdf>> config.h
-       @echo #undef UVuf>> config.h
-       @echo #undef UVof>> config.h
-       @echo #undef UVxf>> config.h
-       @echo #undef UVXf>> config.h
-       @echo #undef USE_64_BIT_INT>> config.h
-       @echo #undef Gconvert>> config.h
-       @echo #undef HAS_FREXPL>> config.h
-       @echo #undef HAS_ISNANL>> config.h
-       @echo #undef HAS_MODFL>> config.h
-       @echo #undef HAS_MODFL_PROTO>> config.h
-       @echo #undef HAS_SQRTL>> config.h
-       @echo #undef HAS_STRTOLD>> config.h
-       @echo #undef PERL_PRIfldbl>> config.h
-       @echo #undef PERL_PRIgldbl>> config.h
-       @echo #undef PERL_PRIeldbl>> config.h
-       @echo #undef PERL_SCNfldbl>> config.h
-       @echo #undef NVTYPE>> config.h
-       @echo #undef NVSIZE>> config.h
-       @echo #undef LONG_DOUBLESIZE>> config.h
-       @echo #undef NV_OVERFLOWS_INTEGERS_AT>> config.h
-       @echo #undef NVef>> config.h
-       @echo #undef NVff>> config.h
-       @echo #undef NVgf>> config.h
-       @echo #undef USE_LONG_DOUBLE>> 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 Gconvert&& \
+       echo #undef HAS_FREXPL&& \
+       echo #undef HAS_ISNANL&& \
+       echo #undef HAS_MODFL&& \
+       echo #undef HAS_MODFL_PROTO&& \
+       echo #undef HAS_SQRTL&& \
+       echo #undef HAS_STRTOLD&& \
+       echo #undef PERL_PRIfldbl&& \
+       echo #undef PERL_PRIgldbl&& \
+       echo #undef PERL_PRIeldbl&& \
+       echo #undef PERL_SCNfldbl&& \
+       echo #undef NVTYPE&& \
+       echo #undef NVSIZE&& \
+       echo #undef LONG_DOUBLESIZE&& \
+       echo #undef NV_OVERFLOWS_INTEGERS_AT&& \
+       echo #undef NVef&& \
+       echo #undef NVff&& \
+       echo #undef NVgf&& \
+       echo #undef USE_LONG_DOUBLE)>> config.h
 ifeq ($(USE_LARGE_FILES),define)
-       @echo #define Off_t $(INT64)>> config.h
-       @echo #define LSEEKSIZE ^8>> config.h
-       @echo #define Off_t_size ^8>> config.h
+       @(echo #define Off_t $(INT64)&& \
+       echo #define LSEEKSIZE ^8&& \
+       echo #define Off_t_size ^8)>> config.h
 else
-       @echo #define Off_t long>> config.h
-       @echo #define LSEEKSIZE ^4>> config.h
-       @echo #define Off_t_size ^4>> config.h
+       @(echo #define Off_t long&& \
+       echo #define LSEEKSIZE ^4&& \
+       echo #define Off_t_size ^4)>> config.h
 endif
 ifeq ($(WIN64),define)
-       @echo #define PTRSIZE ^8>> config.h
-       @echo #define SSize_t $(INT64)>> config.h
-       @echo #define HAS_ATOLL>> config.h
-       @echo #define HAS_STRTOLL>> config.h
-       @echo #define HAS_STRTOULL>> config.h
-       @echo #define Size_t_size ^8>> config.h
+       @(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>> config.h
-       @echo #define SSize_t int>> config.h
-       @echo #undef HAS_ATOLL>> config.h
-       @echo #undef HAS_STRTOLL>> config.h
-       @echo #undef HAS_STRTOULL>> config.h
-       @echo #define Size_t_size ^4>> config.h
+       @(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
 ifeq ($(USE_64_BIT_INT),define)
-       @echo #define IVTYPE $(INT64)>> config.h
-       @echo #define UVTYPE unsigned $(INT64)>> config.h
-       @echo #define IVSIZE ^8>> config.h
-       @echo #define UVSIZE ^8>> config.h
+       @(echo #define IVTYPE $(INT64)&& \
+       echo #define UVTYPE unsigned $(INT64)&& \
+       echo #define IVSIZE ^8&& \
+       echo #define UVSIZE ^8)>> config.h
 ifeq ($(USE_LONG_DOUBLE),define)
-       @echo #define NV_PRESERVES_UV>> config.h
-       @echo #define NV_PRESERVES_UV_BITS 64>> config.h
+       @(echo #define NV_PRESERVES_UV&& \
+       echo #define NV_PRESERVES_UV_BITS 64)>> config.h
 else
-       @echo #undef NV_PRESERVES_UV>> config.h
-       @echo #define NV_PRESERVES_UV_BITS 53>> config.h
-endif
-       @echo #define IVdf "I64d">> config.h
-       @echo #define UVuf "I64u">> config.h
-       @echo #define UVof "I64o">> config.h
-       @echo #define UVxf "I64x">> config.h
-       @echo #define UVXf "I64X">> config.h
-       @echo #define USE_64_BIT_INT>> config.h
+       @(echo #undef NV_PRESERVES_UV&& \
+       echo #define NV_PRESERVES_UV_BITS 53)>> config.h
+endif
+       @(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>> config.h
-       @echo #define UVTYPE unsigned long>> config.h
-       @echo #define IVSIZE ^4>> config.h
-       @echo #define UVSIZE ^4>> config.h
-       @echo #define NV_PRESERVES_UV>> config.h
-       @echo #define NV_PRESERVES_UV_BITS 32>> config.h
-       @echo #define IVdf "ld">> config.h
-       @echo #define UVuf "lu">> config.h
-       @echo #define UVof "lo">> config.h
-       @echo #define UVxf "lx">> config.h
-       @echo #define UVXf "lX">> config.h
-       @echo #undef USE_64_BIT_INT>> config.h
+       @(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
 ifeq ($(USE_LONG_DOUBLE),define)
-       @echo #define Gconvert(x,n,t,b) sprintf((b),"%%.*""Lg",(n),(x))>> config.h
-       @echo #define HAS_FREXPL>> config.h
-       @echo #define HAS_ISNANL>> config.h
-       @echo #define HAS_MODFL>> config.h
-       @echo #define HAS_MODFL_PROTO>> config.h
-       @echo #define HAS_SQRTL>> config.h
-       @echo #define HAS_STRTOLD>> config.h
-       @echo #define PERL_PRIfldbl "Lf">> config.h
-       @echo #define PERL_PRIgldbl "Lg">> config.h
-       @echo #define PERL_PRIeldbl "Le">> config.h
-       @echo #define PERL_SCNfldbl "Lf">> config.h
-       @echo #define NVTYPE long double>> config.h
+       @(echo #define Gconvert^(x,n,t,b^) sprintf^(^(b^),"%%.*""Lg",^(n^),^(x^)^)&& \
+       echo #define HAS_FREXPL&& \
+       echo #define HAS_ISNANL&& \
+       echo #define HAS_MODFL&& \
+       echo #define HAS_MODFL_PROTO&& \
+       echo #define HAS_SQRTL&& \
+       echo #define HAS_STRTOLD&& \
+       echo #define PERL_PRIfldbl "Lf"&& \
+       echo #define PERL_PRIgldbl "Lg"&& \
+       echo #define PERL_PRIeldbl "Le"&& \
+       echo #define PERL_SCNfldbl "Lf"&& \
+       echo #define NVTYPE long double)>> config.h
 ifeq ($(WIN64),define)
-       @echo #define NVSIZE ^16>> config.h
-       @echo #define LONG_DOUBLESIZE ^16>> config.h
+       @(echo #define NVSIZE ^16&& \
+       echo #define LONG_DOUBLESIZE ^16)>> config.h
 else
-       @echo #define NVSIZE ^12>> config.h
-       @echo #define LONG_DOUBLESIZE ^12>> config.h
-endif
-       @echo #define NV_OVERFLOWS_INTEGERS_AT 256.0*256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0*2.0*2.0*2.0>> config.h
-       @echo #define NVef "Le">> config.h
-       @echo #define NVff "Lf">> config.h
-       @echo #define NVgf "Lg">> config.h
-       @echo #define USE_LONG_DOUBLE>> config.h
+       @(echo #define NVSIZE ^12&& \
+       echo #define LONG_DOUBLESIZE ^12)>> config.h
+endif
+       @(echo #define NV_OVERFLOWS_INTEGERS_AT 256.0*256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0*2.0*2.0*2.0&& \
+       echo #define NVef "Le"&& \
+       echo #define NVff "Lf"&& \
+       echo #define NVgf "Lg"&& \
+       echo #define USE_LONG_DOUBLE)>> config.h
 else
-       @echo #define Gconvert(x,n,t,b) sprintf((b),"%%.*g",(n),(x))>> config.h
-       @echo #undef HAS_FREXPL>> config.h
-       @echo #undef HAS_ISNANL>> config.h
-       @echo #undef HAS_MODFL>> config.h
-       @echo #undef HAS_MODFL_PROTO>> config.h
-       @echo #undef HAS_SQRTL>> config.h
-       @echo #undef HAS_STRTOLD>> config.h
-       @echo #undef PERL_PRIfldbl>> config.h
-       @echo #undef PERL_PRIgldbl>> config.h
-       @echo #undef PERL_PRIeldbl>> config.h
-       @echo #undef PERL_SCNfldbl>> config.h
-       @echo #define NVTYPE double>> config.h
-       @echo #define NVSIZE ^8>> config.h
-       @echo #define LONG_DOUBLESIZE ^8>> config.h
-       @echo #define NV_OVERFLOWS_INTEGERS_AT 256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0>> config.h
-       @echo #define NVef "e">> config.h
-       @echo #define NVff "f">> config.h
-       @echo #define NVgf "g">> config.h
-       @echo #undef USE_LONG_DOUBLE>> config.h
-endif
-       @echo #endif>> config.h
+       @(echo #define Gconvert^(x,n,t,b^) sprintf^(^(b^),"%%.*g",^(n^),^(x^)^)&& \
+       echo #undef HAS_FREXPL&& \
+       echo #undef HAS_ISNANL&& \
+       echo #undef HAS_MODFL&& \
+       echo #undef HAS_MODFL_PROTO&& \
+       echo #undef HAS_SQRTL&& \
+       echo #undef HAS_STRTOLD&& \
+       echo #undef PERL_PRIfldbl&& \
+       echo #undef PERL_PRIgldbl&& \
+       echo #undef PERL_PRIeldbl&& \
+       echo #undef PERL_SCNfldbl&& \
+       echo #define NVTYPE double&& \
+       echo #define NVSIZE ^8&& \
+       echo #define LONG_DOUBLESIZE ^8&& \
+       echo #define NV_OVERFLOWS_INTEGERS_AT 256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0&& \
+       echo #define NVef "e"&& \
+       echo #define NVff "f"&& \
+       echo #define NVgf "g"&& \
+       echo #undef USE_LONG_DOUBLE)>> config.h
+endif
+ifeq ($(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