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@
|
2002-05-27 07:55:34 +08:00
|
|
|
LIBS = @LIBS@
|
2016-03-08 18:06:39 +08:00
|
|
|
|
|
|
|
AR = @AR@
|
|
|
|
RANLIB = @RANLIB@
|
|
|
|
STRIP = @STRIP@
|
|
|
|
|
2016-02-18 16:54:30 +08:00
|
|
|
PERL = perl
|
2016-05-17 12:24:26 +08:00
|
|
|
PERLFLAGS = -I$(srcdir)/perllib -I$(srcdir)
|
2016-02-18 16:54:30 +08:00
|
|
|
RUNPERL = $(PERL) $(PERLFLAGS)
|
|
|
|
|
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
|
|
|
|
2002-05-01 04:58:18 +08:00
|
|
|
NROFF = @NROFF@
|
2013-02-18 02:50:19 +08:00
|
|
|
ASCIIDOC = @ASCIIDOC@
|
|
|
|
XMLTO = @XMLTO@
|
2002-05-01 04:57:38 +08:00
|
|
|
|
2016-03-04 13:37:37 +08:00
|
|
|
MAKENSIS = makensis
|
|
|
|
|
2018-06-19 04:50:25 +08:00
|
|
|
MKDIR = 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
|
|
|
|
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
|
|
|
|
|
2017-11-07 14:37:37 +08:00
|
|
|
.SUFFIXES:
|
2018-06-19 05:02:29 +08:00
|
|
|
.SUFFIXES: $(X) .$(O) .$(A) .xml .1 .c .i .s .txt
|
2002-05-01 04:58:18 +08:00
|
|
|
|
2010-10-29 03:55:16 +08:00
|
|
|
.PHONY: all doc rdf install clean distclean cleaner spotless install_rdf test
|
2010-11-05 19:18:51 +08:00
|
|
|
.PHONY: install_doc everything install_everything strip perlreq dist tags TAGS
|
2016-03-04 13:37:37 +08:00
|
|
|
.PHONY: 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
|
|
|
|
2008-06-16 14:50:50 +08:00
|
|
|
#-- Begin File Lists --#
|
2017-03-01 10:08:21 +08:00
|
|
|
NASM = asm/nasm.$(O)
|
|
|
|
NDISASM = disasm/ndisasm.$(O)
|
|
|
|
|
|
|
|
LIBOBJ = 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) \
|
|
|
|
nasmlib/crc64.$(O) nasmlib/malloc.$(O) \
|
2017-03-08 11:23:03 +08:00
|
|
|
nasmlib/md5c.$(O) nasmlib/string.$(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) \
|
|
|
|
nasmlib/filename.$(O) nasmlib/srcfile.$(O) \
|
2017-03-01 10:08:21 +08:00
|
|
|
nasmlib/zerobuf.$(O) nasmlib/readnum.$(O) nasmlib/bsi.$(O) \
|
|
|
|
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) \
|
|
|
|
\
|
2017-03-08 11:23:03 +08:00
|
|
|
asm/error.$(O) \
|
2016-05-26 03:06:29 +08:00
|
|
|
asm/float.$(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/preproc-nop.$(O) \
|
|
|
|
asm/rdstrnum.$(O) \
|
|
|
|
\
|
|
|
|
macros/macros.$(O) \
|
|
|
|
\
|
2016-09-25 00:46:47 +08:00
|
|
|
output/outform.$(O) output/outlib.$(O) output/legacy.$(O) \
|
2017-04-24 15:23:03 +08:00
|
|
|
output/strtbl.$(O) \
|
2016-09-25 00:46:47 +08:00
|
|
|
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) \
|
2002-06-06 10:41:20 +08:00
|
|
|
output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(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
|
|
|
|
|
|
|
SUBDIRS = stdlib nasmlib output asm disasm x86 common macros
|
2017-04-07 08:24:03 +08:00
|
|
|
XSUBDIRS = test doc nsis rdoff
|
2017-11-02 04:48:17 +08:00
|
|
|
DEPDIRS = . include config x86 rdoff $(SUBDIRS)
|
2008-06-16 14:50:50 +08:00
|
|
|
#-- End File Lists --#
|
2002-05-01 04:52:49 +08:00
|
|
|
|
2016-03-04 13:37:37 +08:00
|
|
|
all: nasm$(X) ndisasm$(X) rdf
|
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
|
|
|
|
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)
|
|
|
|
|
|
|
|
nasm$(X): $(NASM) $(NASMLIB)
|
2017-07-02 11:13:56 +08:00
|
|
|
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o nasm$(X) $(NASM) $(NASMLIB) $(LIBS)
|
2016-03-08 18:06:39 +08:00
|
|
|
|
|
|
|
ndisasm$(X): $(NDISASM) $(NASMLIB)
|
2017-07-02 11:13:56 +08:00
|
|
|
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o ndisasm$(X) $(NDISASM) $(NASMLIB) $(LIBS)
|
2002-05-19 10:02:20 +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
|
|
|
|
PERLREQ = x86/insnsb.c x86/insnsa.c x86/insnsd.c x86/insnsi.h x86/insnsn.c \
|
|
|
|
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 \
|
|
|
|
version.h version.mac version.mak nsis/version.nsh
|
|
|
|
|
2017-04-04 01:33:12 +08:00
|
|
|
INSDEP = x86/insns.dat x86/insns.pl x86/insns-iflags.ph
|
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
|
|
|
|
2007-09-12 09:29:43 +08:00
|
|
|
# Assembler token hash
|
2016-05-26 03:06:29 +08:00
|
|
|
asm/tokhash.c: x86/insns.dat x86/regs.dat asm/tokens.dat asm/tokhash.pl \
|
|
|
|
perllib/phash.ph
|
|
|
|
$(RUNPERL) $(srcdir)/asm/tokhash.pl c \
|
|
|
|
$(srcdir)/x86/insns.dat $(srcdir)/x86/regs.dat \
|
|
|
|
$(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
|
2016-05-26 03:06:29 +08:00
|
|
|
asm/tokens.h: x86/insns.dat x86/regs.dat asm/tokens.dat asm/tokhash.pl \
|
|
|
|
perllib/phash.ph
|
|
|
|
$(RUNPERL) $(srcdir)/asm/tokhash.pl h \
|
|
|
|
$(srcdir)/x86/insns.dat $(srcdir)/x86/regs.dat \
|
|
|
|
$(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
|
|
|
|
2017-04-04 02:13:29 +08:00
|
|
|
#-- End Generated File Rules --#
|
|
|
|
|
2017-04-06 12:24:55 +08:00
|
|
|
perlreq: $(PERLREQ)
|
|
|
|
|
2018-06-19 04:50:25 +08:00
|
|
|
# This rule is only used for RDOFF
|
|
|
|
.$(O)$(X):
|
|
|
|
$(CC) $(ALL_CFLAGS) -o $@ $< $(LDFLAGS) $(RDFLIB) $(NASMLIB) $(LIBS)
|
|
|
|
|
|
|
|
RDFLN = cd rdoff && ln -s
|
|
|
|
RDFLNPFX =
|
|
|
|
|
2017-04-07 08:24:03 +08:00
|
|
|
#-- Begin RDOFF Shared Rules --#
|
|
|
|
|
|
|
|
RDFLIBOBJ = rdoff/rdoff.$(O) rdoff/rdfload.$(O) rdoff/symtab.$(O) \
|
|
|
|
rdoff/collectn.$(O) rdoff/rdlib.$(O) rdoff/segtab.$(O) \
|
|
|
|
rdoff/hash.$(O)
|
|
|
|
|
|
|
|
RDFPROGS = rdoff/rdfdump$(X) rdoff/ldrdf$(X) rdoff/rdx$(X) rdoff/rdflib$(X) \
|
|
|
|
rdoff/rdf2bin$(X)
|
|
|
|
RDF2BINLINKS = rdoff/rdf2com$(X) rdoff/rdf2ith$(X) \
|
|
|
|
rdoff/rdf2ihx$(X) rdoff/rdf2srec$(X)
|
|
|
|
|
|
|
|
RDFLIB = rdoff/librdoff.$(A)
|
|
|
|
RDFLIBS = $(RDFLIB) $(NASMLIB)
|
|
|
|
|
|
|
|
rdoff/rdfdump$(X): rdoff/rdfdump.$(O) $(RDFLIBS)
|
|
|
|
rdoff/ldrdf$(X): rdoff/ldrdf.$(O) $(RDFLIBS)
|
|
|
|
rdoff/rdx$(X): rdoff/rdx.$(O) $(RDFLIBS)
|
|
|
|
rdoff/rdflib$(X): rdoff/rdflib.$(O) $(RDFLIBS)
|
|
|
|
rdoff/rdf2bin$(X): rdoff/rdf2bin.$(O) $(RDFLIBS)
|
|
|
|
rdoff/rdf2com$(X): rdoff/rdf2bin$(X)
|
|
|
|
$(RM_F) rdoff/rdf2com$(X)
|
2018-06-19 04:50:25 +08:00
|
|
|
$(RDFLN) $(RDFLNPFX)rdf2bin$(X) $(RDFLNPFX)rdf2com$(X)
|
2017-04-07 08:24:03 +08:00
|
|
|
rdoff/rdf2ith$(X): rdoff/rdf2bin$(X)
|
|
|
|
$(RM_F) rdoff/rdf2ith$(X)
|
2018-06-19 04:50:25 +08:00
|
|
|
$(RDFLN) $(RDFLNPFX)rdf2bin$(X) $(RDFLNPFX)rdf2ith$(X)
|
2017-04-07 08:24:03 +08:00
|
|
|
rdoff/rdf2ihx$(X): rdoff/rdf2bin$(X)
|
2017-04-07 14:18:36 +08:00
|
|
|
$(RM_F) rdoff/rdf2ihx$(X)
|
2018-06-19 04:50:25 +08:00
|
|
|
$(RDFLN) $(RDFLNPFX)rdf2bin$(X) $(RDFLNPFX)rdf2ihx$(X)
|
2017-04-07 08:24:03 +08:00
|
|
|
rdoff/rdf2srec$(X): rdoff/rdf2bin$(X)
|
2017-04-07 14:18:36 +08:00
|
|
|
$(RM_F) rdoff/rdf2srec$(X)
|
2018-06-19 04:50:25 +08:00
|
|
|
$(RDFLN) $(RDFLNPFX)rdf2bin$(X) $(RDFLNPFX)rdf2srec$(X)
|
2017-04-07 08:24:03 +08:00
|
|
|
|
|
|
|
#-- End RDOFF Shared Rules --#
|
|
|
|
|
|
|
|
rdf: $(RDFPROGS) $(RDF2BINLINKS)
|
|
|
|
|
|
|
|
$(RDFLIB): $(RDFLIBOBJ)
|
|
|
|
$(RM_F) $(RDFLIB)
|
|
|
|
$(AR) cq $(RDFLIB) $(RDFLIBOBJ)
|
|
|
|
$(RANLIB) $(RDFLIB)
|
|
|
|
|
2017-04-04 02:13:29 +08:00
|
|
|
#-- Begin NSIS Rules --#
|
|
|
|
|
2016-03-04 13:37:37 +08:00
|
|
|
# NSIS is not built except by explicit request, as it only applies to
|
|
|
|
# Windows platforms
|
|
|
|
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
|
|
|
|
2013-10-24 20:25:51 +08:00
|
|
|
# Generated manpages, also pregenerated for distribution
|
|
|
|
manpages: nasm.1 ndisasm.1
|
|
|
|
|
2002-05-19 10:02:20 +08:00
|
|
|
install: nasm$(X) ndisasm$(X)
|
2018-06-19 04:50:25 +08:00
|
|
|
$(MKDIR) $(DESTDIR)$(bindir)
|
2017-07-02 11:13:56 +08:00
|
|
|
$(INSTALL_PROGRAM) nasm$(X) $(DESTDIR)$(bindir)/nasm$(X)
|
|
|
|
$(INSTALL_PROGRAM) ndisasm$(X) $(DESTDIR)$(bindir)/ndisasm$(X)
|
2018-06-19 04:50:25 +08:00
|
|
|
$(MKDIR) $(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
|
2017-04-04 02:13:29 +08:00
|
|
|
$(RM_F) nasm$(X) ndisasm$(X)
|
|
|
|
$(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
|
2017-04-07 08:24:03 +08:00
|
|
|
$(RM_F) $(RDFPROGS) $(RDF2BINLINKS)
|
2002-05-01 04:52:49 +08:00
|
|
|
|
2002-05-01 04:54:58 +08:00
|
|
|
distclean: clean
|
2017-04-04 02:13:29 +08:00
|
|
|
$(RM_F) config.log config.status config/config.h
|
2017-03-01 17:23:00 +08:00
|
|
|
for d in . $(SUBDIRS) $(XSUBDIRS); do \
|
2017-04-04 02:13:29 +08:00
|
|
|
$(RM_F) "$$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)
|
|
|
|
$(RM_RF) autom4te*.cache
|
2017-11-07 14:37:37 +08:00
|
|
|
$(RM_F) Makefile *.dep
|
2002-05-01 04:54:58 +08:00
|
|
|
|
|
|
|
cleaner: clean
|
2017-04-04 02:13:29 +08:00
|
|
|
$(RM_F) $(PERLREQ) *.1 nasm.spec
|
2017-07-02 11:13:56 +08:00
|
|
|
$(MAKE) -C doc clean
|
2017-11-07 14:37:37 +08:00
|
|
|
$(RM_F) *.dep
|
2002-05-01 04:54:58 +08:00
|
|
|
|
|
|
|
spotless: distclean cleaner
|
2017-04-04 02:13:29 +08:00
|
|
|
$(RM_F) doc/Makefile
|
2002-05-01 04:52:49 +08:00
|
|
|
|
2002-05-01 05:09:12 +08:00
|
|
|
strip:
|
2007-09-26 04:34:55 +08:00
|
|
|
$(STRIP) --strip-unneeded nasm$(X) ndisasm$(X)
|
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
|
|
|
|
|
2017-04-07 08:24:03 +08:00
|
|
|
rdf_install install_rdf install_rdoff:
|
2018-06-19 04:50:25 +08:00
|
|
|
$(MKDIR) $(DESTDIR)$(bindir)
|
2017-04-07 08:24:03 +08:00
|
|
|
for f in $(RDFPROGS); do \
|
2017-07-02 11:13:56 +08:00
|
|
|
$(INSTALL_PROGRAM) "$$f" '$(DESTDIR)$(bindir)'/ ; \
|
2017-04-07 08:24:03 +08:00
|
|
|
done
|
2017-07-02 11:13:56 +08:00
|
|
|
cd '$(DESTDIR)$(bindir)' && \
|
2017-04-07 08:24:03 +08:00
|
|
|
for f in $(RDF2BINLINKS); do \
|
2017-04-07 13:48:42 +08:00
|
|
|
bn=`basename "$$f"` && $(RM_F) "$$bn" && \
|
|
|
|
$(LN_S) rdf2bin$(X) "$$bn" ; \
|
2017-04-07 08:24:03 +08:00
|
|
|
done
|
2018-06-19 04:50:25 +08:00
|
|
|
$(MKDIR) $(DESTDIR)$(mandir)/man1
|
2017-07-02 11:13:56 +08:00
|
|
|
$(INSTALL_DATA) $(srcdir)/rdoff/*.1 $(DESTDIR)$(mandir)/man1/
|
2002-05-01 04:58:18 +08:00
|
|
|
|
|
|
|
doc:
|
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
|
|
|
|
2016-03-04 13:37:37 +08:00
|
|
|
everything: all manpages doc rdf
|
2002-05-01 04:58:18 +08:00
|
|
|
|
|
|
|
install_everything: everything install install_doc install_rdf
|
|
|
|
|
2013-10-24 20:57:57 +08:00
|
|
|
dist:
|
|
|
|
$(MAKE) alldeps
|
|
|
|
$(MAKE) spotless perlreq manpages spec
|
2003-09-01 12:19:37 +08:00
|
|
|
autoheader
|
2002-05-01 05:09:12 +08:00
|
|
|
autoconf
|
2017-04-04 02:13:29 +08:00
|
|
|
$(RM_RF) ./autom4te*.cache
|
2002-05-06 07:48:07 +08:00
|
|
|
|
|
|
|
tar: dist
|
2007-09-05 14:40:51 +08:00
|
|
|
tar -cvj --exclude CVS -C .. -f ../nasm-`cat version`-`date +%Y%m%d`.tar.bz2 `basename \`pwd\``
|
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)
|
2017-04-26 15:21:40 +08:00
|
|
|
sed -n -r -e 's/^[[:space:]]*use[[:space:]]+([^[:space:];]+).*$$/BuildRequires: perl(\1)/p' $(ALLPERLSRC) | \
|
|
|
|
sed -r -e '/perl\((strict|warnings|Win32.*)\)/d' | \
|
2017-04-24 09:33:53 +08:00
|
|
|
sort | uniq > perlbreq.si || ( rm -f perlbreq.si ; false )
|
|
|
|
|
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 \
|
2017-04-24 09:33:53 +08:00
|
|
|
< nasm.spec.in > nasm.spec || ( rm -f nasm.spec ; false )
|
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
|
|
|
|
|
2008-06-04 18:44:31 +08:00
|
|
|
test: nasm$(X)
|
2016-02-18 16:54:30 +08:00
|
|
|
cd test && $(RUNPERL) performtest.pl --nasm=../nasm *.asm
|
2008-06-04 18:44:31 +08:00
|
|
|
|
2013-11-24 16:26:35 +08:00
|
|
|
golden: nasm$(X)
|
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
|
|
|
|
2017-11-07 14:37:37 +08:00
|
|
|
#
|
2017-11-09 02:22:10 +08:00
|
|
|
# Rules to run autoreconf if necessary
|
2017-11-07 14:37:37 +08:00
|
|
|
#
|
2017-11-09 02:22:10 +08:00
|
|
|
configure: configure.ac aclocal.m4
|
|
|
|
autoreconf
|
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
|
|
|
|
|
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.
|
|
|
|
#
|
2017-11-07 14:37:37 +08:00
|
|
|
Makefile.dep: $(PERLREQ) tools/mkdep.pl config.status
|
2017-11-02 04:48:17 +08:00
|
|
|
$(RUNPERL) tools/mkdep.pl -M Makefile.in -- $(DEPDIRS)
|
|
|
|
|
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
|
|
|
#
|
2017-11-07 14:37:37 +08:00
|
|
|
alldeps: $(PERLREQ) tools/syncfiles.pl tools/mkdep.pl
|
2016-05-26 03:06:29 +08:00
|
|
|
$(RUNPERL) tools/syncfiles.pl Makefile.in Mkfiles/*.mak
|
2017-11-02 04:48:17 +08:00
|
|
|
$(RUNPERL) tools/mkdep.pl -i -M Makefile.in Mkfiles/*.mak -- \
|
|
|
|
$(DEPDIRS)
|
2017-11-07 14:37:37 +08:00
|
|
|
$(RM_F) *.dep
|
|
|
|
if [ -f config.status ]; then \
|
|
|
|
if [ $(EXTERNAL_DEPENDENCIES) -eq 1 ]; then \
|
2017-11-09 02:22:10 +08:00
|
|
|
sh config.status --recheck; \
|
|
|
|
fi; \
|
|
|
|
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
|
2017-11-30 07:27:51 +08:00
|
|
|
cleandeps: $(PERLREQ) tools/syncfiles.pl tools/mkdep.pl
|
2017-11-02 04:48:17 +08:00
|
|
|
$(RUNPERL) tools/syncfiles.pl Makefile.in Mkfiles/*.mak
|
|
|
|
$(RUNPERL) tools/mkdep.pl -e -M Makefile.in Mkfiles/*.mak -- \
|
|
|
|
$(DEPDIRS)
|
2017-11-07 14:37:37 +08:00
|
|
|
$(RM_F) *.dep
|
|
|
|
if [ -f config.status ]; then \
|
|
|
|
if [ $(EXTERNAL_DEPENDENCIES) -eq 0 ]; then \
|
2017-11-09 02:22:10 +08:00
|
|
|
sh config.status --recheck; \
|
|
|
|
fi; \
|
|
|
|
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"
|
|
|
|
# @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 --#
|
2017-11-02 04:48:17 +08:00
|
|
|
-include Makefile.dep
|