summaryrefslogtreecommitdiff
path: root/Mkfiles
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2017-11-08 10:57:16 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2017-11-08 10:59:17 -0800
commitd685bd2c4cf9b1fdeef1651575e3cfb7b5c23357 (patch)
treefa9dd3cab287738f4be27992fbadcc96be6cd37a /Mkfiles
parentcae5d061849ba0c7150f0089433cceeff2e602be (diff)
downloadnasm-d685bd2c4cf9b1fdeef1651575e3cfb7b5c23357.tar.gz
msvc.mak: (hopefully) make external dependencies work with NMAKE
Hopefully this will make external dependencies work with NMAKE. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'Mkfiles')
-rw-r--r--Mkfiles/msvc.mak40
1 files changed, 30 insertions, 10 deletions
diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak
index d77d822b..711ca423 100644
--- a/Mkfiles/msvc.mak
+++ b/Mkfiles/msvc.mak
@@ -53,6 +53,7 @@ LN_S = copy
O = obj
A = lib
X = .exe
+.SUFFIXES:
.SUFFIXES: .c .i .s .$(O) .$(A) .exe .1 .man
.c.obj:
@@ -312,15 +313,6 @@ nsis: nsis\nasm.nsi nsis\arch.nsh nsis\version.nsh
#-- End NSIS Rules --#
-#
-# Generate dependency information for this Makefile only.
-# If this Makefile has external dependency information, then
-# the dependency information will remain external, so it doesn't
-# pollute the git logs.
-#
-deps: perlreq tools/mkdep.pl
- $(PERL) tools/mkdep.pl -M Mkfiles/msvc.mak -- $(DEPDIRS)
-
clean:
-del /f /s *.$(O)
-del /f /s *.pdb
@@ -370,9 +362,37 @@ docs:
everything: all docs nsis
+#
+# Does this version of this file have external dependencies? This definition
+# will be automatically updated by mkdep.pl as needed.
+#
+EXTERNAL_DEPENDENCIES = 1
+
+#
+# Generate dependency information for this Makefile only.
+# If this Makefile has external dependency information, then
+# the dependency information will remain external, so it doesn't
+# pollute the git logs.
+#
+msvc.dep: $(PERLREQ) tools\mkdep.pl
+ $(RUNPERL) tools\mkdep.pl -M Mkfiles\msvc.mak -- $(DEPDIRS)
+
+dep: msvc.dep
+
+# Include and/or generate msvc.dep as needed. This is too complex to
+# use the include-command feature, but we can open-code it here.
+!IF $(EXTERNAL_DEPENDENCIES) == 1
+!IF [$(MAKE) /c msvc.dep] == 0
+!INCLUDE msvc.dep
+!ELSE
+!ERROR Unable to rebuild dependencies file msvc.dep
+!ENDIF
+!ENDIF
+
#-- Magic hints to mkdep.pl --#
# @object-ending: ".$(O)"
# @path-separator: "\"
# @exclude: "config/config.h"
-# @include-command: "!INCLUDE"
+# @external: "msvc.dep"
+# @selfrule: "1"
#-- Everything below is generated by mkdep.pl - do not edit --#