summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2017-04-06 20:20:04 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2017-04-06 20:20:04 -0700
commit77f4395247cc1ff6b5d5d582d0e2f609174028db (patch)
treea8214e49c39364934050a530ad8f7db11985d8b0
parentd31a86e5b169d5a1b349b5f9ccd8089e92c14d80 (diff)
downloadnasm-77f4395247cc1ff6b5d5d582d0e2f609174028db.tar.gz
msvc: finally make it possible to build the full Windows package
Finally make it possible to build the full Windows install package with MSVC tools. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--Mkfiles/README15
-rw-r--r--Mkfiles/msvc.mak7
-rw-r--r--doc/Makefile.in33
-rw-r--r--doc/pspdf.pl31
4 files changed, 61 insertions, 25 deletions
diff --git a/Mkfiles/README b/Mkfiles/README
index 4b310a7a..18d478e4 100644
--- a/Mkfiles/README
+++ b/Mkfiles/README
@@ -5,12 +5,21 @@ The Makefiles are:
Filename Target Compiler Tested with
---------------------------------------------------------------------------
- msvc.mak Win32 MS Visual C++ Visual C++ Express 2005
+ msvc.mak Win32 MS Visual C++ Visual Visual Studio 2013-2017
For building on a Win32 host using Microsoft Visual C++.
- Usage: nmake /f Mkfiles/msvc.mak
+ Usage: nmake /f Mkfiles\msvc.mak
+ If the following tools are installed, the full installer package can
+ be built:
+ 1. Perl (5.6 or later)
+ 2. Nullsoft Scriptable Installer System (makensis)
+ 3. Ghostscript (ps2pdf) or Acrobat Distriller (acrodist)
+
+ These tools need to be in your current path. To build the installer package:
+
+ nmake /f Mkfiles\msvc.mak nsis
Filename Target Compiler Tested with
---------------------------------------------------------------------------
@@ -20,6 +29,6 @@ The Makefiles are:
For building on a DOS, OS/2, Win32 or Linux host using OpenWatcom.
OpenWatcom can be downloaded from http://www.openwatcom.org/.
- Usage: wmake /f Mkfiles/<filename> <target>
+ Usage: wmake /f Mkfiles/openwcom.mak <target>
<target> is dos, win32, os2, or linux386.
diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak
index 19be8be8..ba8b8a84 100644
--- a/Mkfiles/msvc.mak
+++ b/Mkfiles/msvc.mak
@@ -342,10 +342,11 @@ spotless: distclean cleaner
strip:
-doc:
- # cd doc && $(MAKE) all
+# Abuse doc/Makefile.in to build nasmdoc.pdf only
+docs:
+ cd doc && $(MAKE) /f Makefile.in srcdir=. top_srcdir=.. PERL=$(PERL) nasmdoc.pdf
-everything: all doc rdf
+everything: all docs nsis
#-- Magic hints to mkdep.pl --#
# @object-ending: ".$(O)"
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 2b8ad9ee..848f6222 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -27,13 +27,12 @@ ACRODIST = acrodist # Acrobat Distiller
PSTOPDF = pstopdf # BSD/MacOS X utility
PS2PDF = ps2pdf # Part of GhostScript
+RM_F = rm -f
+RM_RF = rm -rf
+
SRCS = nasmdoc.src inslist.src changes.src version.src
OUT = info html nasmdoc.txt nasmdoc.ps nasmdoc.pdf
-# exports
-export srcdir
-export PERL
-
all: $(OUT)
os2: nasm.inf
@@ -47,18 +46,16 @@ html: html/nasmdoc0.html
RDSRC = $(PERL) $(srcdir)/rdsrc.pl -I$(srcdir)/
html/nasmdoc0.html: $(SRCS) rdsrc.pl
- mkdir -p html
- $(RDSRC) html "$<"
- mv -f *.html html
+ $(RDSRC) html nasmdoc.src
nasmdoc.dip: $(SRCS) rdsrc.pl
- $(RDSRC) dip "$<"
+ $(RDSRC) dip nasmdoc.src
nasmdoc.texi: $(SRCS) rdsrc.pl
- $(RDSRC) texi "$<"
+ $(RDSRC) texi nasmdoc.src
nasmdoc.txt: $(SRCS) rdsrc.pl
- $(RDSRC) txt "$<"
+ $(RDSRC) txt nasmdoc.src
version.src: $(top_srcdir)/version.pl $(top_srcdir)/version
$(PERL) $(top_srcdir)/version.pl docsrc \
@@ -70,9 +67,7 @@ nasmdoc.ps: nasmdoc.dip nasmlogo.eps \
> nasmdoc.ps
nasmdoc.pdf: nasmdoc.ps
- $(ACRODIST) -n -q --nosecurity -o $@ $< || \
- $(PS2PDF) $< $@ || \
- $(PSTOPDF) $< -o $@
+ $(PERL) pspdf.pl nasmdoc.ps nasmdoc.pdf
.PHONY: info
info: info/nasm.info
@@ -94,14 +89,14 @@ nasm.inf: nasmdoc.ipf
$(IPFC) -i -s $< $@
clean:
- -rm -f *.rtf *.hpj *.texi *.gid *.ipf *.dip
- -rm -f *.aux *.cp *.fn *.ky *.pg *.log *.toc *.tp *.vr
- -rm -f inslist.src version.src
+ -$(RM_F) *.rtf *.hpj *.texi *.gid *.ipf *.dip
+ -$(RM_F) *.aux *.cp *.fn *.ky *.pg *.log *.toc *.tp *.vr
+ -$(RM_F) inslist.src version.src
spotless: clean
- -rm -rf html info
- -rm -f *.hlp nasmdoc.txt *.inf *.pdf *.dvi
- -rm -f nasmdoc*.ps
+ -$(RM_RF) html info
+ -$(RM_F) *.hlp nasmdoc.txt *.inf *.pdf *.dvi
+ -$(RM_F) nasmdoc*.ps
install: all
mkdir -p $(INSTALLROOT)$(infodir)
diff --git a/doc/pspdf.pl b/doc/pspdf.pl
new file mode 100644
index 00000000..6d59142a
--- /dev/null
+++ b/doc/pspdf.pl
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+#
+# Wrapper around a variety of programs that can do PS -> PDF conversion
+#
+
+use strict;
+
+my ($in, $out) = @ARGV;
+
+if (!defined($out)) {
+ die "Usage: $0 infile outfile\n";
+}
+
+# Remove output file
+unlink($out);
+
+# 1. Acrobat distiller
+my $r = system('acrodist', '-n', '-q', '--nosecurity', '-o', $out, $in);
+exit 0 if ( !$r && -f $out );
+
+# 2. ps2pdf (from Ghostscript)
+my $r = system('ps2pdf', $in, $out);
+exit 0 if ( !$r && -f $out );
+
+# 3. pstopdf (BSD/MacOS X utility)
+my $r = system('pstopdf', $in, '-o', $out);
+exit 0 if ( !$r && -f $out );
+
+# Otherwise, fail
+unlink($out);
+exit 1;