Skip to content

Commit 843976d

Browse files
author
H. Peter Anvin
committed
Merge remote-tracking branch 'github/nasm-2.16.xx'
Resolved Conflicts: autoconf/m4/pa_add_langflags.m4 autoconf/m4/pa_option_lto.m4 autogen.sh configure.ac doc/changes.src
2 parents ec4e412 + 0346e58 commit 843976d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2297
-912
lines changed

Makefile.in

Lines changed: 65 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ PERL = perl
4343
PERLFLAGS = -I$(top_srcdir)/perllib -I$(srcdir)
4444
RUNPERL = $(PERL) $(PERLFLAGS)
4545

46+
EMPTY = : >
47+
4648
PYTHON3 = python3
4749

4850
INSTALL = @INSTALL@
@@ -55,6 +57,7 @@ ASCIIDOC = @ASCIIDOC@
5557
XMLTO = @XMLTO@
5658
MAKENSIS = @MAKENSIS@
5759
XZ = @XZ@
60+
WINDRES = @WINDRES@
5861

5962
# Optional targets
6063
MANPAGES = @MANPAGES@
@@ -76,6 +79,12 @@ ifeq ($(TRACE),1)
7679
CFLAGS += -DNASM_TRACE
7780
endif
7881

82+
# Don't delete intermediate files
83+
.SECONDARY:
84+
85+
# Delete files on error
86+
.DELETE_ON_ERROR:
87+
7988
.SUFFIXES:
8089
.SUFFIXES: $(X) .$(O) .$(A) .xml .1 .c .i .s .txt .time
8190

@@ -98,6 +107,8 @@ endif
98107
.xml.1:
99108
$(XMLTO) man --skip-validation $< 2>/dev/null
100109

110+
MANIFEST = @MANIFEST@
111+
101112
#-- Begin File Lists --#
102113
NASM = asm/nasm.$(O)
103114
NDISASM = disasm/ndisasm.$(O)
@@ -115,7 +126,8 @@ LIBOBJ_NW = stdlib/snprintf.$(O) stdlib/vsnprintf.$(O) stdlib/strlcpy.$(O) \
115126
nasmlib/file.$(O) nasmlib/mmap.$(O) nasmlib/ilog2.$(O) \
116127
nasmlib/realpath.$(O) nasmlib/path.$(O) \
117128
nasmlib/filename.$(O) nasmlib/rlimit.$(O) \
118-
nasmlib/zerobuf.$(O) nasmlib/readnum.$(O) nasmlib/bsi.$(O) \
129+
nasmlib/readnum.$(O) nasmlib/numstr.$(O) \
130+
nasmlib/zerobuf.$(O) nasmlib/bsi.$(O) \
119131
nasmlib/rbtree.$(O) nasmlib/hashtbl.$(O) \
120132
nasmlib/raa.$(O) nasmlib/saa.$(O) \
121133
nasmlib/strlist.$(O) \
@@ -153,14 +165,16 @@ LIBOBJ_NW = stdlib/snprintf.$(O) stdlib/vsnprintf.$(O) stdlib/strlcpy.$(O) \
153165

154166
# Warnings depend on all source files, so handle them separately
155167
WARNOBJ = asm/warnings.$(O)
168+
WARNFILES = asm/warnings_c.h include/warnings.h doc/warnings.src
156169

157170
LIBOBJ = $(LIBOBJ_NW) $(WARNOBJ)
158171
ALLOBJ_NW = $(PROGOBJ) $(LIBOBJ_NW)
159172
ALLOBJ = $(PROGOBJ) $(LIBOBJ)
160173

161-
SUBDIRS = stdlib nasmlib output asm disasm x86 common macros
162-
XSUBDIRS = test doc nsis
163-
DEPDIRS = . include config x86 $(SUBDIRS)
174+
SUBDIRS = stdlib nasmlib include config output asm disasm x86 \
175+
common macros
176+
XSUBDIRS = test doc nsis win
177+
DEPDIRS = . $(SUBDIRS)
164178
#-- End File Lists --#
165179

166180
all: dirs
@@ -176,11 +190,15 @@ $(NASMLIB): $(LIBOBJ)
176190
$(AR) cq $(NASMLIB) $(LIBOBJ)
177191
$(RANLIB) $(NASMLIB)
178192

179-
nasm$(X): $(NASM) $(NASMLIB)
180-
$(CC) $(ALL_LDFLAGS) -o nasm$(X) $(NASM) $(NASMLIB) $(LIBS)
193+
nasm$(X): $(NASM) $(MANIFEST) $(NASMLIB)
194+
$(CC) $(ALL_LDFLAGS) -o nasm$(X) $^ $(LIBS)
181195

