2002-05-01 04:52:49 +08:00
|
|
|
#
|
|
|
|
# Auto-configuring Makefile for the Netwide Assembler.
|
|
|
|
#
|
|
|
|
# The Netwide Assembler is copyright (C) 1996 Simon Tatham and
|
|
|
|
# Julian Hall. All rights reserved. The software is
|
2007-12-29 22:44:23 +08:00
|
|
|
# redistributable under the license given in the file "LICENSE"
|
2002-05-01 04:52:49 +08:00
|
|
|
# distributed in the NASM archive.
|
|
|
|
|
2016-03-10 06:11:40 +08:00
|
|
|
@SET_MAKE@
|
|
|
|
|
2007-06-22 03:00:12 +08:00
|
|
|
top_srcdir = @top_srcdir@
|
2002-05-01 04:58:18 +08:00
|
|
|
srcdir = @srcdir@
|
2016-05-17 11:30:09 +08:00
|
|
|
objdir = @builddir@
|
2002-05-01 04:58:18 +08:00
|
|
|
VPATH = @srcdir@
|
|
|
|
prefix = @prefix@
|
|
|
|
exec_prefix = @exec_prefix@
|
|
|
|
bindir = @bindir@
|
|
|
|
mandir = @mandir@
|
2007-10-19 14:33:06 +08:00
|
|
|
datarootdir = @datarootdir@
|
2002-05-01 04:52:49 +08:00
|
|
|
|
2002-05-01 04:58:18 +08:00
|
|
|
CC = @CC@
|
2005-10-21 03:46:34 +08:00
|
|
|
CFLAGS = @CFLAGS@
|
2017-07-02 11:13:56 +08:00
|
|
|
CPPFLAGS = @CPPFLAGS@
|
2017-07-06 06:36:06 +08:00
|
|
|
BUILD_CFLAGS = $(CPPFLAGS) $(CFLAGS) @DEFS@
|
2016-05-26 03:06:29 +08:00
|
|
|
INTERNAL_CFLAGS = -I$(srcdir) -I$(objdir) \
|
|
|
|
-I$(srcdir)/include -I$(objdir)/include \
|
|
|
|
-I$(srcdir)/x86 -I$(objdir)/x86 \
|
|
|
|
-I$(srcdir)/asm -I$(objdir)/asm \
|
|
|
|
-I$(srcdir)/disasm -I$(objdir)/disasm \
|
|
|
|
-I$(srcdir)/output -I$(objdir)/output
|
2005-10-21 03:46:34 +08:00
|
|
|
ALL_CFLAGS = $(BUILD_CFLAGS) $(INTERNAL_CFLAGS)
|
2002-05-01 04:58:18 +08:00
|
|
|
LDFLAGS = @LDFLAGS@
|
2018-12-23 10:17:16 +08:00
|
|
|
ALL_LDFLAGS = $(ALL_CFLAGS) $(LDFLAGS)
|
2002-05-27 07:55:34 +08:00
|
|
|
LIBS = @LIBS@
|
2016-03-08 18:06:39 +08:00
|
|
|
|
|
|
|
AR = @AR@
|
|
|
|
RANLIB = @RANLIB@
|
|
|
|
STRIP = @STRIP@
|
|
|
|
|
2023-01-18 05:05:55 +08:00
|
|
|
tools = $(top_srcdir)/tools
|
|
|
|
|
2016-02-18 16:54:30 +08:00
|
|
|
PERL = perl
|
2023-01-18 05:05:55 +08:00
|
|
|
PERLFLAGS = -I$(top_srcdir)/perllib -I$(srcdir)
|
2016-02-18 16:54:30 +08:00
|
|
|
RUNPERL = $(PERL) $(PERLFLAGS)
|
|
|
|
|
2024-01-30 11:00:15 +08:00
|
|
|
EMPTY = : >
|
|
|
|
|
2018-12-19 10:57:00 +08:00
|
|
|
PYTHON3 = python3
|
|
|
|
|
2002-05-01 04:58:18 +08:00
|
|
|
INSTALL = @INSTALL@
|
|
|
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
|
|
INSTALL_DATA = @INSTALL_DATA@
|
2002-05-01 04:52:49 +08:00
|
|
|
|
2020-05-27 05:13:31 +08:00
|
|
|
# Optional tools
|
2002-05-01 04:58:18 +08:00
|
|
|
NROFF = @NROFF@
|
2013-02-18 02:50:19 +08:00
|
|
|
ASCIIDOC = @ASCIIDOC@
|
|
|
|
XMLTO = @XMLTO@
|
2020-05-27 05:13:31 +08:00
|
|
|
MAKENSIS = @MAKENSIS@
|
|
|
|
XZ = @XZ@
|
2024-01-30 09:19:32 +08:00
|
|
|
WINDRES = @WINDRES@
|
2002-05-01 04:57:38 +08:00
|
|
|
|
2020-05-27 05:13:31 +08:00
|
|
|
# Optional targets
|
|
|
|
MANPAGES = @MANPAGES@
|
|
|
|
NSIS = @NSIS@
|
2016-03-04 13:37:37 +08:00
|
|
|
|
2020-05-27 05:13:31 +08:00
|
|
|
MKDIR_P = @MKDIR_P@
|
2017-04-04 02:13:29 +08:00
|
|
|
RM_F = rm -f
|
|
|
|
RM_RF = rm -rf
|
2017-04-07 08:24:03 +08:00
|
|
|
LN_S = @LN_S@
|
2010-11-05 19:18:51 +08:00
|
|
|
FIND = find
|
2007-09-26 04:34:55 +08:00
|
|
|
|
2002-05-19 10:02:20 +08:00
|
|
|
# Binary suffixes
|
2023-01-18 05:05:55 +08:00
|
|
|
O = @OBJEXT@
|
|
|
|
X = @EXEEXT@
|
2016-03-10 06:11:40 +08:00
|
|
|
A = @LIBEXT@
|
2002-05-19 10:02:20 +08:00
|
|
|
|
2011-06-25 23:51:44 +08:00
|
|
|
# Debug stuff
|
|
|
|
ifeq ($(TRACE),1)
|
|
|
|
CFLAGS += -DNASM_TRACE
|
|
|
|
endif
|
|
|
|
|
2024-04-05 05:18:34 +08:00
|
|
|
# Don't delete intermediate files
|
|
|
|
.SECONDARY:
|
|
|
|
|
|
|
|
# Delete files on error
|
|
|
|
.DELETE_ON_ERROR:
|
|
|
|
|
2017-11-07 14:37:37 +08:00
|
|
|
.SUFFIXES:
|
2020-09-12 09:11:51 +08:00
|
|
|
.SUFFIXES: $(X) .$(O) .$(A) .xml .1 .c .i .s .txt .time
|
2002-05-01 04:58:18 +08:00
|
|
|
|
2022-11-08 08:49:13 +08:00
|
|
|
.PHONY: all doc install clean distclean cleaner spotless test
|
2010-11-05 19:18:51 +08:00
|
|
|
.PHONY: install_doc everything install_everything strip perlreq dist tags TAGS
|
2020-05-27 05:13:31 +08:00
|
|
|
.PHONY: nothing manpages nsis
|
2002-05-01 04:57:59 +08:00
|
|
|
|
2002-05-19 10:02:20 +08:00
|
|
|
.c.$(O):
|
2018-06-16 08:41:46 +08:00
|
|
|
$(CC) -c $(ALL_CFLAGS) -o $@ $<
|
2002-05-01 04:58:18 +08:00
|
|
|
|
|
|
|
.c.s:
|
2018-06-16 08:41:46 +08:00
|
|
|
$(CC) -S $(ALL_CFLAGS) -o $@ $<
|
2002-05-01 04:58:18 +08:00
|
|
|
|
|
|
|
.c.i:
|
2018-06-16 08:41:46 +08:00
|
|
|
$(CC) -E $(ALL_CFLAGS) -o $@ $<
|
2002-05-01 04:52:49 +08:00
|
|
|
|
2013-10-24 20:22:19 +08:00
|
|
|
.txt.xml:
|
|
|
|
$(ASCIIDOC) -b docbook -d manpage -o $@ $<
|
|
|
|
|
|
|
|
.xml.1:
|
|
|
|
$(XMLTO) man --skip-validation $< 2>/dev/null
|
2013-02-18 02:50:19 +08:00
|
|
|
|
2024-01-30 09:19:32 +08:00
|
|
|
MANIFEST = @MANIFEST@
|
|
|
|
|
2008-06-16 14:50:50 +08:00
|
|
|
#-- Begin File Lists --#
|
2020-08-19 06:07:51 +08:00
|
|
|
NASM = asm/nasm.$(O)
|
2017-03-01 10:08:21 +08:00
|
|
|
NDISASM = disasm/ndisasm.$(O)
|
|
|
|
|
2020-09-12 09:11:51 +08:00
|
|
|
PROGOBJ = $(NASM) $(NDISASM)
|
|
|
|
PROGS = nasm$(X) ndisasm$(X)
|
|
|
|
|
|
|
|
LIBOBJ_NW = stdlib/snprintf.$(O) stdlib/vsnprintf.$(O) stdlib/strlcpy.$(O) \
|
2017-12-21 05:33:49 +08:00
|
|
|
stdlib/strnlen.$(O) stdlib/strrchrnul.$(O) \
|
|
|
|
\
|
2017-03-01 10:08:21 +08:00
|
|
|
nasmlib/ver.$(O) \
|
2018-12-14 08:43:43 +08:00
|
|
|
nasmlib/alloc.$(O) nasmlib/asprintf.$(O) nasmlib/errfile.$(O) \
|
2021-03-31 21:23:11 +08:00
|
|
|
nasmlib/crc32.$(O) nasmlib/crc64.$(O) nasmlib/md5c.$(O) \
|
2018-12-14 08:43:43 +08:00
|
|
|
nasmlib/string.$(O) nasmlib/nctype.$(O) \
|
2017-03-01 10:08:21 +08:00
|
|
|
nasmlib/file.$(O) nasmlib/mmap.$(O) nasmlib/ilog2.$(O) \
|
2017-04-24 13:39:53 +08:00
|
|
|
nasmlib/realpath.$(O) nasmlib/path.$(O) \
|
2020-06-02 04:10:46 +08:00
|
|
|
nasmlib/filename.$(O) nasmlib/rlimit.$(O) \
|
2023-10-16 13:40:07 +08:00
|
|
|
nasmlib/readnum.$(O) nasmlib/numstr.$(O) \
|
|
|
|
nasmlib/zerobuf.$(O) nasmlib/bsi.$(O) \
|
2017-03-01 10:08:21 +08:00
|
|
|
nasmlib/rbtree.$(O) nasmlib/hashtbl.$(O) \
|
|
|
|
nasmlib/raa.$(O) nasmlib/saa.$(O) \
|
|
|
|
nasmlib/strlist.$(O) \
|
2017-04-03 15:09:58 +08:00
|
|
|
nasmlib/perfhash.$(O) nasmlib/badenum.$(O) \
|
2017-12-21 05:33:49 +08:00
|
|
|
\
|
2017-03-01 10:08:21 +08:00
|
|
|
common/common.$(O) \
|
2017-12-21 05:33:49 +08:00
|
|
|
\
|
2017-03-01 10:08:21 +08:00
|
|
|
x86/insnsa.$(O) x86/insnsb.$(O) x86/insnsd.$(O) x86/insnsn.$(O) \
|
|
|
|
x86/regs.$(O) x86/regvals.$(O) x86/regflags.$(O) x86/regdis.$(O) \
|
|
|
|
x86/disp8.$(O) x86/iflag.$(O) \
|
|
|
|
\
|
2020-09-12 09:11:51 +08:00
|
|
|
asm/error.$(O) \
|
2020-06-15 14:21:44 +08:00
|
|
|
asm/floats.$(O) \
|
2017-03-08 11:23:03 +08:00
|
|
|
asm/directiv.$(O) asm/directbl.$(O) \
|
2017-03-08 13:32:37 +08:00
|
|
|
asm/pragma.$(O) \
|
2016-05-26 03:06:29 +08:00
|
|
|
asm/assemble.$(O) asm/labels.$(O) asm/parser.$(O) \
|
|
|
|
asm/preproc.$(O) asm/quote.$(O) asm/pptok.$(O) \
|
2017-03-01 10:13:43 +08:00
|
|
|
asm/listing.$(O) asm/eval.$(O) asm/exprlib.$(O) asm/exprdump.$(O) \
|
2016-05-26 03:06:29 +08:00
|
|
|
asm/stdscan.$(O) \
|
|
|
|
asm/strfunc.$(O) asm/tokhash.$(O) \
|
|
|
|
asm/segalloc.$(O) \
|
|
|
|
asm/rdstrnum.$(O) \
|
2018-12-11 15:00:10 +08:00
|
|
|
asm/srcfile.$(O) \
|
2016-05-26 03:06:29 +08:00
|
|
|
macros/macros.$(O) \
|
|
|
|
\
|
2016-09-25 00:46:47 +08:00
|
|
|
output/outform.$(O) output/outlib.$(O) output/legacy.$(O) \
|
|
|
|
output/nulldbg.$(O) output/nullout.$(O) \
|
2009-06-28 13:07:33 +08:00
|
|
|
output/outbin.$(O) output/outaout.$(O) output/outcoff.$(O) \
|
2016-04-10 22:37:11 +08:00
|
|
|
output/outelf.$(O) \
|
2022-11-08 08:49:13 +08:00
|
|
|
output/outobj.$(O) output/outas86.$(O) \
|
2016-02-13 13:18:12 +08:00
|
|
|
output/outdbg.$(O) output/outieee.$(O) output/outmacho.$(O) \
|
2017-03-01 10:08:21 +08:00
|
|
|
output/codeview.$(O) \
|
|
|
|
\
|
|
|
|
disasm/disasm.$(O) disasm/sync.$(O)
|
2017-03-01 17:23:00 +08:00
|
|
|
|
2020-09-12 09:11:51 +08:00
|
|
|
# Warnings depend on all source files, so handle them separately
|
|
|
|
WARNOBJ = asm/warnings.$(O)
|
2024-01-30 11:00:15 +08:00
|
|
|
WARNFILES = asm/warnings_c.h include/warnings.h doc/warnings.src
|
2020-09-12 09:11:51 +08:00
|
|
|
|
|
|
|
LIBOBJ = $(LIBOBJ_NW) $(WARNOBJ)
|
|
|
|
ALLOBJ_NW = $(PROGOBJ) $(LIBOBJ_NW)
|
|
|
|
ALLOBJ = $(PROGOBJ) $(LIBOBJ)
|
2020-08-19 06:07:51 +08:00
|
|
|
|
2024-04-13 05:35:56 +08:00
|
|
|
SUBDIRS = stdlib nasmlib include config output asm disasm x86 \
|
|
|
|
common macros
|
|
|
|
XSUBDIRS = test doc nsis win
|
|
|
|
DEPDIRS = . $(SUBDIRS)
|
2008-06-16 14:50:50 +08:00
|
|
|
#-- End File Lists --#
|
2002-05-01 04:52:49 +08:00
|
|
|
|
2020-05-27 05:13:31 +08:00
|
|
|
all: dirs
|
2022-11-08 08:49:13 +08:00
|
|
|
$(MAKE) $(PROGS)
|
2002-05-01 04:52:49 +08:00
|
|
|
|
2016-03-08 18:06:39 +08:00
|
|
|
NASMLIB = libnasm.$(A)
|
2002-05-19 10:02:20 +08:00
|
|
|
|
2020-05-27 05:13:31 +08:00
|
|
|
dirs:
|
|
|
|
$(MKDIR_P) $(SUBDIRS) $(XSUBDIRS)
|
|
|
|
|
2016-03-08 18:06:39 +08:00
|
|
|
$(NASMLIB): $(LIBOBJ)
|
2017-04-04 02:13:29 +08:00
|
|
|
$(RM_F) $(NASMLIB)
|
2016-03-08 18:06:39 +08:00
|
|
|
$(AR) cq $(NASMLIB) $(LIBOBJ)
|
|
|
|
$(RANLIB) $(NASMLIB)
|
|
|
|
|
2024-01-30 09:19:32 +08:00
|
|
|
nasm$(X): $(NASM) $(MANIFEST) $(NASMLIB)
|
|
|
|
$(CC) $(ALL_LDFLAGS) -o nasm$(X) $^ $(LIBS)
|
2016-03-08 18:06:39 +08:00
|
|
|
|
2024-01-30 09:19:32 +08:00
|
|
|
ndisasm$(X): $(NDISASM) $(MANIFEST) $(NASMLIB)
|
|
|
|
$(CC) $(ALL_LDFLAGS) -o ndisasm$(X) $^ $(LIBS)
|
2002-05-19 10:02:20 +08:00
|
|
|
|
2024-01-30 11:00:15 +08:00
|
|
|
# These are specific to certain Makefile syntaxes...
|
|
|
|
WARNTIMES = $(WARNFILES:=.time)
|
2024-04-05 05:18:34 +08:00
|
|
|
WARNSRCS = $(LIBOBJ_NW:.$(O)=.c) asm/nasm.c
|
2024-01-30 11:00:15 +08:00
|
|
|
|
2017-04-04 02:13:29 +08:00
|
|
|
#-- Begin Generated File Rules --#
|
|
|
|
|
|
|
|
# These source files are automagically generated from data files using
|
|
|
|
# Perl scripts. They're distributed, though, so it isn't necessary to
|
|
|
|
# have Perl just to recompile NASM from the distribution.
|
|
|
|
|
|
|
|
# Perl-generated source files
|
2024-04-13 03:05:52 +08:00
|
|
|
PERLREQ_CLEANABLE = \
|
2020-07-07 02:10:30 +08:00
|
|
|
x86/insnsb.c x86/insnsa.c x86/insnsd.c x86/insnsi.h x86/insnsn.c \
|
2017-04-04 02:13:29 +08:00
|
|
|
x86/regs.c x86/regs.h x86/regflags.c x86/regdis.c x86/regdis.h \
|
|
|
|
x86/regvals.c asm/tokhash.c asm/tokens.h asm/pptok.h asm/pptok.c \
|
|
|
|
x86/iflag.c x86/iflaggen.h \
|
|
|
|
macros/macros.c \
|
|
|
|
asm/pptok.ph asm/directbl.c asm/directiv.h \
|
2023-01-18 05:05:55 +08:00
|
|
|
$(WARNFILES) \
|
2022-11-18 04:52:52 +08:00
|
|
|
misc/nasmtok.el \
|
2017-04-04 02:13:29 +08:00
|
|
|
version.h version.mac version.mak nsis/version.nsh
|
|
|
|
|
2024-04-13 03:05:52 +08:00
|
|
|
# Special hack to keep config/unconfig.h from getting deleted
|
|
|
|
# by "make spotless"...
|
|
|
|
PERLREQ = config/unconfig.h $(PERLREQ_CLEANABLE)
|
|
|
|
|
2019-08-07 13:05:49 +08:00
|
|
|
INSDEP = x86/insns.dat x86/insns.pl x86/insns-iflags.ph x86/iflags.ph
|
2016-05-26 03:06:29 +08:00
|
|
|
|
2024-04-13 03:05:52 +08:00
|
|
|
config/unconfig.h: config/config.h.in autoconf/unconfig.pl
|
|
|
|
$(RUNPERL) '$(srcdir)'/autoconf/unconfig.pl \
|
2020-07-07 02:10:30 +08:00
|
|
|
'$(srcdir)' config/config.h.in config/unconfig.h
|
|
|
|
|
2016-05-26 03:06:29 +08:00
|
|
|
x86/iflag.c: $(INSDEP)
|
|
|
|
$(RUNPERL) $(srcdir)/x86/insns.pl -fc \
|
|
|
|
$(srcdir)/x86/insns.dat x86/iflag.c
|
|
|
|
x86/iflaggen.h: $(INSDEP)
|
|
|
|
$(RUNPERL) $(srcdir)/x86/insns.pl -fh \
|
|
|
|
$(srcdir)/x86/insns.dat x86/iflaggen.h
|
|
|
|
x86/insnsb.c: $(INSDEP)
|
|
|
|
$(RUNPERL) $(srcdir)/x86/insns.pl -b \
|
|
|
|
$(srcdir)/x86/insns.dat x86/insnsb.c
|
|
|
|
x86/insnsa.c: $(INSDEP)
|
|
|
|
$(RUNPERL) $(srcdir)/x86/insns.pl -a \
|
|
|
|
$(srcdir)/x86/insns.dat x86/insnsa.c
|
|
|
|
x86/insnsd.c: $(INSDEP)
|
|
|
|
$(RUNPERL) $(srcdir)/x86/insns.pl -d \
|
|
|
|
$(srcdir)/x86/insns.dat x86/insnsd.c
|
|
|
|
x86/insnsi.h: $(INSDEP)
|
|
|
|
$(RUNPERL) $(srcdir)/x86/insns.pl -i \
|
|
|
|
$(srcdir)/x86/insns.dat x86/insnsi.h
|
|
|
|
x86/insnsn.c: $(INSDEP)
|
|
|
|
$(RUNPERL) $(srcdir)/x86/insns.pl -n \
|
|
|
|
$(srcdir)/x86/insns.dat x86/insnsn.c
|
2002-05-01 04:52:49 +08:00
|
|
|
|
2002-05-04 11:57:52 +08:00
|
|
|
# These files contains all the standard macros that are derived from
|
|
|
|
# the version number.
|
|
|
|
version.h: version version.pl
|
2016-02-18 16:54:30 +08:00
|
|
|
$(RUNPERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h
|
2002-05-04 11:57:52 +08:00
|
|
|
version.mac: version version.pl
|
2016-02-18 16:54:30 +08:00
|
|
|
$(RUNPERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac
|
2007-09-23 07:35:11 +08:00
|
|
|
version.sed: version version.pl
|
2016-02-18 16:54:30 +08:00
|
|
|
$(RUNPERL) $(srcdir)/version.pl sed < $(srcdir)/version > version.sed
|
2008-07-14 04:54:47 +08:00
|
|
|
version.mak: version version.pl
|
2016-02-18 16:54:30 +08:00
|
|
|
$(RUNPERL) $(srcdir)/version.pl make < $(srcdir)/version > version.mak
|
2016-03-04 13:37:37 +08:00
|
|
|
nsis/version.nsh: version version.pl
|
2016-03-08 04:15:40 +08:00
|
|
|
$(RUNPERL) $(srcdir)/version.pl nsis < $(srcdir)/version > nsis/version.nsh
|
2007-09-23 07:35:11 +08:00
|
|
|
|
2002-05-01 04:52:49 +08:00
|
|
|
# This source file is generated from the standard macros file
|
|
|
|
# `standard.mac' by another Perl script. Again, it's part of the
|
|
|
|
# standard distribution.
|
2016-05-26 03:06:29 +08:00
|
|
|
macros/macros.c: macros/macros.pl asm/pptok.ph version.mac \
|
2008-06-21 06:20:16 +08:00
|
|
|
$(srcdir)/macros/*.mac $(srcdir)/output/*.mac
|
2016-05-26 03:06:29 +08:00
|
|
|
$(RUNPERL) $(srcdir)/macros/macros.pl version.mac \
|
2008-06-21 06:20:16 +08:00
|
|
|
$(srcdir)/macros/*.mac $(srcdir)/output/*.mac
|
2002-06-06 10:41:20 +08:00
|
|
|
|
|
|
|
# These source files are generated from regs.dat by yet another
|
|
|
|
# perl script.
|
2016-05-26 03:06:29 +08:00
|
|
|
x86/regs.c: x86/regs.dat x86/regs.pl
|
|
|
|
$(RUNPERL) $(srcdir)/x86/regs.pl c \
|
|
|
|
$(srcdir)/x86/regs.dat > x86/regs.c
|
|
|
|
x86/regflags.c: x86/regs.dat x86/regs.pl
|
|
|
|
$(RUNPERL) $(srcdir)/x86/regs.pl fc \
|
|
|
|
$(srcdir)/x86/regs.dat > x86/regflags.c
|
|
|
|
x86/regdis.c: x86/regs.dat x86/regs.pl
|
|
|
|
$(RUNPERL) $(srcdir)/x86/regs.pl dc \
|
|
|
|
$(srcdir)/x86/regs.dat > x86/regdis.c
|
|
|
|
x86/regdis.h: x86/regs.dat x86/regs.pl
|
|
|
|
$(RUNPERL) $(srcdir)/x86/regs.pl dh \
|
|
|
|
$(srcdir)/x86/regs.dat > x86/regdis.h
|
|
|
|
x86/regvals.c: x86/regs.dat x86/regs.pl
|
|
|
|
$(RUNPERL) $(srcdir)/x86/regs.pl vc \
|
|
|
|
$(srcdir)/x86/regs.dat > x86/regvals.c
|
|
|
|
x86/regs.h: x86/regs.dat x86/regs.pl
|
|
|
|
$(RUNPERL) $(srcdir)/x86/regs.pl h \
|
|
|
|
$(srcdir)/x86/regs.dat > x86/regs.h
|
2002-05-01 04:52:49 +08:00
|
|
|
|
2020-08-19 06:07:51 +08:00
|
|
|
# Extract warnings from source code. This is done automatically if any
|
|
|
|
# C files have changed; the script is fast enough that that is
|
|
|
|
# reasonable, but doesn't update the time stamp if the files aren't
|
|
|
|
# changed, to avoid rebuilding everything every time. Track the actual
|
|
|
|
# dependency by the empty file asm/warnings.time.
|
2024-04-05 05:18:34 +08:00
|
|
|
.PHONY: warnings
|
2024-04-13 03:05:52 +08:00
|
|
|
warnings: dirs
|
2024-04-05 05:18:34 +08:00
|
|
|
$(RM_F) $(WARNFILES) $(WARNTIMES) asm/warnings.time
|
2020-08-19 06:07:51 +08:00
|
|
|
$(MAKE) asm/warnings.time
|
|
|
|
|
2024-04-05 05:18:34 +08:00
|
|
|
asm/warnings.time: $(WARNSRCS) asm/warnings.pl
|
2024-01-30 11:00:15 +08:00
|
|
|
$(EMPTY) asm/warnings.time
|
|
|
|
$(MAKE) $(WARNTIMES)
|
2018-12-14 13:53:31 +08:00
|
|
|
|
2023-01-18 05:05:55 +08:00
|
|
|
asm/warnings_c.h.time: asm/warnings.pl asm/warnings.time
|
|
|
|
$(RUNPERL) $(srcdir)/asm/warnings.pl c asm/warnings_c.h $(srcdir)
|
2024-01-30 11:00:15 +08:00
|
|
|
$(EMPTY) asm/warnings_c.h.time
|
2020-09-12 09:11:51 +08:00
|
|
|
|
2023-01-18 05:05:55 +08:00
|
|
|
asm/warnings_c.h: asm/warnings_c.h.time
|
2020-09-12 09:11:51 +08:00
|
|
|
@: Side effect
|
2018-12-14 13:53:31 +08:00
|
|
|
|
2020-09-12 09:11:51 +08:00
|
|
|
include/warnings.h.time: asm/warnings.pl asm/warnings.time
|
2018-12-14 13:53:31 +08:00
|
|
|
$(RUNPERL) $(srcdir)/asm/warnings.pl h include/warnings.h $(srcdir)
|
2024-01-30 11:00:15 +08:00
|
|
|
$(EMPTY) include/warnings.h.time
|
2018-12-14 13:53:31 +08:00
|
|
|
|
2020-09-12 09:11:51 +08:00
|
|
|
include/warnings.h: include/warnings.h.time
|
|
|
|
@: Side effect
|
|
|
|
|
|
|
|
doc/warnings.src.time: asm/warnings.pl asm/warnings.time
|
2018-12-14 13:53:31 +08:00
|
|
|
$(RUNPERL) $(srcdir)/asm/warnings.pl doc doc/warnings.src $(srcdir)
|
2024-01-30 11:00:15 +08:00
|
|
|
$(EMPTY) doc/warnings.src.time
|
2020-09-12 09:11:51 +08:00
|
|
|
|
|
|
|
doc/warnings.src : doc/warnings.src.time
|
|
|
|
@: Side effect
|
2018-12-14 13:53:31 +08:00
|
|
|
|
2007-09-12 09:29:43 +08:00
|
|
|
# Assembler token hash
|
2022-11-13 04:26:28 +08:00
|
|
|
asm/tokhash.c: x86/insns.dat x86/insnsn.c asm/tokens.dat asm/tokhash.pl \
|
2016-05-26 03:06:29 +08:00
|
|
|
perllib/phash.ph
|
|
|
|
$(RUNPERL) $(srcdir)/asm/tokhash.pl c \
|
2022-11-13 04:26:28 +08:00
|
|
|
x86/insnsn.c $(srcdir)/x86/regs.dat \
|
2016-05-26 03:06:29 +08:00
|
|
|
$(srcdir)/asm/tokens.dat > asm/tokhash.c
|
2007-08-31 05:50:20 +08:00
|
|
|
|
2007-09-25 03:30:54 +08:00
|
|
|
# Assembler token metadata
|
2022-11-13 04:26:28 +08:00
|
|
|
asm/tokens.h: x86/insns.dat x86/insnsn.c asm/tokens.dat asm/tokhash.pl \
|
2016-05-26 03:06:29 +08:00
|
|
|
perllib/phash.ph
|
|
|
|
$(RUNPERL) $(srcdir)/asm/tokhash.pl h \
|
2022-11-13 04:26:28 +08:00
|
|
|
x86/insnsn.c $(srcdir)/x86/regs.dat \
|
2016-05-26 03:06:29 +08:00
|
|
|
$(srcdir)/asm/tokens.dat > asm/tokens.h
|
2007-09-25 03:30:54 +08:00
|
|
|
|
2007-09-12 09:29:43 +08:00
|
|
|
# Preprocessor token hash
|
2016-05-26 03:06:29 +08:00
|
|
|
asm/pptok.h: asm/pptok.dat asm/pptok.pl perllib/phash.ph
|
|
|
|
$(RUNPERL) $(srcdir)/asm/pptok.pl h \
|
|
|
|
$(srcdir)/asm/pptok.dat asm/pptok.h
|
|
|
|
asm/pptok.c: asm/pptok.dat asm/pptok.pl perllib/phash.ph
|
|
|
|
$(RUNPERL) $(srcdir)/asm/pptok.pl c \
|
|
|
|
$(srcdir)/asm/pptok.dat asm/pptok.c
|
|
|
|
asm/pptok.ph: asm/pptok.dat asm/pptok.pl perllib/phash.ph
|
|
|
|
$(RUNPERL) $(srcdir)/asm/pptok.pl ph \
|
|
|
|
$(srcdir)/asm/pptok.dat asm/pptok.ph
|
2007-09-12 09:29:43 +08:00
|
|
|
|
2009-07-13 03:04:56 +08:00
|
|
|
# Directives hash
|
2017-04-03 15:09:58 +08:00
|
|
|
asm/directiv.h: asm/directiv.dat nasmlib/perfhash.pl perllib/phash.ph
|
|
|
|
$(RUNPERL) $(srcdir)/nasmlib/perfhash.pl h \
|
2016-05-26 03:06:29 +08:00
|
|
|
$(srcdir)/asm/directiv.dat asm/directiv.h
|
2017-04-03 15:09:58 +08:00
|
|
|
asm/directbl.c: asm/directiv.dat nasmlib/perfhash.pl perllib/phash.ph
|
|
|
|
$(RUNPERL) $(srcdir)/nasmlib/perfhash.pl c \
|
2017-03-08 09:56:42 +08:00
|
|
|
$(srcdir)/asm/directiv.dat asm/directbl.c
|
2009-07-13 03:04:56 +08:00
|
|
|
|
2022-11-18 04:52:52 +08:00
|
|
|
# Emacs token files
|
|
|
|
misc/nasmtok.el: misc/emacstbl.pl asm/tokhash.c asm/pptok.c \
|
|
|
|
asm/directiv.dat version
|
|
|
|
$(RUNPERL) $< $@ "$(srcdir)" "$(objdir)"
|
|
|
|
|
2017-04-04 02:13:29 +08:00
|
|
|
#-- End Generated File Rules --#
|
|
|
|
|
2024-04-13 03:05:52 +08:00
|
|
|
perlreq: dirs
|
|
|
|
$(MAKE) $(PERLREQ)
|
2017-04-06 12:24:55 +08:00
|
|
|
|
2017-04-04 02:13:29 +08:00
|
|
|
#-- Begin NSIS Rules --#
|
|
|
|
|
2016-03-04 13:37:37 +08:00
|
|
|
nsis/arch.nsh: nsis/getpearch.pl nasm$(X)
|
|
|
|
$(PERL) $(srcdir)/nsis/getpearch.pl nasm$(X) > nsis/arch.nsh
|
|
|
|
|
2016-05-17 11:30:09 +08:00
|
|
|
# Should only be done after "make everything".
|
|
|
|
# The use of redirection here keeps makensis from moving the cwd to the
|
|
|
|
# source directory.
|
2016-03-04 13:37:37 +08:00
|
|
|
nsis: nsis/nasm.nsi nsis/arch.nsh nsis/version.nsh
|
2017-04-04 02:13:29 +08:00
|
|
|
$(MAKENSIS) -Dsrcdir="$(srcdir)" -Dobjdir="$(objdir)" - < nsis/nasm.nsi
|
|
|
|
|
|
|
|
#-- End NSIS Rules --#
|
2016-03-04 13:37:37 +08:00
|
|
|
|
2024-01-30 09:19:32 +08:00
|
|
|
# Windows embedded manifest
|
|
|
|
MANIFEST_RC = win/manifest.rc
|
|
|
|
win/manifest.$(O): win/manifest.xml $(MANIFEST_RC)
|
|
|
|
$(WINDRES) -I. -Iwin -DMANIFEST_FILE='\"$<\"' -i $(MANIFEST_RC) -o $@
|
|
|
|
|
2013-10-24 20:25:51 +08:00
|
|
|
# Generated manpages, also pregenerated for distribution
|
|
|
|
manpages: nasm.1 ndisasm.1
|
|
|
|
|
2020-09-12 09:11:51 +08:00
|
|
|
install: $(PROGS)
|
2020-05-27 05:13:31 +08:00
|
|
|
$(MKDIR_P) $(DESTDIR)$(bindir)
|
2020-09-12 09:11:51 +08:00
|
|
|
$(INSTALL_PROGRAM) $(PROGS) $(DESTDIR)$(bindir)/
|
2020-05-27 05:13:31 +08:00
|
|
|
$(MKDIR_P) $(DESTDIR)$(mandir)/man1
|
2017-07-02 11:13:56 +08:00
|
|
|
$(INSTALL_DATA) $(srcdir)/nasm.1 $(DESTDIR)$(mandir)/man1/nasm.1
|
|
|
|
$(INSTALL_DATA) $(srcdir)/ndisasm.1 $(DESTDIR)$(mandir)/man1/ndisasm.1
|
2002-05-01 04:52:49 +08:00
|
|
|
|
|
|
|
clean:
|
2017-04-07 08:24:03 +08:00
|
|
|
for d in . $(SUBDIRS) $(XSUBDIRS); do \
|
2017-04-04 02:13:29 +08:00
|
|
|
$(RM_F) "$$d"/*.$(O) "$$d"/*.s "$$d"/*.i "$$d"/*.$(A) ; \
|
2016-05-26 03:06:29 +08:00
|
|
|
done
|
2020-09-12 09:11:51 +08:00
|
|
|
$(RM_F) $(PROGS)
|
2017-04-04 02:13:29 +08:00
|
|
|
$(RM_F) nasm-*-installer-*.exe
|
|
|
|
$(RM_F) tags TAGS
|
|
|
|
$(RM_F) nsis/arch.nsh
|
2017-04-24 09:33:53 +08:00
|
|
|
$(RM_F) perlbreq.si
|
2002-05-01 04:52:49 +08:00
|
|
|
|
2024-04-13 05:35:56 +08:00
|
|
|
distclean: clean
|
2017-03-01 17:23:00 +08:00
|
|
|
for d in . $(SUBDIRS) $(XSUBDIRS); do \
|
2020-06-28 07:04:38 +08:00
|
|
|
$(RM_F) "$$d"/.\# "$$d"/\# "$$d"/*~ "$$d"/*.bak \
|
|
|
|
"$$d"/*.lst "$$d"/*.bin ; \
|
2017-03-01 17:23:00 +08:00
|
|
|
done
|
2017-04-04 02:13:29 +08:00
|
|
|
$(RM_F) test/*.$(O)
|
2023-01-18 04:27:10 +08:00
|
|
|
$(RM_F) *.dep
|
2024-04-13 03:05:52 +08:00
|
|
|
-sh autoconf/clean.sh || sh '$(srcdir)'/autoconf/clean.sh
|
2002-05-01 04:54:58 +08:00
|
|
|
|
2024-04-13 05:35:56 +08:00
|
|
|
cleaner:
|
|
|
|
$(RM_F) $(PERLREQ_CL) *.1 nasm.spec
|
|
|
|
$(MAKE) -C doc clean
|
|
|
|
$(MAKE) distclean
|
|
|
|
$(RM_F) */*.time
|
2023-01-18 04:27:10 +08:00
|
|
|
|
2024-04-13 05:35:56 +08:00
|
|
|
spotless: cleaner
|
|
|
|
$(RM_F) configure autoconf/aclocal.m4 autoconf/clean.sh
|
2002-05-01 04:52:49 +08:00
|
|
|
|
2002-05-01 05:09:12 +08:00
|
|
|
strip:
|
2020-09-12 09:11:51 +08:00
|
|
|
$(STRIP) --strip-unneeded $(PROGS)
|
2002-05-01 05:09:12 +08:00
|
|
|
|
2010-11-05 19:18:51 +08:00
|
|
|
TAGS:
|
2017-04-04 02:13:29 +08:00
|
|
|
$(RM_F) TAGS
|
2010-11-05 19:18:51 +08:00
|
|
|
$(FIND) . -name '*.[hcS]' -print | xargs etags -a
|
|
|
|
|
|
|
|
tags:
|
2017-04-04 02:13:29 +08:00
|
|
|
$(RM_F) tags
|
2010-11-05 19:18:51 +08:00
|
|
|
$(FIND) . -name '*.[hcS]' -print | xargs ctags -a
|
|
|
|
|
2010-12-26 04:32:09 +08:00
|
|
|
cscope:
|
2017-04-04 02:13:29 +08:00
|
|
|
$(RM_F) cscope.out cscope.files
|
2010-12-26 04:32:09 +08:00
|
|
|
$(FIND) . -name '*.[hcS]' -print > cscope.files
|
|
|
|
cscope -b -f cscope.out
|
|
|
|
|
2024-05-21 01:54:26 +08:00
|
|
|
doc: doc/warnings.src doc/perlbreq.src
|
2017-07-02 11:13:56 +08:00
|
|
|
$(MAKE) -C doc all
|
2002-05-01 04:58:18 +08:00
|
|
|
|
|
|
|
doc_install install_doc:
|
2017-07-02 11:13:56 +08:00
|
|
|
$(MAKE) -C doc install
|
2002-05-01 04:58:18 +08:00
|
|
|
|
2020-05-27 05:13:31 +08:00
|
|
|
# Dummy target to prevent accidental invocation of the default "all" target
|
|
|
|
nothing:
|
|
|
|
|
2020-06-05 09:59:25 +08:00
|
|
|
always_everything: dirs
|
|
|
|
$(MAKE) all doc
|
2020-05-27 05:13:31 +08:00
|
|
|
|
|
|
|
everything: always_everything
|
|
|
|
$(MAKE) $(MANPAGES) $(NSIS) nothing
|
2002-05-01 04:58:18 +08:00
|
|
|
|
2022-11-08 08:49:13 +08:00
|
|
|
install_everything: everything install install_doc
|
2002-05-01 04:58:18 +08:00
|
|
|
|
2013-10-24 20:57:57 +08:00
|
|
|
dist:
|
|
|
|
$(MAKE) alldeps
|
2024-04-13 05:35:56 +08:00
|
|
|
$(MAKE) perlreq warnings spec $(MANPAGES)
|
2024-04-13 05:21:51 +08:00
|
|
|
$(MAKE) distclean
|
2023-01-18 04:27:10 +08:00
|
|
|
./autogen.sh
|
2002-05-06 07:48:07 +08:00
|
|
|
|
|
|
|
tar: dist
|
2024-04-13 05:21:51 +08:00
|
|
|
tar -cv --exclude CVS --exclude .git -C .. -f - `basename \`pwd\`` | \
|
|
|
|
$(XZ) -9e > ../nasm-`cat version`-`date +%Y%m%d`.tar.xz
|
2002-05-04 13:14:03 +08:00
|
|
|
|
2002-05-21 10:46:45 +08:00
|
|
|
spec: nasm.spec
|
|
|
|
|
2017-04-24 09:33:53 +08:00
|
|
|
ALLPERLSRC := $(shell find $(srcdir) -type f -name '*.p[lh]')
|
|
|
|
|
|
|
|
perlbreq.si: $(ALLPERLSRC)
|
2024-04-13 05:05:32 +08:00
|
|
|
sed -n -r -e 's/^[[:space:]]*use[[:space:]]+([[:upper:]][^[:space:];]*).*$$/BuildRequires: perl(\1)/p' $(ALLPERLSRC) | \
|
|
|
|
sed -r -e '/perl\((Win32.*)\)/d' | \
|
2020-05-27 05:13:31 +08:00
|
|
|
sort | uniq > perlbreq.si
|
2017-04-24 09:33:53 +08:00
|
|
|
|
2024-05-21 01:54:26 +08:00
|
|
|
doc/perlbreq.src: perlbreq.si
|
|
|
|
sed -n -r -e 's/^BuildRequires: perl\((.*)\)$$/\\c \1/p' \
|
|
|
|
< perlbreq.si > doc/perlbreq.src
|
|
|
|
echo '\c Win32 (if building on Windows only)' >> doc/perlbreq.src
|
|
|
|
|
2017-04-24 09:52:58 +08:00
|
|
|
nasm.spec: nasm.spec.in nasm.spec.sed version.sed perlbreq.si
|
|
|
|
sed -f version.sed -f nasm.spec.sed \
|
2020-05-27 05:13:31 +08:00
|
|
|
< nasm.spec.in > nasm.spec
|
2002-06-06 10:41:20 +08:00
|
|
|
|
2005-10-21 03:46:34 +08:00
|
|
|
splint:
|
2004-12-17 09:06:10 +08:00
|
|
|
splint -weak *.c
|
|
|
|
|
2020-09-12 09:11:51 +08:00
|
|
|
test: $(PROGS)
|
2016-02-18 16:54:30 +08:00
|
|
|
cd test && $(RUNPERL) performtest.pl --nasm=../nasm *.asm
|
2008-06-04 18:44:31 +08:00
|
|
|
|
2020-09-12 09:11:51 +08:00
|
|
|
golden: $(PROGS)
|
2016-02-18 16:54:30 +08:00
|
|
|
cd test && $(RUNPERL) performtest.pl --golden --nasm=../nasm *.asm
|
2013-11-24 16:26:35 +08:00
|
|
|
|
2020-09-12 09:11:51 +08:00
|
|
|
travis: $(PROGS)
|
2018-12-19 10:57:00 +08:00
|
|
|
$(PYTHON3) travis/nasm-t.py run
|
|
|
|
|
2017-11-07 14:37:37 +08:00
|
|
|
#
|
2018-12-23 10:51:59 +08:00
|
|
|
# Rules to run autogen if necessary
|
2017-11-07 14:37:37 +08:00
|
|
|
#
|
2018-12-23 10:17:16 +08:00
|
|
|
configure: configure.ac autoconf/aclocal.m4
|
2018-12-23 10:51:59 +08:00
|
|
|
sh autogen.sh --recheck
|
2017-11-07 14:37:37 +08:00
|
|
|
|
2017-11-09 02:22:10 +08:00
|
|
|
config.status: configure
|
|
|
|
@if [ ! -f config.status ]; then \
|
|
|
|
echo "*** ERROR: Need to run configure!" 1>&2 ; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2017-11-07 14:37:37 +08:00
|
|
|
sh config.status --recheck
|
|
|
|
|
2017-11-09 02:22:10 +08:00
|
|
|
Makefile: config.status Makefile.in doc/Makefile.in
|
|
|
|
sh config.status
|
2017-11-07 14:37:37 +08:00
|
|
|
|
2017-11-09 02:22:10 +08:00
|
|
|
doc/Makefile: Makefile
|
2017-11-07 14:37:37 +08:00
|
|
|
|
|
|
|
config/config.h: config.status
|
|
|
|
|
2020-05-27 05:13:31 +08:00
|
|
|
#
|
|
|
|
# Dummy rules that changes make behavior
|
|
|
|
# (at end to avoid confusing non-GNU makes)
|
|
|
|
#
|
|
|
|
.SECONDARY:
|
|
|
|
|
|
|
|
.DELETE_ON_ERROR:
|
|
|
|
|
2002-06-06 10:41:20 +08:00
|
|
|
#
|
2017-11-02 04:48:17 +08:00
|
|
|
# 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.
|
|
|
|
#
|
2024-04-13 04:17:40 +08:00
|
|
|
Makefile.dep: $(tools)/mkdep.pl config.status $(PERLREQ)
|
|
|
|
$(RUNPERL) $(tools)/mkdep.pl -s '$(top_srcdir)' \
|
|
|
|
-M $(srcdir)/Makefile.in -- $(DEPDIRS)
|
2017-11-02 04:48:17 +08:00
|
|
|
|
2017-11-07 14:37:37 +08:00
|
|
|
dep: Makefile.dep
|
2017-11-02 04:48:17 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
# This build dependencies in *ALL* makefiles, and forces all
|
|
|
|
# dependencies to be inserted inline. For that reason, it should only
|
|
|
|
# be invoked manually or via "make dist". It should be run before
|
|
|
|
# creating release archives.
|
2002-06-06 10:41:20 +08:00
|
|
|
#
|
2023-01-18 05:05:55 +08:00
|
|
|
alldeps: $(PERLREQ) $(tools)/syncfiles.pl $(tools)/mkdep.pl
|
|
|
|
$(RUNPERL) $(tools)/syncfiles.pl Makefile.in Mkfiles/*.mak
|
|
|
|
$(RUNPERL) $(tools)/mkdep.pl -i -M Makefile.in Mkfiles/*.mak -- \
|
2017-11-02 04:48:17 +08:00
|
|
|
$(DEPDIRS)
|
2017-11-07 14:37:37 +08:00
|
|
|
$(RM_F) *.dep
|
|
|
|
if [ -f config.status ]; then \
|
2017-11-09 02:22:10 +08:00
|
|
|
sh config.status; \
|
2017-11-02 04:48:17 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Strip internal dependency information from all Makefiles; this makes
|
|
|
|
# the output good for git checkin
|
2023-01-18 05:05:55 +08:00
|
|
|
cleandeps: $(PERLREQ) $(tools)/syncfiles.pl $(tools)/mkdep.pl
|
|
|
|
$(RUNPERL) $(tools)/syncfiles.pl Makefile.in Mkfiles/*.mak
|
|
|
|
$(RUNPERL) $(tools)/mkdep.pl -e -M Makefile.in Mkfiles/*.mak -- \
|
2017-11-02 04:48:17 +08:00
|
|
|
$(DEPDIRS)
|
2017-11-07 14:37:37 +08:00
|
|
|
$(RM_F) *.dep
|
|
|
|
if [ -f config.status ]; then \
|
2017-11-09 02:22:10 +08:00
|
|
|
sh config.status; \
|
2017-11-02 04:48:17 +08:00
|
|
|
fi
|
2002-06-06 10:41:20 +08:00
|
|
|
|
|
|
|
#-- Magic hints to mkdep.pl --#
|
|
|
|
# @object-ending: ".$(O)"
|
|
|
|
# @path-separator: "/"
|
2017-11-02 04:48:17 +08:00
|
|
|
# @external: "Makefile.dep"
|
2020-06-05 09:44:23 +08:00
|
|
|
# @include-command: "include"
|
2017-11-07 14:37:37 +08:00
|
|
|
# @selfrule: "1"
|
2002-06-06 10:41:20 +08:00
|
|
|
#-- Everything below is generated by mkdep.pl - do not edit --#
|
2020-06-05 09:44:23 +08:00
|
|
|
include Makefile.dep
|