diff --git a/.gitignore b/.gitignore index 999e04dc..5aabc78e 100644 --- a/.gitignore +++ b/.gitignore @@ -79,6 +79,7 @@ TAGS /doc/fontpath /doc/Fontmap /editors/nasmtok.el +/editors/nasmtok.json /include/warnings.h /macros/macros.c /misc/omfdump diff --git a/Makefile.in b/Makefile.in index b866cf22..f2a2e635 100644 --- a/Makefile.in +++ b/Makefile.in @@ -6,6 +6,9 @@ @SET_MAKE@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ + top_srcdir = @top_srcdir@ srcdir = @srcdir@ objdir = @builddir@ @@ -16,6 +19,11 @@ bindir = @bindir@ mandir = @mandir@ datarootdir = @datarootdir@ datadir = @datadir@ +pkgdatadir = $(datadir)/$(PACKAGE_TARNAME) +docdir = @docdir@ +htmldir = @htmldir@ +pdfdir = @pdfdir@ +psdir = @psdir@ CC = @CC@ CFLAGS = @CFLAGS@ @@ -473,8 +481,8 @@ install: $(PROGS) $(INSTALL_DATA) $(srcdir)/ndisasm.1 $(DESTDIR)$(mandir)/man1/ndisasm.1 install_editors: $(EDITORS) - $(MKDIR_P) $(DESTDIR)$(datadir) - $(INSTALL_DATA) $(EDITORS) $(DESTDIR)$(datadir) + $(MKDIR_P) $(DESTDIR)$(pkgdatadir) + $(INSTALL_DATA) $(EDITORS) $(DESTDIR)$(pkgdatadir) clean: for d in . $(SUBDIRS) $(XSUBDIRS); do \ @@ -488,11 +496,10 @@ clean: distclean: clean for d in . $(SUBDIRS) $(XSUBDIRS); do \ - $(RM_F) "$$d"/.\# "$$d"/\# "$$d"/*~ "$$d"/*.bak \ - "$$d"/*.lst "$$d"/*.bin ; \ + $(RM_F) "$$d"/.\#* "$$d"/\#* "$$d"/*~ "$$d"/*.bak \ + "$$d"/*.lst "$$d"/*.bin "$$d"/*.dep ; \ done $(RM_F) test/*.$(O) - $(RM_F) *.dep -$(SHELL) autoconf/clean.sh || $(SHELL) $(srcdir)/autoconf/clean.sh cleaner: @@ -546,11 +553,16 @@ everything: always_everything install_everything: everything install install_doc install_editors +editor_builtin: nasm$(X) + $(SHELL) editors/dumpbuiltin.sh ./nasm$(X) > editors/builtin.mac + dist: $(MAKE) alldeps - $(MAKE) perlreq warnings spec $(MANPAGES) + $(MAKE) perlreq warnings spec + $(MAKE) editor_builtin + $(MAKE) editors $(MANPAGES) $(MAKE) distclean - ./autogen.sh + $(SHELL) autogen.sh --clearenv tar: dist tar -cv --exclude CVS --exclude .git -C .. -f - `basename \`pwd\`` | \ diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak index 1f4a2671..5288e555 100644 --- a/Mkfiles/msvc.mak +++ b/Mkfiles/msvc.mak @@ -178,8 +178,11 @@ ALLOBJ_W = $(NASM) $(LIBOBJ_W) ALLOBJ = $(PROGOBJ) $(LIBOBJ) SUBDIRS = stdlib nasmlib include config output asm disasm x86 \ common zlib macros misc -XSUBDIRS = nsis win test doc +XSUBDIRS = nsis win test doc editors DEPDIRS = . $(SUBDIRS) + +EDITORS = editors\nasmtok.el editors\nasmtok.json + #-- End File Lists --# NASMLIB = libnasm.$(A) @@ -220,7 +223,6 @@ PERLREQ_CLEANABLE = \ macros\macros.c \ asm\pptok.ph asm\directbl.c asm\directiv.h \ $(WARNFILES) \ - misc\nasmtok.el \ version.h version.mac version.mak nsis\version.nsh PERLREQ = $(PERLREQ_CLEANABLE) @@ -331,10 +333,18 @@ asm\directbl.c: asm\directiv.dat nasmlib\perfhash.pl perllib\phash.ph $(RUNPERL) $(srcdir)\nasmlib\perfhash.pl c \ $(srcdir)\asm\directiv.dat asm\directbl.c -# Emacs token files -misc\nasmtok.el: misc\emacstbl.pl asm\tokhash.c asm\pptok.c \ - asm\directiv.dat version - $(RUNPERL) $(srcdir)\misc\emacstbl.pl $@ $(srcdir) $(objdir) +# Editor token files +editors\nasmtok.el: editors\nasmtok.pl asm\tokhash.c asm\pptok.c \ + asm\directiv.dat macros\macros.c editors\builtin.mac \ + version.mak + $(RUNPERL) $(srcdir)\editors\nasmtok.pl -el $@ $(srcdir) $(objdir) + +editors\nasmtok.json: editors\nasmtok.pl asm\tokhash.c asm\pptok.c \ + asm\directiv.dat macros\macros.c editors\builtin.mac \ + version.mak + $(RUNPERL) $(srcdir)\editors\nasmtok.pl -json $@ $(srcdir) $(objdir) + +editors: $(EDITORS) #-- End Generated File Rules --# diff --git a/Mkfiles/openwcom.mak b/Mkfiles/openwcom.mak index 0638623f..b1140d02 100644 --- a/Mkfiles/openwcom.mak +++ b/Mkfiles/openwcom.mak @@ -163,8 +163,11 @@ ALLOBJ_W = $(NASM) $(LIBOBJ_W) ALLOBJ = $(PROGOBJ) $(LIBOBJ) SUBDIRS = stdlib nasmlib include config output asm disasm x86 & common zlib macros misc -XSUBDIRS = nsis win test doc +XSUBDIRS = nsis win test doc editors DEPDIRS = . $(SUBDIRS) + +EDITORS = editors\nasmtok.el editors\nasmtok.json + #-- End File Lists --# what: .SYMBOLIC @@ -229,7 +232,6 @@ PERLREQ_CLEANABLE = & macros\macros.c & asm\pptok.ph asm\directbl.c asm\directiv.h & $(WARNFILES) & - misc\nasmtok.el & version.h version.mac version.mak nsis\version.nsh PERLREQ = $(PERLREQ_CLEANABLE) @@ -340,10 +342,18 @@ asm\directbl.c: asm\directiv.dat nasmlib\perfhash.pl perllib\phash.ph $(RUNPERL) $(srcdir)\nasmlib\perfhash.pl c & $(srcdir)\asm\directiv.dat asm\directbl.c -# Emacs token files -misc\nasmtok.el: misc\emacstbl.pl asm\tokhash.c asm\pptok.c & - asm\directiv.dat version - $(RUNPERL) $(srcdir)\misc\emacstbl.pl $@ $(srcdir) $(objdir) +# Editor token files +editors\nasmtok.el: editors\nasmtok.pl asm\tokhash.c asm\pptok.c & + asm\directiv.dat macros\macros.c editors\builtin.mac & + version.mak + $(RUNPERL) $(srcdir)\editors\nasmtok.pl -el $@ $(srcdir) $(objdir) + +editors\nasmtok.json: editors\nasmtok.pl asm\tokhash.c asm\pptok.c & + asm\directiv.dat macros\macros.c editors\builtin.mac & + version.mak + $(RUNPERL) $(srcdir)\editors\nasmtok.pl -json $@ $(srcdir) $(objdir) + +editors: $(EDITORS) #-- End Generated File Rules --# diff --git a/configure.ac b/configure.ac index 865c7ede..4926e55d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,8 @@ dnl Process this file with autoconf 2.71 or later to produce dnl a configure script. AC_PREREQ([2.71]) -AC_INIT +m4_define([VERSION],m4_normalize(m4_include([version]))) +AC_INIT([nasm],VERSION,[https://bugs.nasm.us/],[nasm],[https://www.nasm.us/]) AC_CONFIG_SRCDIR([config/config.h.in]) AC_CONFIG_HEADERS([config/config.h]) AC_PREFIX_PROGRAM(nasm) diff --git a/doc/Makefile.in b/doc/Makefile.in index 6a0b0f1b..5743ab79 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -8,17 +8,26 @@ @SET_MAKE@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ + top_srcdir = @top_srcdir@ srcdir = @srcdir@ +objdir = @builddir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ mandir = @mandir@ -docdir = @docdir@ -htmldir = @htmldir@ -infodir = @infodir@ datarootdir = @datarootdir@ +datadir = @datadir@ +mydatadir = $(datadir)/$(PACKAGE_TARNAME) +docdir = @docdir@ +htmldir = @htmldir@ +pdfdir = @pdfdir@ +psdir = @psdir@ +emacsdir = $(datarootdir)/emacs/site-lisp +jsondir = $(mydatadir) INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -132,10 +141,9 @@ spotless: clean -$(RM_F) *.hlp nasmdoc.txt *.inf *.pdf *.pdf.xz *.dvi install: all - $(MKDIR_P) $(DESTDIR)$(htmldir) + $(MKDIR_P) $(DESTDIR)$(htmldir) $(DESTDIR)$(pdfdir) $(INSTALL_DATA) html/* $(DESTDIR)$(htmldir) - $(MKDIR_P) $(DESTDIR)$(docdir) - $(INSTALL_DATA) nasmdoc.pdf nasmdoc.txt $(DESTDIR)$(docdir) + $(INSTALL_DATA) nasmdoc.pdf $(DESTDIR)$(pdfdir) # # Dummy rules that changes make behavior diff --git a/editors/dumpbuiltin.sh b/editors/dumpbuiltin.sh index de9139ee..17181c75 100755 --- a/editors/dumpbuiltin.sh +++ b/editors/dumpbuiltin.sh @@ -10,7 +10,9 @@ tmp="$(mktemp -d)" [ -n "$tmp" ] || exit 1 -NASM="${NASM:-../nasm}" +if [ -n "$1" ]; then + NASM="$1" +fi : > "$tmp/junk.asm" "$NASM" -f bin -o "$tmp/junk.bin" -Lsb -l "$tmp/junk.lst" "$tmp/junk.asm" diff --git a/nasm.spec.in b/nasm.spec.in index d6896c28..34ce7f01 100644 --- a/nasm.spec.in +++ b/nasm.spec.in @@ -20,6 +20,7 @@ BuildRequires: xmlto BuildRequires: perl BuildRequires: gcc BuildRequires: make +BuildRequires: gzip BuildRequires: xz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Obsoletes: %{name}-rdoff @@ -31,7 +32,9 @@ BuildRequires: ghostscript BuildRequires: fontconfig BuildRequires: google-roboto-fonts BuildRequires: google-roboto-mono-fonts -Obsoletes: %{name}-doc < %{version}-%{release} + +%define _pkgdatadir %{_datadir}/%{name} +%define pkgdatadir %{?buildroot:%{buildroot}}%{_datadir}/%{name} %description NASM is the Netwide Assembler, a free portable assembler for the Intel @@ -52,18 +55,22 @@ make %{?_smp_mflags} everything %install rm -rf "%{buildroot}" -mkdir -p "%{buildroot}"/%{_bindir} -mkdir -p "%{buildroot}"/%{_mandir}/man1 -make DESTDIR="%{buildroot}" install +make DESTDIR="%{buildroot}" install install_editors +gzip -9 "%{pkgdatadir}"/nasmtok.* %files +%defattr(-,root,root) %doc AUTHORS +%doc LICENSE %{_bindir}/nasm %{_bindir}/ndisasm %{_mandir}/man1/nasm.1* %{_mandir}/man1/ndisasm.1* +%dir %{_pkgdatadir} +%{_pkgdatadir}/nasmtok.*.gz %files doc +%defattr(-,root,root) %doc doc/html doc/nasmdoc.pdf.xz # This is the upstream spec file; the change log is in git