182-
ndisasm$(X): $(NDISASM) $(NASMLIB)
183-
$(CC) $(ALL_LDFLAGS) -o ndisasm$(X) $(NDISASM) $(NASMLIB) $(LIBS)
196+
ndisasm$(X): $(NDISASM) $(MANIFEST) $(NASMLIB)
197+
$(CC) $(ALL_LDFLAGS) -o ndisasm$(X) $^ $(LIBS)
198+
199+
# These are specific to certain Makefile syntaxes...
200+
WARNTIMES = $(WARNFILES:=.time)
201+
WARNSRCS = $(LIBOBJ_NW:.$(O)=.c) asm/nasm.c
184202

185203
#-- Begin Generated File Rules --#
186204

@@ -189,7 +207,7 @@ ndisasm$(X): $(NDISASM) $(NASMLIB)
189207
# have Perl just to recompile NASM from the distribution.
190208

191209
# Perl-generated source files
192-
PERLREQ = config/unconfig.h \
210+
PERLREQ_CLEANABLE = \
193211
x86/insnsb.c x86/insnsa.c x86/insnsd.c x86/insnsi.h x86/insnsn.c \
194212
x86/regs.c x86/regs.h x86/regflags.c x86/regdis.c x86/regdis.h \
195213
x86/regvals.c asm/tokhash.c asm/tokens.h asm/pptok.h asm/pptok.c \
@@ -200,10 +218,14 @@ PERLREQ = config/unconfig.h \
200218
misc/nasmtok.el \
201219
version.h version.mac version.mak nsis/version.nsh
202220

221+
# Special hack to keep config/unconfig.h from getting deleted
222+
# by "make spotless"...
223+
PERLREQ = config/unconfig.h $(PERLREQ_CLEANABLE)
224+
203225
INSDEP = x86/insns.dat x86/insns.pl x86/insns-iflags.ph x86/iflags.ph
204226

205-
config/unconfig.h: config/config.h.in
206-
$(RUNPERL) $(tools)/unconfig.pl \
227+
config/unconfig.h: config/config.h.in autoconf/unconfig.pl
228+
$(RUNPERL) '$(srcdir)'/autoconf/unconfig.pl \
207229
'$(srcdir)' config/config.h.in config/unconfig.h
208230

209231
x86/iflag.c: $(INSDEP)
@@ -275,33 +297,32 @@ x86/regs.h: x86/regs.dat x86/regs.pl
275297
# reasonable, but doesn't update the time stamp if the files aren't
276298
# changed, to avoid rebuilding everything every time. Track the actual
277299
# dependency by the empty file asm/warnings.time.
278-
WARNFILES = asm/warnings_c.h include/warnings.h doc/warnings.src
279-
280-
warnings:
281-
$(RM_F) $(WARNFILES) $(WARNFILES:=.time)
300+
.PHONY: warnings
301+
warnings: dirs
302+
$(RM_F) $(WARNFILES) $(WARNTIMES) asm/warnings.time
282303
$(MAKE) asm/warnings.time
283304

284-
asm/warnings.time: $(ALLOBJ_NW:.$(O)=.c)
285-
: > asm/warnings.time
286-
$(MAKE) $(WARNFILES:=.time)
305+
asm/warnings.time: $(WARNSRCS) asm/warnings.pl
306+
$(EMPTY) asm/warnings.time
307+
$(MAKE) $(WARNTIMES)
287308

288309
asm/warnings_c.h.time: asm/warnings.pl asm/warnings.time
289310
$(RUNPERL) $(srcdir)/asm/warnings.pl c asm/warnings_c.h $(srcdir)
290-
: > asm/warnings_c.h.time
311+
$(EMPTY) asm/warnings_c.h.time
291312

292313
asm/warnings_c.h: asm/warnings_c.h.time
293314
@: Side effect
294315

295316
include/warnings.h.time: asm/warnings.pl asm/warnings.time
296317
$(RUNPERL) $(srcdir)/asm/warnings.pl h include/warnings.h $(srcdir)
297-
: > include/warnings.h.time
318+
$(EMPTY) include/warnings.h.time
298319

299320
include/warnings.h: include/warnings.h.time
300321
@: Side effect
301322

302323
doc/warnings.src.time: asm/warnings.pl asm/warnings.time
303324
$(RUNPERL) $(srcdir)/asm/warnings.pl doc doc/warnings.src $(srcdir)
304-
: > doc/warnings.src.time
325+
$(EMPTY) doc/warnings.src.time
305326

306327
doc/warnings.src : doc/warnings.src.time
307328
@: Side effect
@@ -346,7 +367,8 @@ misc/nasmtok.el: misc/emacstbl.pl asm/tokhash.c asm/pptok.c \
346367

347368
#-- End Generated File Rules --#
348369

349-
perlreq: $(PERLREQ)
370+
perlreq: dirs
371+
$(MAKE) $(PERLREQ)
350372

351373
#-- Begin NSIS Rules --#
352374

@@ -361,6 +383,11 @@ nsis: nsis/nasm.nsi nsis/arch.nsh nsis/version.nsh
361383

362384
#-- End NSIS Rules --#
363385

