diff options
author | H. Peter Anvin <hpa@zytor.com> | 2017-04-03 11:13:29 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2017-04-03 11:13:29 -0700 |
commit | 14858d7343965c7f33c87fc04ca5253ce0c1a0eb (patch) | |
tree | 8a41c8866b5672cb450ff361e004dd37906a9503 | |
parent | 1ebc83bd419da513e1701c0ae8f337266da2dddc (diff) | |
download | nasm-14858d7343965c7f33c87fc04ca5253ce0c1a0eb.tar.gz |
Makefiles: distribute file generation rules via syncfiles.pl
Distribute the file generation rules to auxiliary Makefiles via
syncfiles.pl. These rules are OS- and Make-dialect-generic enough
that our mangling script handles them well enough.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | Makefile.in | 73 | ||||
-rw-r--r-- | Mkfiles/msvc.mak | 178 | ||||
-rw-r--r-- | Mkfiles/openwcom.mak | 141 | ||||
-rw-r--r-- | rdoff/Makefile.in | 25 | ||||
-rw-r--r-- | test/Makefile | 13 |
5 files changed, 270 insertions, 160 deletions
diff --git a/Makefile.in b/Makefile.in index 07a0fe08..5785b287 100644 --- a/Makefile.in +++ b/Makefile.in @@ -50,7 +50,8 @@ XMLTO = @XMLTO@ MAKENSIS = makensis MKDIR = mkdir -RM = rm +RM_F = rm -f +RM_RF = rm -rf FIND = find # Binary suffixes @@ -132,15 +133,6 @@ LIBOBJ = stdlib/snprintf.$(O) stdlib/vsnprintf.$(O) stdlib/strlcpy.$(O) \ SUBDIRS = stdlib nasmlib output asm disasm x86 common macros XSUBDIRS = test doc nsis - -# 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 #-- End File Lists --# all: nasm$(X) ndisasm$(X) rdf @@ -148,7 +140,7 @@ all: nasm$(X) ndisasm$(X) rdf NASMLIB = libnasm.$(A) $(NASMLIB): $(LIBOBJ) - $(RM) -f $(NASMLIB) + $(RM_F) $(NASMLIB) $(AR) cq $(NASMLIB) $(LIBOBJ) $(RANLIB) $(NASMLIB) @@ -158,10 +150,21 @@ nasm$(X): $(NASM) $(NASMLIB) ndisasm$(X): $(NDISASM) $(NASMLIB) $(CC) $(LDFLAGS) -o ndisasm$(X) $(NDISASM) $(NASMLIB) $(LIBS) -# These source files are automagically generated from a single -# instruction-table file by a Perl script. They're distributed, -# though, so it isn't necessary to have Perl just to recompile NASM -# from the distribution. +#-- 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 + INSDEP = x86/insns.dat x86/insns.pl x86/insns-iflags.ph x86/iflag.c: $(INSDEP) @@ -263,6 +266,10 @@ asm/directbl.c: asm/directiv.dat nasmlib/perfhash.pl perllib/phash.ph perlreq: $(PERLREQ) +#-- End Generated File Rules --# + +#-- Begin NSIS Rules --# + # NSIS is not built except by explicit request, as it only applies to # Windows platforms nsis/arch.nsh: nsis/getpearch.pl nasm$(X) @@ -272,7 +279,9 @@ nsis/arch.nsh: nsis/getpearch.pl nasm$(X) # The use of redirection here keeps makensis from moving the cwd to the # source directory. nsis: nsis/nasm.nsi nsis/arch.nsh nsis/version.nsh - $(MAKENSIS) -Dsrcdir="$(srcdir)" -Dobjdir="$(objdir)" - < "$<" + $(MAKENSIS) -Dsrcdir="$(srcdir)" -Dobjdir="$(objdir)" - < nsis/nasm.nsi + +#-- End NSIS Rules --# # Generated manpages, also pregenerated for distribution manpages: nasm.1 ndisasm.1 @@ -287,30 +296,30 @@ install: nasm$(X) ndisasm$(X) clean: for d in . $(SUBDIRS); do \ - $(RM) -f "$$d"/*.$(O) "$$d"/*.s "$$d"/*.i "$$d"/*.$(A) ; \ + $(RM_F) "$$d"/*.$(O) "$$d"/*.s "$$d"/*.i "$$d"/*.$(A) ; \ done - $(RM) -f nasm$(X) ndisasm$(X) - $(RM) -f nasm-*-installer-*.exe - $(RM) -f tags TAGS - $(RM) -f nsis/arch.nsh + $(RM_F) nasm$(X) ndisasm$(X) + $(RM_F) nasm-*-installer-*.exe + $(RM_F) tags TAGS + $(RM_F) nsis/arch.nsh cd rdoff && $(MAKE) clean distclean: clean - $(RM) -f config.log config.status config/config.h - $(RM) -f Makefile + $(RM_F) config.log config.status config/config.h + $(RM_F) Makefile for d in . $(SUBDIRS) $(XSUBDIRS); do \ - $(RM) -f "$$d"/*~ "$$d"/*.bak "$$d"/*.lst "$$d"/*.bin ; \ + $(RM_F) "$$d"/*~ "$$d"/*.bak "$$d"/*.lst "$$d"/*.bin ; \ done - $(RM) -f test/*.$(O) - $(RM) -rf autom4te*.cache + $(RM_F) test/*.$(O) + $(RM_RF) autom4te*.cache cd rdoff && $(MAKE) distclean cleaner: clean - $(RM) -f $(PERLREQ) *.1 nasm.spec + $(RM_F) $(PERLREQ) *.1 nasm.spec cd doc && $(MAKE) clean spotless: distclean cleaner - $(RM) -f doc/Makefile + $(RM_F) doc/Makefile strip: $(STRIP) --strip-unneeded nasm$(X) ndisasm$(X) @@ -319,15 +328,15 @@ rdf: $(NASMLIB) cd rdoff && $(MAKE) all TAGS: - $(RM) -f TAGS + $(RM_F) TAGS $(FIND) . -name '*.[hcS]' -print | xargs etags -a tags: - $(RM) -f tags + $(RM_F) tags $(FIND) . -name '*.[hcS]' -print | xargs ctags -a cscope: - $(RM) -f cscope.out cscope.files + $(RM_F) cscope.out cscope.files $(FIND) . -name '*.[hcS]' -print > cscope.files cscope -b -f cscope.out @@ -349,7 +358,7 @@ dist: $(MAKE) spotless perlreq manpages spec autoheader autoconf - $(RM) -rf ./autom4te*.cache + $(RM_RF) ./autom4te*.cache tar: dist tar -cvj --exclude CVS -C .. -f ../nasm-`cat version`-`date +%Y%m%d`.tar.bz2 `basename \`pwd\`` diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak index 6a1f59d1..9860d9c9 100644 --- a/Mkfiles/msvc.mak +++ b/Mkfiles/msvc.mak @@ -39,7 +39,8 @@ INTERNAL_CFLAGS = /I$(srcdir) /I. \ ALL_CFLAGS = $(BUILD_CFLAGS) $(INTERNAL_CFLAGS) LDFLAGS = $(LDFLAGS) /SUBSYSTEM:CONSOLE /RELEASE LIBS = -PERL = perl -I$(srcdir)/perllib -I$(srcdir) +PERL = perl +PERL = $(PERL) -I$(srcdir)/perllib -I$(srcdir) # Binary suffixes O = obj @@ -114,94 +115,141 @@ ndisasm$(X): $(NDISASM) nasm.$(A) nasm.$(A): $(LIBOBJ) $(AR) $(ARFLAGS) /OUT:$@ $** -# These source files are automagically generated from a single -# instruction-table file by a Perl script. They're distributed, -# though, so it isn't necessary to have Perl just to recompile NASM -# from the distribution. - -insns.pl: insns-iflags.ph - -INSDEP = insns.dat insns.pl insns-iflags.ph - -iflag.c: $(INSDEP) - $(PERL) $(srcdir)/insns.pl -fc $(srcdir)/insns.dat -iflaggen.h: $(INSDEP) - $(PERL) $(srcdir)/insns.pl -fh $(srcdir)/insns.dat -insnsb.c: $(INSDEP) - $(PERL) $(srcdir)/insns.pl -b $(srcdir)/insns.dat -insnsa.c: $(INSDEP) - $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat -insnsd.c: $(INSDEP) - $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat -insnsi.h: $(INSDEP) - $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat -insnsn.c: $(INSDEP) - $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat +#-- Begin Generated File Rules --# +# Edit in Makefile.in, not here! + +# 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 + +INSDEP = x86/insns.dat x86/insns.pl x86/insns-iflags.ph + +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 # These files contains all the standard macros that are derived from # the version number. version.h: version version.pl - $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h - + $(RUNPERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h version.mac: version version.pl - $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac + $(RUNPERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac +version.sed: version version.pl + $(RUNPERL) $(srcdir)/version.pl sed < $(srcdir)/version > version.sed +version.mak: version version.pl + $(RUNPERL) $(srcdir)/version.pl make < $(srcdir)/version > version.mak +nsis/version.nsh: version version.pl + $(RUNPERL) $(srcdir)/version.pl nsis < $(srcdir)/version > nsis/version.nsh # This source file is generated from the standard macros file # `standard.mac' by another Perl script. Again, it's part of the # standard distribution. - -macros.c: macros.pl pptok.ph standard.mac version.mac \ +macros/macros.c: macros/macros.pl asm/pptok.ph version.mac \ $(srcdir)/macros/*.mac $(srcdir)/output/*.mac - $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.mac \ + $(RUNPERL) $(srcdir)/macros/macros.pl version.mac \ $(srcdir)/macros/*.mac $(srcdir)/output/*.mac # These source files are generated from regs.dat by yet another # perl script. -regs.c: regs.dat regs.pl - $(PERL) $(srcdir)/regs.pl c $(srcdir)/regs.dat > regs.c -regflags.c: regs.dat regs.pl - $(PERL) $(srcdir)/regs.pl fc $(srcdir)/regs.dat > regflags.c -regdis.c: regs.dat regs.pl - $(PERL) $(srcdir)/regs.pl dc $(srcdir)/regs.dat > regdis.c -regdis.h: regs.dat regs.pl - $(PERL) $(srcdir)/regs.pl dh $(srcdir)/regs.dat > regdis.h -regvals.c: regs.dat regs.pl - $(PERL) $(srcdir)/regs.pl vc $(srcdir)/regs.dat > regvals.c -regs.h: regs.dat regs.pl - $(PERL) $(srcdir)/regs.pl h $(srcdir)/regs.dat > regs.h +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 # Assembler token hash -tokhash.c: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph - $(PERL) $(srcdir)/tokhash.pl c $(srcdir)/insns.dat $(srcdir)/regs.dat \ - $(srcdir)/tokens.dat > tokhash.c +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 # Assembler token metadata -tokens.h: insns.dat regs.dat tokens.dat tokhash.pl perllib/phash.ph - $(PERL) $(srcdir)/tokhash.pl h $(srcdir)/insns.dat $(srcdir)/regs.dat \ - $(srcdir)/tokens.dat > tokens.h +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 # Preprocessor token hash -pptok.h: pptok.dat pptok.pl perllib/phash.ph - $(PERL) $(srcdir)/pptok.pl h $(srcdir)/pptok.dat pptok.h -pptok.c: pptok.dat pptok.pl perllib/phash.ph - $(PERL) $(srcdir)/pptok.pl c $(srcdir)/pptok.dat pptok.c -pptok.ph: pptok.dat pptok.pl perllib/phash.ph - $(PERL) $(srcdir)/pptok.pl ph $(srcdir)/pptok.dat pptok.ph +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 # Directives hash -directiv.h: directiv.dat directiv.pl perllib/phash.ph - $(PERL) $(srcdir)/directiv.pl h $(srcdir)/directiv.dat directiv.h -directbl.c: directiv.dat directiv.pl perllib/phash.ph - $(PERL) $(srcdir)/directiv.pl c $(srcdir)/directiv.dat directbl.c - -# This target generates all files that require perl. -# This allows easier generation of distribution (see dist target). -PERLREQ = macros.c insnsb.c insnsa.c insnsd.c insnsi.h insnsn.c \ - regs.c regs.h regflags.c regdis.c regvals.c tokhash.c tokens.h \ - version.h version.mac pptok.h pptok.c iflag.c iflaggen.h \ - directbl.c directiv.h pptok.ph regdis.h +asm/directiv.h: asm/directiv.dat nasmlib/perfhash.pl perllib/phash.ph + $(RUNPERL) $(srcdir)/nasmlib/perfhash.pl h \ + $(srcdir)/asm/directiv.dat asm/directiv.h +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 + perlreq: $(PERLREQ) +#-- End Generated File Rules --# + +#-- Begin NSIS Rules --# +# Edit in Makefile.in, not here! + +# 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 + +# Should only be done after "make everything". +# The use of redirection here keeps makensis from moving the cwd to the +# source directory. +nsis: nsis/nasm.nsi nsis/arch.nsh nsis/version.nsh + $(MAKENSIS) -Dsrcdir="$(srcdir)" -Dobjdir="$(objdir)" - < nsis/nasm.nsi + +#-- End NSIS Rules --# + clean: -del /f *.$(O) -del /f *.pdb diff --git a/Mkfiles/openwcom.mak b/Mkfiles/openwcom.mak index 358da7f6..24aefd45 100644 --- a/Mkfiles/openwcom.mak +++ b/Mkfiles/openwcom.mak @@ -22,7 +22,8 @@ LD = *wlink LDEBUG = LDFLAGS = op quiet $(%TARGET_LFLAGS) $(LDEBUG) LIBS = -PERL = perl -I$(srcdir)/perllib -I$(srcdir) +PERL = perl +RUNPERL = $(PERL) -I$(srcdir)/perllib -I$(srcdir) STRIP = wstrip @@ -132,90 +133,140 @@ ndisasm$(X): $(NDISASM) $(LIBOBJ) nasm.lib: $(LIBOBJ) wlib -q -b -n $@ $(LIBOBJ) -# These source files are automagically generated from a single -# instruction-table file by a Perl script. They're distributed, -# though, so it isn't necessary to have Perl just to recompile NASM -# from the distribution. +#-- Begin Generated File Rules --# +# Edit in Makefile.in, not here! + +# 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. -insns.pl: insns-iflags.ph +# 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 INSDEP = x86/insns.dat x86/insns.pl x86/insns-iflags.ph x86/iflag.c: $(INSDEP) - $(PERL) $(srcdir)/x86/insns.pl -fc $(srcdir)/x86/insns.dat x86/iflag.c + $(RUNPERL) $(srcdir)/x86/insns.pl -fc & + $(srcdir)/x86/insns.dat x86/iflag.c x86/iflaggen.h: $(INSDEP) - $(PERL) $(srcdir)/x86/insns.pl -fh $(srcdir)/x86/insns.dat x86/iflaggen.h + $(RUNPERL) $(srcdir)/x86/insns.pl -fh & + $(srcdir)/x86/insns.dat x86/iflaggen.h x86/insnsb.c: $(INSDEP) - $(PERL) $(srcdir)/x86/insns.pl -b $(srcdir)/x86/insns.dat x86/insnsb.c + $(RUNPERL) $(srcdir)/x86/insns.pl -b & + $(srcdir)/x86/insns.dat x86/insnsb.c x86/insnsa.c: $(INSDEP) - $(PERL) $(srcdir)/x86/insns.pl -a $(srcdir)/x86/insns.dat x86/insnsa.c + $(RUNPERL) $(srcdir)/x86/insns.pl -a & + $(srcdir)/x86/insns.dat x86/insnsa.c x86/insnsd.c: $(INSDEP) - $(PERL) $(srcdir)/x86/insns.pl -d $(srcdir)/x86/insns.dat x86/insnsd.c + $(RUNPERL) $(srcdir)/x86/insns.pl -d & + $(srcdir)/x86/insns.dat x86/insnsd.c x86/insnsi.h: $(INSDEP) - $(PERL) $(srcdir)/x86/insns.pl -i $(srcdir)/x86/insns.dat x86/insnsi.h + $(RUNPERL) $(srcdir)/x86/insns.pl -i & + $(srcdir)/x86/insns.dat x86/insnsi.h x86/insnsn.c: $(INSDEP) - $(PERL) $(srcdir)/x86/insns.pl -n $(srcdir)/x86/insns.dat x86/insnsn.c + $(RUNPERL) $(srcdir)/x86/insns.pl -n & + $(srcdir)/x86/insns.dat x86/insnsn.c # These files contains all the standard macros that are derived from # the version number. version.h: version version.pl - $(PERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h - + $(RUNPERL) $(srcdir)/version.pl h < $(srcdir)/version > version.h version.mac: version version.pl - $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac + $(RUNPERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac +version.sed: version version.pl + $(RUNPERL) $(srcdir)/version.pl sed < $(srcdir)/version > version.sed +version.mak: version version.pl + $(RUNPERL) $(srcdir)/version.pl make < $(srcdir)/version > version.mak +nsis/version.nsh: version version.pl + $(RUNPERL) $(srcdir)/version.pl nsis < $(srcdir)/version > nsis/version.nsh # This source file is generated from the standard macros file # `standard.mac' by another Perl script. Again, it's part of the # standard distribution. - -macros/macros.c: macros/macros.pl asm/pptok.ph version.mac $(srcdir)/macros/*.mac $(srcdir)/output/*.mac - $(PERL) $(srcdir)/macros/macros.pl version.mac $(srcdir)/macros/*.mac $(srcdir)/output/*.mac +macros/macros.c: macros/macros.pl asm/pptok.ph version.mac & + $(srcdir)/macros/*.mac $(srcdir)/output/*.mac + $(RUNPERL) $(srcdir)/macros/macros.pl version.mac & + $(srcdir)/macros/*.mac $(srcdir)/output/*.mac # These source files are generated from regs.dat by yet another # perl script. x86/regs.c: x86/regs.dat x86/regs.pl - $(PERL) $(srcdir)/x86/regs.pl c $(srcdir)/x86/regs.dat > x86/regs.c + $(RUNPERL) $(srcdir)/x86/regs.pl c & + $(srcdir)/x86/regs.dat > x86/regs.c x86/regflags.c: x86/regs.dat x86/regs.pl - $(PERL) $(srcdir)/x86/regs.pl fc $(srcdir)/x86/regs.dat > x86/regflags.c + $(RUNPERL) $(srcdir)/x86/regs.pl fc & + $(srcdir)/x86/regs.dat > x86/regflags.c x86/regdis.c: x86/regs.dat x86/regs.pl - $(PERL) $(srcdir)/x86/regs.pl dc $(srcdir)/x86/regs.dat > x86/regdis.c + $(RUNPERL) $(srcdir)/x86/regs.pl dc & + $(srcdir)/x86/regs.dat > x86/regdis.c x86/regdis.h: x86/regs.dat x86/regs.pl - $(PERL) $(srcdir)/x86/regs.pl dh $(srcdir)/x86/regs.dat > x86/regdis.h + $(RUNPERL) $(srcdir)/x86/regs.pl dh & + $(srcdir)/x86/regs.dat > x86/regdis.h x86/regvals.c: x86/regs.dat x86/regs.pl - $(PERL) $(srcdir)/x86/regs.pl vc $(srcdir)/x86/regs.dat > x86/regvals.c + $(RUNPERL) $(srcdir)/x86/regs.pl vc & + $(srcdir)/x86/regs.dat > x86/regvals.c x86/regs.h: x86/regs.dat x86/regs.pl - $(PERL) $(srcdir)/x86/regs.pl h $(srcdir)/x86/regs.dat > x86/regs.h + $(RUNPERL) $(srcdir)/x86/regs.pl h & + $(srcdir)/x86/regs.dat > x86/regs.h # Assembler token hash -asm/tokhash.c: x86/insns.dat x86/regs.dat asm/tokens.dat asm/tokhash.pl perllib/phash.ph - $(PERL) $(srcdir)/asm/tokhash.pl c $(srcdir)/x86/insns.dat $(srcdir)/x86/regs.dat & - $(srcdir)/asm/tokens.dat > asm/tokhash.c +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 # Assembler token metadata -asm/tokens.h: x86/insns.dat x86/regs.dat asm/tokens.dat asm/tokhash.pl perllib/phash.ph - $(PERL) $(srcdir)/asm/tokhash.pl h $(srcdir)/x86/insns.dat $(srcdir)/x86/regs.dat & - $(srcdir)/asm/tokens.dat > asm/tokens.h +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 # Preprocessor token hash asm/pptok.h: asm/pptok.dat asm/pptok.pl perllib/phash.ph - $(PERL) $(srcdir)/asm/pptok.pl h $(srcdir)/asm/pptok.dat asm/pptok.h + $(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 - $(PERL) $(srcdir)/asm/pptok.pl c $(srcdir)/asm/pptok.dat asm/pptok.c + $(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 - $(PERL) $(srcdir)/asm/pptok.pl ph $(srcdir)/asm/pptok.dat asm/pptok.ph + $(RUNPERL) $(srcdir)/asm/pptok.pl ph & + $(srcdir)/asm/pptok.dat asm/pptok.ph # Directives hash -asm/directiv.h: asm/directiv.dat asm/directiv.pl perllib/phash.ph - $(PERL) $(srcdir)/asm/directiv.pl h $(srcdir)/asm/directiv.dat asm/directiv.h -asm/directbl.c: asm/directiv.dat asm/directiv.pl perllib/phash.ph - $(PERL) $(srcdir)/asm/directiv.pl c $(srcdir)/asm/directiv.dat asm/directbl.c - -# This target generates all files that require perl. -# This allows easier generation of distribution (see dist target). -PERLREQ = macros/macros.c 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/regvals.c asm/tokhash.c asm/tokens.h & - version.h version.mac asm/pptok.h asm/pptok.c x86/iflag.c -perlreq: $(PERLREQ) .SYMBOLIC +asm/directiv.h: asm/directiv.dat nasmlib/perfhash.pl perllib/phash.ph + $(RUNPERL) $(srcdir)/nasmlib/perfhash.pl h & + $(srcdir)/asm/directiv.dat asm/directiv.h +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 + +perlreq: $(PERLREQ) + +#-- End Generated File Rules --# + +#-- Begin NSIS Rules --# +# Edit in Makefile.in, not here! + +# 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 + +# Should only be done after "make everything". +# The use of redirection here keeps makensis from moving the cwd to the +# source directory. +nsis: nsis/nasm.nsi nsis/arch.nsh nsis/version.nsh + $(MAKENSIS) -Dsrcdir="$(srcdir)" -Dobjdir="$(objdir)" - < nsis/nasm.nsi + +#-- End NSIS Rules --# clean: .SYMBOLIC rm -f *.$(O) *.s *.i diff --git a/rdoff/Makefile.in b/rdoff/Makefile.in index 404818ce..7cd1f1a8 100644 --- a/rdoff/Makefile.in +++ b/rdoff/Makefile.in @@ -34,7 +34,8 @@ INSTALL_DATA = @INSTALL_DATA@ LN_S = @LN_S@ MKDIR = mkdir -RM = rm +RM_F = rm -f +RM_RF = rm -rf LIBOBJS = rdoff.$(O) rdfload.$(O) symtab.$(O) collectn.$(O) \ rdlib.$(O) segtab.$(O) hash.$(O) @@ -58,7 +59,7 @@ PROGRAMS = rdfdump$(X) ldrdf$(X) rdx$(X) rdflib$(X) \ all: $(PROGRAMS) $(RDFLIB): $(LIBOBJS) - $(RM) -f $(RDFLIB) + $(RM_F) $(RDFLIB) $(AR) cq $(RDFLIB) $(LIBOBJS) $(RANLIB) $(RDFLIB) @@ -73,13 +74,13 @@ rdflib$(X): rdflib.$(O) $(LIBS) rdf2bin$(X): rdf2bin.$(O) $(LIBS) $(CC) $(LDFLAGS) -o rdf2bin$(X) rdf2bin.$(O) $(LIBS) rdf2com$(X): rdf2bin$(X) - rm -f rdf2com$(X) && $(LN_S) rdf2bin$(X) rdf2com$(X) + $(RM_F) rdf2com$(X) && $(LN_S) rdf2bin$(X) rdf2com$(X) rdf2ith$(X): rdf2bin$(X) - rm -f rdf2ith$(X) && $(LN_S) rdf2bin$(X) rdf2ith$(X) + $(RM_F) rdf2ith$(X) && $(LN_S) rdf2bin$(X) rdf2ith$(X) rdf2ihx$(X): rdf2bin$(X) - rm -f rdf2ihx$(X) && $(LN_S) rdf2bin$(X) rdf2ihx$(X) + $(RM_F) rdf2ihx$(X) && $(LN_S) rdf2bin$(X) rdf2ihx$(X) rdf2srec$(X): rdf2bin$(X) - rm -f rdf2srec$(X) && $(LN_S) rdf2bin$(X) rdf2srec$(X) + $(RM_F) rdf2srec$(X) && $(LN_S) rdf2bin$(X) rdf2srec$(X) rdf2ihx.$(O): rdf2ihx.c rdf2bin.$(O): rdf2bin.c @@ -96,10 +97,10 @@ rdflib.$(O): rdflib.c segtab.$(O): segtab.c clean: - rm -f *.$(O) *.$(A) $(PROGRAMS) + $(RM_F) *.$(O) *.$(A) $(PROGRAMS) spotless: clean - rm -f Makefile + $(RM_F) Makefile distclean: spotless @@ -110,9 +111,9 @@ install: all $(INSTALL_PROGRAM) rdx$(X) $(INSTALLROOT)$(bindir)/rdx$(X) $(INSTALL_PROGRAM) rdflib$(X) $(INSTALLROOT)$(bindir)/rdflib$(X) $(INSTALL_PROGRAM) rdf2bin$(X) $(INSTALLROOT)$(bindir)/rdf2bin$(X) - cd $(INSTALLROOT)$(bindir) && rm -f rdf2com$(X) && $(LN_S) rdf2bin$(X) rdf2com$(X) - cd $(INSTALLROOT)$(bindir) && rm -f rdf2ith$(X) && $(LN_S) rdf2bin$(X) rdf2ith$(X) - cd $(INSTALLROOT)$(bindir) && rm -f rdf2ihx$(X) && $(LN_S) rdf2bin$(X) rdf2ihx$(X) - cd $(INSTALLROOT)$(bindir) && rm -f rdf2srec$(X) && $(LN_S) rdf2bin$(X) rdf2srec$(X) + cd $(INSTALLROOT)$(bindir) && $(RM_F) rdf2com$(X) && $(LN_S) rdf2bin$(X) rdf2com$(X) + cd $(INSTALLROOT)$(bindir) && $(RM_F) rdf2ith$(X) && $(LN_S) rdf2bin$(X) rdf2ith$(X) + cd $(INSTALLROOT)$(bindir) && $(RM_F) rdf2ihx$(X) && $(LN_S) rdf2bin$(X) rdf2ihx$(X) + cd $(INSTALLROOT)$(bindir) && $(RM_F) rdf2srec$(X) && $(LN_S) rdf2bin$(X) rdf2srec$(X) $(MKDIR) -p $(INSTALLROOT)$(mandir)/man1 $(INSTALL_DATA) $(srcdir)/*.1 $(INSTALLROOT)$(mandir)/man1/ diff --git a/test/Makefile b/test/Makefile index 4133dbe4..07e46f7d 100644 --- a/test/Makefile +++ b/test/Makefile @@ -4,7 +4,8 @@ NASM = ../nasm NASMOPT = -Ox -I../misc $(OPT) PERL = perl TESTS = $(wildcard *.asm) -RM = rm -f +RM_F = rm -f +RM_RF = rm -rf $(NASM): $(MAKE) -C .. @@ -63,13 +64,13 @@ diff: performtest.pl $(NASM) $(TESTS) $(PERL) performtest.pl --diff --nasm='$(NASM)' $(TESTS) clean: - $(RM) *.com *.o *.o64 *.obj *.win32 *.win64 *.exe *.lst *.bin - $(RM) *.dbg *.coff *.ith *.srec *.mo32 *.mo64 *.i - $(RM) -r testresults - $(RM) elftest elftest64 + $(RM_F) *.com *.o *.o64 *.obj *.win32 *.win64 *.exe *.lst *.bin + $(RM_F) *.dbg *.coff *.ith *.srec *.mo32 *.mo64 *.i + $(RM_RF) testresults + $(RM_F) elftest elftest64 spotless: clean - $(RM) -r golden + $(RM_RF) golden # # Test for ELF32 shared libraries; assumes an x86 Linux system |