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>
This commit is contained in:
H. Peter Anvin 2017-04-06 20:20:04 -07:00
parent d31a86e5b1
commit 77f4395247
4 changed files with 61 additions and 25 deletions

View file

@ -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.

View file

@ -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)"

View file

@ -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)

31
doc/pspdf.pl Normal file
View file

@ -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;