386+
# Windows embedded manifest
387+
MANIFEST_RC = win/manifest.rc
388+
win/manifest.$(O): win/manifest.xml $(MANIFEST_RC)
389+
$(WINDRES) -I. -Iwin -DMANIFEST_FILE='\"$<\"' -i $(MANIFEST_RC) -o $@
390+
364391
# Generated manpages, also pregenerated for distribution
365392
manpages: nasm.1 ndisasm.1
366393

@@ -388,16 +415,16 @@ distclean: clean
388415
done
389416
$(RM_F) test/*.$(O)
390417
$(RM_F) *.dep
418+
-sh autoconf/clean.sh || sh '$(srcdir)'/autoconf/clean.sh
391419

392-
cleaner: clean
393-
$(RM_F) $(PERLREQ) *.1 nasm.spec
420+
cleaner:
421+
$(RM_F) $(PERLREQ_CL) *.1 nasm.spec
394422
$(MAKE) -C doc clean
395-
$(RM_F) *.dep */*.time
396-
397-
makefile-clean:
398-
./autogen.sh
423+
$(MAKE) distclean
424+
$(RM_F) */*.time
399425

400-
spotless: distclean cleaner makefile-clean
426+
spotless: cleaner
427+
$(RM_F) configure autoconf/aclocal.m4 autoconf/clean.sh
401428

402429
strip:
403430
$(STRIP) --strip-unneeded $(PROGS)
@@ -433,23 +460,22 @@ everything: always_everything
433460
install_everything: everything install install_doc
434461

435462
dist:
436-
$(MAKE) distclean
437463
$(MAKE) alldeps
438-
$(MAKE) perlreq manpages spec $(MANPAGES)
464+
$(MAKE) perlreq warnings spec $(MANPAGES)
465+
$(MAKE) distclean
439466
./autogen.sh
440467

441468
tar: dist
442-
tar -cv --exclude CVS -C .. -f - | \
443-
$(XZ) -9e > \
444-
../nasm-`cat version`-`date +%Y%m%d`.tar.xz `basename \`pwd\``
469+
tar -cv --exclude CVS --exclude .git -C .. -f - `basename \`pwd\`` | \
470+
$(XZ) -9e > ../nasm-`cat version`-`date +%Y%m%d`.tar.xz
445471

446472
spec: nasm.spec
447473

448474
ALLPERLSRC := $(shell find $(srcdir) -type f -name '*.p[lh]')
449475

450476
perlbreq.si: $(ALLPERLSRC)
451-
sed -n -r -e 's/^[[:space:]]*use[[:space:]]+([^[:space:];]+).*$$/BuildRequires: perl(\1)/p' $(ALLPERLSRC) | \
452-
sed -r -e '/perl\((strict|warnings|Win32.*)\)/d' | \
477+
sed -n -r -e 's/^[[:space:]]*use[[:space:]]+([[:upper:]][^[:space:];]*).*$$/BuildRequires: perl(\1)/p' $(ALLPERLSRC) | \
478+
sed -r -e '/perl\((Win32.*)\)/d' | \
453479
sort | uniq > perlbreq.si
454480

455481
nasm.spec: nasm.spec.in nasm.spec.sed version.sed perlbreq.si
@@ -508,8 +534,9 @@ EXTERNAL_DEPENDENCIES = 1
508534
# the dependency information will remain external, so it doesn't
509535
# pollute the git logs.
510536
#
511-
Makefile.dep: $(PERLREQ) $(tools)/mkdep.pl config.status
512-
$(RUNPERL) $(tools)/mkdep.pl -M Makefile.in -- $(DEPDIRS)
537+
Makefile.dep: $(tools)/mkdep.pl config.status $(PERLREQ)
538+
$(RUNPERL) $(tools)/mkdep.pl -s '$(top_srcdir)' \
539+
-M $(srcdir)/Makefile.in -- $(DEPDIRS)
513540

514541
dep: Makefile.dep
515542

Mkfiles/README

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The Makefiles are:
55

66
Filename Target Compiler Tested with
77
---------------------------------------------------------------------------
8-
msvc.mak Win32 MS Visual C++ Visual Visual Studio 2013-2017
8+
msvc.mak Win32 MS Visual C++ Visual Visual Studio 2013-2022
99

1010
For building on a Win32 host using Microsoft Visual C++.
1111

@@ -33,6 +33,11 @@ The Makefiles are:
3333

3434
nmake /f Mkfiles\msvc.mak everything nsis
3535

36+
NOTE: the preferred way to build NASM on Windows is to use
37+
the standard configure script under the MSYS2 environment.
38+
See http://www.msys2.org/.
39+
40+
3641
Filename Target Compiler Tested with
3742
---------------------------------------------------------------------------
3843
openwcom.mak DOS,Win32,OS/2 OpenWatcom C OpenWatcom 1.7 (Win32)

0 commit comments

Comments
 (0)