rdoff: move rdoff build into main Makefile to make it build on Windows

NSIS packages rdoff, and we really want to be able to build the full
NSIS package on an MSVC platform.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2017-04-06 17:24:03 -07:00
parent cb8094a954
commit 9a714c98a2
5 changed files with 675 additions and 595 deletions

View File

@ -52,6 +52,7 @@ MAKENSIS = makensis
MKDIR = mkdir
RM_F = rm -f
RM_RF = rm -rf
LN_S = @LN_S@
FIND = find
# Binary suffixes
@ -132,7 +133,7 @@ LIBOBJ = stdlib/snprintf.$(O) stdlib/vsnprintf.$(O) stdlib/strlcpy.$(O) \
disasm/disasm.$(O) disasm/sync.$(O)
SUBDIRS = stdlib nasmlib output asm disasm x86 common macros
XSUBDIRS = test doc nsis
XSUBDIRS = test doc nsis rdoff
#-- End File Lists --#
all: nasm$(X) ndisasm$(X) rdf
@ -268,6 +269,52 @@ asm/directbl.c: asm/directiv.dat nasmlib/perfhash.pl perllib/phash.ph
perlreq: $(PERLREQ)
#-- 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)
$(CC) $(LDFLAGS) -o rdoff/rdfdump$(X) rdoff/rdfdump.$(O) $(RDFLIBS) $(LIBS)
rdoff/ldrdf$(X): rdoff/ldrdf.$(O) $(RDFLIBS)
$(CC) $(LDFLAGS) -o rdoff/ldrdf$(X) rdoff/ldrdf.$(O) $(RDFLIBS) $(LIBS)
rdoff/rdx$(X): rdoff/rdx.$(O) $(RDFLIBS)
$(CC) $(LDFLAGS) -o rdoff/rdx$(X) rdoff/rdx.$(O) $(RDFLIBS) $(LIBS)
rdoff/rdflib$(X): rdoff/rdflib.$(O) $(RDFLIBS)
$(CC) $(LDFLAGS) -o rdoff/rdflib$(X) rdoff/rdflib.$(O) $(RDFLIBS) $(LIBS)
rdoff/rdf2bin$(X): rdoff/rdf2bin.$(O) $(RDFLIBS)
$(CC) $(LDFLAGS) -o rdoff/rdf2bin$(X) rdoff/rdf2bin.$(O) $(RDFLIBS) $(LIBS)
rdoff/rdf2com$(X): rdoff/rdf2bin$(X)
$(RM_F) rdoff/rdf2com$(X)
cd rdoff && $(LN_S) rdf2bin$(X) rdf2com$(X)
rdoff/rdf2ith$(X): rdoff/rdf2bin$(X)
$(RM_F) rdoff/rdf2ith$(X)
cd rdoff && $(LN_S) rdf2bin$(X) rdf2ith$(X)
rdoff/rdf2ihx$(X): rdoff/rdf2bin$(X)
$(RM_F) rdf2ihx$(X)
cd rdoff && $(LN_S) rdf2bin$(X) rdf2ihx$(X)
rdoff/rdf2srec$(X): rdoff/rdf2bin$(X)
$(RM_F) rdf2srec$(X)
cd rdoff && $(LN_S) rdf2bin$(X) rdf2srec$(X)
#-- End RDOFF Shared Rules --#
rdf: $(RDFPROGS) $(RDF2BINLINKS)
$(RDFLIB): $(RDFLIBOBJ)
$(RM_F) $(RDFLIB)
$(AR) cq $(RDFLIB) $(RDFLIBOBJ)
$(RANLIB) $(RDFLIB)
#-- Begin NSIS Rules --#
# NSIS is not built except by explicit request, as it only applies to
@ -295,14 +342,14 @@ install: nasm$(X) ndisasm$(X)
$(INSTALL_DATA) $(srcdir)/ndisasm.1 $(INSTALLROOT)$(mandir)/man1/ndisasm.1
clean:
for d in . $(SUBDIRS); do \
for d in . $(SUBDIRS) $(XSUBDIRS); do \
$(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
cd rdoff && $(MAKE) clean
$(RM_F) $(RDFPROGS) $(RDF2BINLINKS)
distclean: clean
$(RM_F) config.log config.status config/config.h
@ -312,7 +359,6 @@ distclean: clean
done
$(RM_F) test/*.$(O)
$(RM_RF) autom4te*.cache
cd rdoff && $(MAKE) distclean
cleaner: clean
$(RM_F) $(PERLREQ) *.1 nasm.spec
@ -324,9 +370,6 @@ spotless: distclean cleaner
strip:
$(STRIP) --strip-unneeded nasm$(X) ndisasm$(X)
rdf: $(NASMLIB)
cd rdoff && $(MAKE) all
TAGS:
$(RM_F) TAGS
$(FIND) . -name '*.[hcS]' -print | xargs etags -a
@ -340,8 +383,17 @@ cscope:
$(FIND) . -name '*.[hcS]' -print > cscope.files
cscope -b -f cscope.out
rdf_install install_rdf:
cd rdoff && $(MAKE) install
rdf_install install_rdf install_rdoff:
$(MKDIR) -p $(INSTALLROOT)$(bindir)
for f in $(RDFPROGS); do \
$(INSTALL_PROGRAM) "$$f" '$(INSTALLROOT)$(bindir)'/ ;
done
for f in $(RDF2BINLINKS); do \
$(RM_F) '$(INSTALLROOT)$(bindir)'/`basename "$$f"` ; \
$(LN_S) rdf2bin$(X) `basename "$$f"`;
done
$(MKDIR) -p $(INSTALLROOT)$(mandir)/man1
$(INSTALL_DATA) $(srcdir)/rdoff/*.1 $(INSTALLROOT)$(mandir)/man1/
doc:
cd doc && $(MAKE) all
@ -385,7 +437,7 @@ alldeps: perlreq tools/syncfiles.pl tools/mkdep.pl
$(RUNPERL) tools/syncfiles.pl Makefile.in Mkfiles/*.mak
$(RUNPERL) tools/mkdep.pl -M Makefile.in Mkfiles/*.mak -- \
. include asm common config disasm macros nasmlib \
output stdlib x86
output stdlib x86 rdoff
./config.status
#-- Magic hints to mkdep.pl --#
@ -694,6 +746,44 @@ output/outrdf2.$(O): output/outrdf2.c asm/directiv.h asm/pptok.h \
include/nasmint.h include/nasmlib.h include/opflags.h include/perfhash.h \
include/rdoff.h include/saa.h include/strlist.h include/tables.h \
output/outform.h output/outlib.h x86/insnsi.h x86/regs.h
rdoff/collectn.$(O): rdoff/collectn.c config/config.h config/msvc.h \
config/unknown.h config/watcom.h include/compiler.h include/nasmint.h \
rdoff/collectn.h
rdoff/hash.$(O): rdoff/hash.c config/config.h config/msvc.h config/unknown.h \
config/watcom.h include/compiler.h include/nasmint.h rdoff/hash.h
rdoff/ldrdf.$(O): rdoff/ldrdf.c config/config.h config/msvc.h \
config/unknown.h config/watcom.h include/compiler.h include/nasmint.h \
include/nasmlib.h include/rdoff.h rdoff/collectn.h rdoff/ldsegs.h \
rdoff/rdlib.h rdoff/segtab.h rdoff/symtab.h
rdoff/rdf2bin.$(O): rdoff/rdf2bin.c config/config.h config/msvc.h \
config/unknown.h config/watcom.h include/compiler.h include/nasmint.h \
include/nasmlib.h include/rdoff.h rdoff/rdfload.h
rdoff/rdfdump.$(O): rdoff/rdfdump.c config/config.h config/msvc.h \
config/unknown.h config/watcom.h include/compiler.h include/nasmint.h \
include/rdoff.h
rdoff/rdflib.$(O): rdoff/rdflib.c config/config.h config/msvc.h \
config/unknown.h config/watcom.h include/compiler.h include/nasmint.h
rdoff/rdfload.$(O): rdoff/rdfload.c config/config.h config/msvc.h \
config/unknown.h config/watcom.h include/compiler.h include/nasmint.h \
include/rdoff.h rdoff/collectn.h rdoff/rdfload.h rdoff/symtab.h
rdoff/rdlar.$(O): rdoff/rdlar.c config/config.h config/msvc.h \
config/unknown.h config/watcom.h include/compiler.h include/nasmint.h \
rdoff/rdlar.h
rdoff/rdlib.$(O): rdoff/rdlib.c config/config.h config/msvc.h \
config/unknown.h config/watcom.h include/compiler.h include/nasmint.h \
include/rdoff.h rdoff/rdlar.h rdoff/rdlib.h
rdoff/rdoff.$(O): rdoff/rdoff.c config/config.h config/msvc.h \
config/unknown.h config/watcom.h include/compiler.h include/nasmint.h \
include/rdoff.h
rdoff/rdx.$(O): rdoff/rdx.c config/config.h config/msvc.h config/unknown.h \
config/watcom.h include/compiler.h include/nasmint.h include/rdoff.h \
rdoff/rdfload.h rdoff/symtab.h
rdoff/segtab.$(O): rdoff/segtab.c config/config.h config/msvc.h \
config/unknown.h config/watcom.h include/compiler.h include/nasmint.h \
rdoff/segtab.h
rdoff/symtab.$(O): rdoff/symtab.c config/config.h config/msvc.h \
config/unknown.h config/watcom.h include/compiler.h include/nasmint.h \
rdoff/hash.h rdoff/symtab.h
stdlib/snprintf.$(O): stdlib/snprintf.c config/config.h config/msvc.h \
config/unknown.h config/watcom.h include/compiler.h include/nasmint.h \
include/nasmlib.h

File diff suppressed because it is too large Load Diff

View File

@ -96,7 +96,7 @@ LIBOBJ = stdlib/snprintf.$(O) stdlib/vsnprintf.$(O) stdlib/strlcpy.$(O) &
disasm/disasm.$(O) disasm/sync.$(O)
SUBDIRS = stdlib nasmlib output asm disasm x86 common macros
XSUBDIRS = test doc nsis
XSUBDIRS = test doc nsis rdoff
#-- End File Lists --#
what: .SYMBOLIC
@ -614,6 +614,39 @@ output/outrdf2.$(O): output/outrdf2.c asm/directiv.h asm/pptok.h &
include/nasmlib.h include/opflags.h include/perfhash.h include/rdoff.h &
include/saa.h include/strlist.h include/tables.h output/outform.h &
output/outlib.h x86/insnsi.h x86/regs.h
rdoff/collectn.$(O): rdoff/collectn.c config/msvc.h config/unknown.h &
config/watcom.h include/compiler.h include/nasmint.h rdoff/collectn.h
rdoff/hash.$(O): rdoff/hash.c config/msvc.h config/unknown.h config/watcom.h &
include/compiler.h include/nasmint.h rdoff/hash.h
rdoff/ldrdf.$(O): rdoff/ldrdf.c config/msvc.h config/unknown.h &
config/watcom.h include/compiler.h include/nasmint.h include/nasmlib.h &
include/rdoff.h rdoff/collectn.h rdoff/ldsegs.h rdoff/rdlib.h &
rdoff/segtab.h rdoff/symtab.h
rdoff/rdf2bin.$(O): rdoff/rdf2bin.c config/msvc.h config/unknown.h &
config/watcom.h include/compiler.h include/nasmint.h include/nasmlib.h &
include/rdoff.h rdoff/rdfload.h
rdoff/rdfdump.$(O): rdoff/rdfdump.c config/msvc.h config/unknown.h &
config/watcom.h include/compiler.h include/nasmint.h include/rdoff.h
rdoff/rdflib.$(O): rdoff/rdflib.c config/msvc.h config/unknown.h &
config/watcom.h include/compiler.h include/nasmint.h
rdoff/rdfload.$(O): rdoff/rdfload.c config/msvc.h config/unknown.h &
config/watcom.h include/compiler.h include/nasmint.h include/rdoff.h &
rdoff/collectn.h rdoff/rdfload.h rdoff/symtab.h
rdoff/rdlar.$(O): rdoff/rdlar.c config/msvc.h config/unknown.h &
config/watcom.h include/compiler.h include/nasmint.h rdoff/rdlar.h
rdoff/rdlib.$(O): rdoff/rdlib.c config/msvc.h config/unknown.h &
config/watcom.h include/compiler.h include/nasmint.h include/rdoff.h &
rdoff/rdlar.h rdoff/rdlib.h
rdoff/rdoff.$(O): rdoff/rdoff.c config/msvc.h config/unknown.h &
config/watcom.h include/compiler.h include/nasmint.h include/rdoff.h
rdoff/rdx.$(O): rdoff/rdx.c config/msvc.h config/unknown.h config/watcom.h &
include/compiler.h include/nasmint.h include/rdoff.h rdoff/rdfload.h &
rdoff/symtab.h
rdoff/segtab.$(O): rdoff/segtab.c config/msvc.h config/unknown.h &
config/watcom.h include/compiler.h include/nasmint.h rdoff/segtab.h
rdoff/symtab.$(O): rdoff/symtab.c config/msvc.h config/unknown.h &
config/watcom.h include/compiler.h include/nasmint.h rdoff/hash.h &
rdoff/symtab.h
stdlib/snprintf.$(O): stdlib/snprintf.c config/msvc.h config/unknown.h &
config/watcom.h include/compiler.h include/nasmint.h include/nasmlib.h
stdlib/strlcpy.$(O): stdlib/strlcpy.c config/msvc.h config/unknown.h &

View File

@ -222,5 +222,5 @@ dnl support ccache
dnl
PA_ARG_ENABLED([ccache], [compile with ccache], [CC="ccache $CC"], [])
AC_OUTPUT_COMMANDS([mkdir -p config nasmlib nsis output stdlib x86 asm disasm])
AC_OUTPUT(Makefile rdoff/Makefile doc/Makefile)
AC_OUTPUT_COMMANDS([mkdir -p config nasmlib nsis output stdlib x86 asm disasm rdoff])
AC_OUTPUT(Makefile doc/Makefile)

View File

@ -1,119 +0,0 @@
#
# Auto-configuring Makefile for RDOFF object file utils; part of the
# Netwide Assembler
#
# The Netwide Assembler is copyright (C) 1996 Simon Tatham and
# Julian Hall. All rights reserved. The software is
# redistributable under the license given in the file "LICENSE"
# distributed in the NASM archive.
top_srcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
mandir = @mandir@
datarootdir = @datarootdir@
CC = @CC@
CFLAGS = @CFLAGS@
BUILD_CFLAGS = $(CFLAGS) @DEFS@
INTERNAL_CFLAGS = -I$(srcdir) -I$(top_srcdir) -I$(top_srcdir)/include -I..
ALL_CFLAGS = $(BUILD_CFLAGS) $(INTERNAL_CFLAGS)
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
AR = @AR@
RANLIB = @RANLIB@
STRIP = @STRIP@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
LN_S = @LN_S@
MKDIR = mkdir
RM_F = rm -f
RM_RF = rm -rf
LIBOBJS = rdoff.$(O) rdfload.$(O) symtab.$(O) collectn.$(O) \
rdlib.$(O) segtab.$(O) hash.$(O)
RDFLIB = librdoff.$(A)
NASMLIB = ../libnasm.$(A)
LIBS = $(RDFLIB) $(NASMLIB)
# Binary suffixes
O = @OBJEXT@
X = @EXEEXT@
A = @LIBEXT@
PROGRAMS = rdfdump$(X) ldrdf$(X) rdx$(X) rdflib$(X) \
rdf2bin$(X) rdf2com$(X) rdf2ith$(X) rdf2ihx$(X) rdf2srec$(X)
.SUFFIXES: .c .i .s .$(O) .$(A) .1 .man
.c.$(O):
$(CC) -c $(ALL_CFLAGS) $<
all: $(PROGRAMS)
$(RDFLIB): $(LIBOBJS)
$(RM_F) $(RDFLIB)
$(AR) cq $(RDFLIB) $(LIBOBJS)
$(RANLIB) $(RDFLIB)
rdfdump$(X): rdfdump.$(O) $(LIBS)
$(CC) $(LDFLAGS) -o rdfdump$(X) rdfdump.$(O) $(LIBS)
ldrdf$(X): ldrdf.$(O) $(LIBS)
$(CC) $(LDFLAGS) -o ldrdf$(X) ldrdf.$(O) $(LIBS)
rdx$(X): rdx.$(O) $(LIBS)
$(CC) $(LDFLAGS) -o rdx$(X) rdx.$(O) $(LIBS)
rdflib$(X): rdflib.$(O) $(LIBS)
$(CC) $(LDFLAGS) -o 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)
rdf2ith$(X): rdf2bin$(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)
rdf2srec$(X): rdf2bin$(X)
$(RM_F) rdf2srec$(X) && $(LN_S) rdf2bin$(X) rdf2srec$(X)
rdf2ihx.$(O): rdf2ihx.c
rdf2bin.$(O): rdf2bin.c
rdfdump.$(O): rdfdump.c
rdoff.$(O): rdoff.c ../include/rdoff.h
ldrdf.$(O): ldrdf.c ../include/rdoff.h ../include/nasmlib.h symtab.h \
collectn.h rdlib.h
symtab.$(O): symtab.c symtab.h
collectn.$(O): collectn.c collectn.h
rdx.$(O): rdx.c ../include/rdoff.h rdfload.h symtab.h
rdfload.$(O): rdfload.c rdfload.h ../include/rdoff.h collectn.h symtab.h
rdlib.$(O): rdlib.c rdlib.h
rdflib.$(O): rdflib.c
segtab.$(O): segtab.c
clean:
$(RM_F) *.$(O) *.$(A) $(PROGRAMS)
spotless: clean
$(RM_F) Makefile
distclean: spotless
install: all
$(MKDIR) -p $(INSTALLROOT)$(bindir)
$(INSTALL_PROGRAM) rdfdump$(X) $(INSTALLROOT)$(bindir)/rdfdump$(X)
$(INSTALL_PROGRAM) ldrdf$(X) $(INSTALLROOT)$(bindir)/ldrdf$(X)
$(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)
$(MKDIR) -p $(INSTALLROOT)$(mandir)/man1
$(INSTALL_DATA) $(srcdir)/*.1 $(INSTALLROOT)$(mandir)/man1/