Avoid empty lines in nmake rule bodies
authorRichard Levitte <levitte@openssl.org>
Mon, 12 Jul 2021 05:26:36 +0000 (07:26 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 13 Jul 2021 08:05:44 +0000 (10:05 +0200)
nmake is tolerant of those empty lines, but jom isn't.  That tolerance
isn't standard make behaviour, so we lean towards avoiding them.

We simply use '@rem' instead.

Fixes #16014

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16047)

Configurations/windows-makefile.tmpl

index 9351149fe8e1b8e321eaa514b97a116f972da506..13716e06441dd2023ef562acb94bb0cde3f19c2b 100644 (file)
@@ -324,15 +324,15 @@ build_apps build_tests: build_programs
 # Convenience target to prebuild all generated files, not just the mandatory
 # ones
 build_all_generated: $(GENERATED_MANDATORY) $(GENERATED)
-       @{- output_off() if $disabled{makedepend}; "" -}
+       @{- output_off() if $disabled{makedepend}; "\@rem" -}
        @$(ECHO) "Warning: consider configuring with no-makedepend, because if"
        @$(ECHO) "         target system doesn't have $(PERL),"
        @$(ECHO) "         then make will fail..."
-       @{- output_on() if $disabled{makedepend}; "" -}
+       @{- output_on() if $disabled{makedepend}; "\@rem" -}
 
 test: tests
 {- dependmagic('tests'); -}: build_programs_nodep build_engines_nodep
-       @{- output_off() if $disabled{tests}; "" -}
+       @{- output_off() if $disabled{tests}; "\@rem" -}
        -mkdir $(BLDDIR)\test\test-runs
        set SRCTOP=$(SRCDIR)
        set BLDTOP=$(BLDDIR)
@@ -341,17 +341,17 @@ test: tests
        set OPENSSL_ENGINES=$(MAKEDIR)\engines
        set OPENSSL_DEBUG_MEMORY=on
        "$(PERL)" "$(SRCDIR)\test\run_tests.pl" $(TESTS)
-       @{- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
+       @{- if ($disabled{tests}) { output_on(); } else { output_off(); } "\@rem" -}
        @$(ECHO) "Tests are not supported with your chosen Configure options"
-       @{- output_on() if !$disabled{tests}; "" -}
+       @{- output_on() if !$disabled{tests}; "\@rem" -}
 
 list-tests:
-       @{- output_off() if $disabled{tests}; "" -}
+       @{- output_off() if $disabled{tests}; "\@rem" -}
        @set SRCTOP=$(SRCDIR)
        @"$(PERL)" "$(SRCDIR)\test\run_tests.pl" list
-       @{- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
+       @{- if ($disabled{tests}) { output_on(); } else { output_off(); } "\@rem" -}
        @$(ECHO) "Tests are not supported with your chosen Configure options"
-       @{- output_on() if !$disabled{tests}; "" -}
+       @{- output_on() if !$disabled{tests}; "\@rem" -}
 
 install: install_sw install_ssldirs install_docs
 
@@ -362,7 +362,7 @@ libclean:
        -del /Q /F $(LIBS) libcrypto.* libssl.* ossl_static.pdb
 
 clean: libclean
-       {- join("\n\t", map { "-del /Q /F $_" } @PROGRAMS) -}
+       {- join("\n\t", map { "-del /Q /F $_" } @PROGRAMS) || "\@rem" -}
        -del /Q /F $(ENGINES)
        -del /Q /F $(SCRIPTS)
        -del /Q /F $(GENERATED_MANDATORY)
@@ -378,9 +378,9 @@ distclean: clean
        -del /Q /F makefile
 
 depend:
-       @ {- output_off() if $disabled{makedepend}; "" -}
+       @ {- output_off() if $disabled{makedepend}; "\@rem" -}
        @ "$(PERL)" "$(SRCDIR)\util\add-depends.pl" "VC"
-       @ {- output_on() if $disabled{makedepend}; "" -}
+       @ {- output_on() if $disabled{makedepend}; "\@rem" -}
 
 # Install helper targets #############################################
 
@@ -413,10 +413,10 @@ install_dev: install_runtime_libs
        @if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
        @$(ECHO) "*** Installing development files"
        @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\include\openssl"
-       @{- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
+       @{- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "\@rem" -}
        @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\ms\applink.c" \
                                       "$(INSTALLTOP)\include\openssl"
-       @{- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
+       @{- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "\@rem" -}
        @"$(PERL)" "$(SRCDIR)\util\copy.pl" "-exclude_re=/__DECC_" \
                                       "$(SRCDIR)\include\openssl\*.h" \
                                       "$(INSTALLTOP)\include\openssl"