diff options
Diffstat (limited to 'Mkfiles')
-rw-r--r-- | Mkfiles/README | 42 | ||||
-rw-r--r-- | Mkfiles/msvc.mak | 300 | ||||
-rw-r--r-- | Mkfiles/netware.mak | 235 | ||||
-rw-r--r-- | Mkfiles/openwcom.mak | 329 | ||||
-rw-r--r-- | Mkfiles/owlinux.mak | 339 |
5 files changed, 1245 insertions, 0 deletions
diff --git a/Mkfiles/README b/Mkfiles/README new file mode 100644 index 0000000..6bab32c --- /dev/null +++ b/Mkfiles/README @@ -0,0 +1,42 @@ +These are pre-created Makefiles for various platforms, use them if +GNU autoconf/automake packages are not supported on your system. + +The Makefiles are: + + Filename Target Compiler Tested with + --------------------------------------------------------------------------- + msvc.mak Win32 MS Visual C++ Visual C++ Express 2005 + + For building on a Win32 host using Microsoft Visual C++. + + Usage: nmake /f Mkfiles/msvc.mak + + + Filename Target Compiler Tested with + --------------------------------------------------------------------------- + openwcom.mak DOS,Win32,OS/2 OpenWatcom C OpenWatcom 1.7 (Win32) + + For building on a DOS, OS/2 or Win32 host using OpenWatcom. + OpenWatcom can be downloaded from http://www.openwatcom.org/. + + Usage: wmake /f Mkfiles/<filename> <target> + + <target> is dos, win32, or os2. + + Filename Target Compiler Tested with + --------------------------------------------------------------------------- + owlinux.mak DOS,Win32,OS/2 OpenWatcom C OpenWatcom 1.6rc2 (Linux) + + For building on a Linux host using OpenWatcom for Linux. + + Usage: make -f Mkfiles/<filename> <target> + + <target> is dos, win32, or os2. + + Filename Target Compiler Tested with + --------------------------------------------------------------------------- + netware.mak NetWare Cross-GCC Cross-GCC 3.2.3 (Linux, Win32) + + For building on a Linux or Win32 host using Cross-GCC for Linux/Win32. + + Usage: make -f Mkfiles/netware.mak diff --git a/Mkfiles/msvc.mak b/Mkfiles/msvc.mak new file mode 100644 index 0000000..7bb1cfd --- /dev/null +++ b/Mkfiles/msvc.mak @@ -0,0 +1,300 @@ +# -*- makefile -*- +# +# Makefile for building NASM using Microsoft Visual C++ and NMAKE. +# Tested on Microsoft Visual C++ 2005 Express Edition. +# +# Make sure to put the appropriate directories in your PATH, in +# the case of MSVC++ 2005, they are ...\VC\bin and ...\Common7\IDE. + +top_srcdir = . +srcdir = . +VPATH = . +prefix = C:\Program Files\NASM +exec_prefix = $(prefix) +bindir = $(prefix)/bin +mandir = $(prefix)/man + +CC = cl +CFLAGS = /O2 /Ox /Oy /W2 +BUILD_CFLAGS = $(CFLAGS) /I$(srcdir)/inttypes +INTERNAL_CFLAGS = /I$(srcdir) /I. /DHAVE__SNPRINTF /DHAVE__VSNPRINTF +ALL_CFLAGS = $(BUILD_CFLAGS) $(INTERNAL_CFLAGS) +LDFLAGS = +LIBS = +PERL = perl -I$(srcdir)/perllib + +# Binary suffixes +O = obj +X = .exe + +.SUFFIXES: .c .i .s .$(O) .1 .man + +.c.obj: + $(CC) /c $(ALL_CFLAGS) /Fo$@ $< + +#-- Begin File Lists --# +# Edit in Makefile.in, not here! +NASM = nasm.$(O) nasmlib.$(O) ver.$(O) \ + raa.$(O) saa.$(O) rbtree.$(O) \ + float.$(O) insnsa.$(O) insnsb.$(O) \ + directives.$(O) \ + assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \ + output/outform.$(O) output/outlib.$(O) output/nulldbg.$(O) \ + output/nullout.$(O) \ + output/outbin.$(O) output/outaout.$(O) output/outcoff.$(O) \ + output/outelf.$(O) output/outelf32.$(O) output/outelf64.$(O) \ + output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \ + output/outdbg.$(O) output/outieee.$(O) output/outmacho32.$(O) \ + output/outmacho64.$(O) preproc.$(O) quote.$(O) pptok.$(O) \ + macros.$(O) listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) \ + strfunc.$(O) tokhash.$(O) regvals.$(O) regflags.$(O) \ + lib/strlcpy.$(O) + +NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) ver.$(O) \ + insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O) +#-- End File Lists --# + +all: nasm$(X) ndisasm$(X) + rem cd rdoff && $(MAKE) all + +nasm$(X): $(NASM) + $(CC) $(LDFLAGS) /Fenasm$(X) $(NASM) $(LIBS) + +ndisasm$(X): $(NDISASM) + $(CC) $(LDFLAGS) /Fendisasm$(X) $(NDISASM) $(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. + +insnsb.c: insns.dat insns.pl + $(PERL) $(srcdir)/insns.pl -b $(srcdir)/insns.dat +insnsa.c: insns.dat insns.pl + $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat +insnsd.c: insns.dat insns.pl + $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat +insnsi.h: insns.dat insns.pl + $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat +insnsn.c: insns.dat insns.pl + $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat + +# 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 + +version.mac: version version.pl + $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac + +# 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 standard.mac version.mac + $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.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 +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 + +# 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 + +# 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 + +# 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 + +# 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 +perlreq: $(PERLREQ) + +clean: + -del /f *.$(O) + -del /f *.s + -del /f *.i + -del /f output\*.$(O) + -del /f output\*.s + -del /f output\*.i + -del /f nasm$(X) + -del /f ndisasm$(X) + rem cd rdoff && $(MAKE) clean + +distclean: clean + -del /f config.h + -del /f config.log + -del /f config.status + -del /f Makefile + -del /f *~ + -del /f *.bak + -del /f *.lst + -del /f *.bin + -del /f output\*~ + -del /f output\*.bak + -del /f test\*.lst + -del /f test\*.bin + -del /f test\*.$(O) + -del /f test\*.bin + -del /f/s autom4te*.cache + rem cd rdoff && $(MAKE) distclean + +cleaner: clean + -del /f $(PERLREQ) + -del /f *.man + -del /f nasm.spec + rem cd doc && $(MAKE) clean + +spotless: distclean cleaner + -del /f doc\Makefile + -del doc\*~ + -del doc\*.bak + +strip: + +rdf: + # cd rdoff && $(MAKE) + +doc: + # cd doc && $(MAKE) all + +everything: all doc rdf + +#-- Magic hints to mkdep.pl --# +# @object-ending: ".$(O)" +# @path-separator: "/" +# @exclude: "config.h" +#-- Everything below is generated by mkdep.pl - do not edit --# +assemble.$(O): assemble.c assemble.h compiler.h directives.h insns.h \ + insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tables.h \ + tokens.h +crc64.$(O): crc64.c compiler.h nasmlib.h +directives.$(O): directives.c compiler.h directives.h hashtbl.h insnsi.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h +disasm.$(O): disasm.c compiler.h directives.h disasm.h insns.h insnsi.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h regdis.h regs.h sync.h \ + tables.h tokens.h +eval.$(O): eval.c compiler.h directives.h eval.h float.h insnsi.h labels.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h +exprlib.$(O): exprlib.c compiler.h directives.h insnsi.h nasm.h nasmlib.h \ + opflags.h pptok.h preproc.h regs.h +float.$(O): float.c compiler.h directives.h float.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h +hashtbl.$(O): hashtbl.c compiler.h directives.h hashtbl.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h +insnsa.$(O): insnsa.c compiler.h directives.h insns.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +insnsb.$(O): insnsb.c compiler.h directives.h insns.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +insnsd.$(O): insnsd.c compiler.h directives.h insns.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +insnsn.$(O): insnsn.c compiler.h insnsi.h opflags.h tables.h +labels.$(O): labels.c compiler.h directives.h hashtbl.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h +lib/snprintf.$(O): lib/snprintf.c compiler.h nasmlib.h +lib/strlcpy.$(O): lib/strlcpy.c compiler.h +lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h nasmlib.h +listing.$(O): listing.c compiler.h directives.h insnsi.h listing.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h +macros.$(O): macros.c compiler.h directives.h hashtbl.h insnsi.h nasm.h \ + nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h tables.h +nasm.$(O): nasm.c assemble.h compiler.h directives.h eval.h float.h insns.h \ + insnsi.h labels.h listing.h nasm.h nasmlib.h opflags.h output/outform.h \ + parser.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h tokens.h +nasmlib.$(O): nasmlib.c compiler.h directives.h insns.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +ndisasm.$(O): ndisasm.c compiler.h directives.h disasm.h insns.h insnsi.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h sync.h tokens.h +output/nulldbg.$(O): output/nulldbg.c compiler.h directives.h insnsi.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h +output/nullout.$(O): output/nullout.c compiler.h directives.h insnsi.h \ + nasm.h nasmlib.h opflags.h output/outlib.h pptok.h preproc.h regs.h +output/outaout.$(O): output/outaout.c compiler.h directives.h eval.h \ + insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \ + pptok.h preproc.h raa.h regs.h saa.h stdscan.h +output/outas86.$(O): output/outas86.c compiler.h directives.h insnsi.h \ + nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \ + preproc.h raa.h regs.h saa.h +output/outbin.$(O): output/outbin.c compiler.h directives.h eval.h insnsi.h \ + labels.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \ + pptok.h preproc.h regs.h saa.h stdscan.h +output/outcoff.$(O): output/outcoff.c compiler.h directives.h eval.h \ + insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \ + pptok.h preproc.h raa.h regs.h saa.h +output/outdbg.$(O): output/outdbg.c compiler.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h +output/outelf.$(O): output/outelf.c compiler.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h output/dwarf.h output/elf.h output/outelf.h \ + output/outform.h pptok.h preproc.h regs.h +output/outelf32.$(O): output/outelf32.c compiler.h directives.h eval.h \ + insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \ + output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \ + preproc.h raa.h rbtree.h regs.h saa.h stdscan.h +output/outelf64.$(O): output/outelf64.c compiler.h directives.h eval.h \ + insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \ + output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \ + preproc.h raa.h rbtree.h regs.h saa.h stdscan.h +output/outform.$(O): output/outform.c compiler.h directives.h insnsi.h \ + nasm.h nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h +output/outieee.$(O): output/outieee.c compiler.h directives.h insnsi.h \ + nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \ + preproc.h regs.h +output/outlib.$(O): output/outlib.c compiler.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h output/outlib.h pptok.h preproc.h regs.h +output/outmacho32.$(O): output/outmacho32.c compiler.h directives.h eval.h \ + insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \ + pptok.h preproc.h raa.h regs.h saa.h +output/outmacho64.$(O): output/outmacho64.c compiler.h directives.h insnsi.h \ + nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \ + preproc.h raa.h regs.h saa.h +output/outobj.$(O): output/outobj.c compiler.h directives.h eval.h insnsi.h \ + nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \ + preproc.h regs.h stdscan.h +output/outrdf2.$(O): output/outrdf2.c compiler.h directives.h insnsi.h \ + nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \ + preproc.h rdoff/rdoff.h regs.h saa.h +parser.$(O): parser.c compiler.h directives.h eval.h float.h insns.h \ + insnsi.h nasm.h nasmlib.h opflags.h parser.h pptok.h preproc.h regs.h \ + stdscan.h tables.h tokens.h +pptok.$(O): pptok.c compiler.h hashtbl.h nasmlib.h pptok.h preproc.h +preproc.$(O): preproc.c compiler.h directives.h eval.h hashtbl.h insnsi.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h \ + tables.h tokens.h +quote.$(O): quote.c compiler.h nasmlib.h quote.h +raa.$(O): raa.c compiler.h nasmlib.h raa.h +rbtree.$(O): rbtree.c compiler.h rbtree.h +regdis.$(O): regdis.c regdis.h regs.h +regflags.$(O): regflags.c compiler.h directives.h insnsi.h nasm.h nasmlib.h \ + opflags.h pptok.h preproc.h regs.h tables.h +regs.$(O): regs.c compiler.h insnsi.h opflags.h tables.h +regvals.$(O): regvals.c compiler.h insnsi.h opflags.h tables.h +saa.$(O): saa.c compiler.h nasmlib.h saa.h +stdscan.$(O): stdscan.c compiler.h directives.h insns.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h tokens.h +strfunc.$(O): strfunc.c compiler.h directives.h insnsi.h nasm.h nasmlib.h \ + opflags.h pptok.h preproc.h regs.h +sync.$(O): sync.c compiler.h nasmlib.h sync.h +tokhash.$(O): tokhash.c compiler.h directives.h hashtbl.h insns.h insnsi.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +ver.$(O): ver.c compiler.h directives.h insnsi.h nasm.h nasmlib.h opflags.h \ + pptok.h preproc.h regs.h version.h diff --git a/Mkfiles/netware.mak b/Mkfiles/netware.mak new file mode 100644 index 0000000..fbd19bf --- /dev/null +++ b/Mkfiles/netware.mak @@ -0,0 +1,235 @@ +# -*- makefile -*- GNU Makefile for NetWare target + +PROOT=. +OBJDIR=release + +-include $(OBJDIR)/version.mak + +TARGETS=nasm.nlm ndisasm.nlm + +PERL=perl + +CROSSPREFIX=i586-netware- + +CC=$(CROSSPREFIX)gcc +LD=$(CC) + +BINSUFFIX=.nlm + +VERSION=$(NASM_MAJOR_VER).$(NASM_MINOR_VER).$(NASM_SUBMINOR_VER) + +CFLAGS=-g -O2 -Wall -std=c99 -pedantic -D__NETWARE__ -D_POSIX_SOURCE -DHAVE_CONFIG_H -I. +LDFLAGS=-Wl,--nlm-description="NASM $(NASM_VER) - the Netwide Assembler (gcc build)" +LDFLAGS+=-Wl,--nlm-copyright="NASM is licensed under LGPL." +LDFLAGS+=-Wl,--nlm-version=$(VERSION) +LDFLAGS+=-Wl,--nlm-kernelspace +LDFLAGS+=-Wl,--nlm-posixflag +LDFLAGS+=-s + +O = o + +#-- Begin File Lists --# +# Edit in Makefile.in, not here! +NASM = nasm.o nasmlib.o ver.o \ + raa.o saa.o rbtree.o \ + float.o insnsa.o insnsb.o \ + directives.o \ + assemble.o labels.o hashtbl.o crc64.o parser.o \ + outform.o outlib.o nulldbg.o \ + nullout.o \ + outbin.o outaout.o outcoff.o \ + outelf.o outelf32.o outelf64.o \ + outobj.o outas86.o outrdf2.o \ + outdbg.o outieee.o outmacho32.o \ + outmacho64.o preproc.o quote.o pptok.o \ + macros.o listing.o eval.o exprlib.o stdscan.o \ + strfunc.o tokhash.o regvals.o regflags.o \ + strlcpy.o + +NDISASM = ndisasm.o disasm.o sync.o nasmlib.o ver.o \ + insnsd.o insnsb.o insnsn.o regs.o regdis.o +#-- End File Lists --# + +NASM_OBJ = $(addprefix $(OBJDIR)/,$(notdir $(NASM))) $(EOLIST) +NDIS_OBJ = $(addprefix $(OBJDIR)/,$(notdir $(NDISASM))) $(EOLIST) + +VPATH = *.c $(PROOT) $(PROOT)/output + + +all: $(OBJDIR) config.h $(TARGETS) + +$(OBJDIR)/%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +nasm$(BINSUFFIX): $(NASM_OBJ) + $(LD) $(LDFLAGS) -o $@ $^ + +ndisasm$(BINSUFFIX): $(NDIS_OBJ) + $(LD) $(LDFLAGS) -o $@ $^ + +$(OBJDIR): + @mkdir $@ + +config.h: $(PROOT)/Mkfiles/netware.mak + @echo Creating $@ + @echo $(DL)/* $@ for NetWare target.$(DL) > $@ + @echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@ + @echo $(DL)** All your changes will be lost!!$(DL) >> $@ + @echo $(DL)*/$(DL) >> $@ + @echo $(DL)#ifndef __NETWARE__$(DL) >> $@ + @echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@ + @echo $(DL)#endif$(DL) >> $@ + @echo $(DL)#define PACKAGE_VERSION "$(NASM_VER)"$(DL) >> $@ + @echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@ + @echo $(DL)#define HAVE_DECL_STRCASECMP 1$(DL) >> $@ + @echo $(DL)#define HAVE_DECL_STRICMP 1$(DL) >> $@ + @echo $(DL)#define HAVE_DECL_STRNCASECMP 1$(DL) >> $@ + @echo $(DL)#define HAVE_DECL_STRNICMP 1$(DL) >> $@ + @echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_MEMORY_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_SNPRINTF 1$(DL) >> $@ + @echo $(DL)#define HAVE_STDBOOL_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@ + @echo $(DL)#define HAVE_STRCSPN 1$(DL) >> $@ + @echo $(DL)#define HAVE_STRICMP 1$(DL) >> $@ + @echo $(DL)#define HAVE_STRINGS_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_STRNCASECMP 1$(DL) >> $@ + @echo $(DL)#define HAVE_STRNICMP 1$(DL) >> $@ + @echo $(DL)#define HAVE_STRSPN 1$(DL) >> $@ + @echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_SYS_TYPES_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@ + @echo $(DL)#define HAVE_VSNPRINTF 1$(DL) >> $@ + @echo $(DL)#define STDC_HEADERS 1$(DL) >> $@ + @echo $(DL)#ifndef _GNU_SOURCE$(DL) >> $@ + @echo $(DL)#define _GNU_SOURCE 1$(DL) >> $@ + @echo $(DL)#endif$(DL) >> $@ + @echo $(DL)#define ldiv __CW_ldiv$(DL) >> $@ + +clean: + -$(RM) -r $(OBJDIR) + -$(RM) config.h + +distclean: clean + -$(RM) $(TARGETS) + +$(OBJDIR)/version.mak: $(PROOT)/version $(PROOT)/version.pl $(OBJDIR) + @$(PERL) $(PROOT)/version.pl make < $< > $@ + +#-- Magic hints to mkdep.pl --# +# @object-ending: ".o" +# @path-separator: "" +# @continuation: "\" +#-- Everything below is generated by mkdep.pl - do not edit --# +assemble.o: assemble.c assemble.h compiler.h config.h directives.h insns.h \ + insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tables.h \ + tokens.h +crc64.o: crc64.c compiler.h config.h nasmlib.h +directives.o: directives.c compiler.h config.h directives.h hashtbl.h \ + insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h +disasm.o: disasm.c compiler.h config.h directives.h disasm.h insns.h \ + insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regdis.h regs.h \ + sync.h tables.h tokens.h +eval.o: eval.c compiler.h config.h directives.h eval.h float.h insnsi.h \ + labels.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h +exprlib.o: exprlib.c compiler.h config.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h +float.o: float.c compiler.h config.h directives.h float.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h +hashtbl.o: hashtbl.c compiler.h config.h directives.h hashtbl.h insnsi.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h +insnsa.o: insnsa.c compiler.h config.h directives.h insns.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +insnsb.o: insnsb.c compiler.h config.h directives.h insns.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +insnsd.o: insnsd.c compiler.h config.h directives.h insns.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +insnsn.o: insnsn.c compiler.h config.h insnsi.h opflags.h tables.h +labels.o: labels.c compiler.h config.h directives.h hashtbl.h insnsi.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h +snprintf.o: snprintf.c compiler.h config.h nasmlib.h +strlcpy.o: strlcpy.c compiler.h config.h +vsnprintf.o: vsnprintf.c compiler.h config.h nasmlib.h +listing.o: listing.c compiler.h config.h directives.h insnsi.h listing.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h +macros.o: macros.c compiler.h config.h directives.h hashtbl.h insnsi.h \ + nasm.h nasmlib.h opflags.h outform.h pptok.h preproc.h regs.h tables.h +nasm.o: nasm.c assemble.h compiler.h config.h directives.h eval.h float.h \ + insns.h insnsi.h labels.h listing.h nasm.h nasmlib.h opflags.h outform.h \ + parser.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h tokens.h +nasmlib.o: nasmlib.c compiler.h config.h directives.h insns.h insnsi.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +ndisasm.o: ndisasm.c compiler.h config.h directives.h disasm.h insns.h \ + insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h sync.h \ + tokens.h +nulldbg.o: nulldbg.c compiler.h config.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h +nullout.o: nullout.c compiler.h config.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h outlib.h pptok.h preproc.h regs.h +outaout.o: outaout.c compiler.h config.h directives.h eval.h insnsi.h nasm.h \ + nasmlib.h opflags.h outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h \ + stdscan.h +outas86.o: outas86.c compiler.h config.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h +outbin.o: outbin.c compiler.h config.h directives.h eval.h insnsi.h labels.h \ + nasm.h nasmlib.h opflags.h outform.h outlib.h pptok.h preproc.h regs.h \ + saa.h stdscan.h +outcoff.o: outcoff.c compiler.h config.h directives.h eval.h insnsi.h nasm.h \ + nasmlib.h opflags.h outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h +outdbg.o: outdbg.c compiler.h config.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h outform.h pptok.h preproc.h regs.h +outelf.o: outelf.c compiler.h config.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h dwarf.h elf.h outelf.h outform.h pptok.h preproc.h \ + regs.h +outelf32.o: outelf32.c compiler.h config.h directives.h eval.h insnsi.h \ + nasm.h nasmlib.h opflags.h dwarf.h elf.h outelf.h outform.h outlib.h \ + stabs.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h +outelf64.o: outelf64.c compiler.h config.h directives.h eval.h insnsi.h \ + nasm.h nasmlib.h opflags.h dwarf.h elf.h outelf.h outform.h outlib.h \ + stabs.h pptok.h preproc.h raa.h rbtree.h regs.h saa.h stdscan.h +outform.o: outform.c compiler.h config.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h outform.h pptok.h preproc.h regs.h +outieee.o: outieee.c compiler.h config.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h outform.h outlib.h pptok.h preproc.h regs.h +outlib.o: outlib.c compiler.h config.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h outlib.h pptok.h preproc.h regs.h +outmacho32.o: outmacho32.c compiler.h config.h directives.h eval.h insnsi.h \ + nasm.h nasmlib.h opflags.h outform.h outlib.h pptok.h preproc.h raa.h \ + regs.h saa.h +outmacho64.o: outmacho64.c compiler.h config.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h outform.h outlib.h pptok.h preproc.h raa.h regs.h saa.h +outobj.o: outobj.c compiler.h config.h directives.h eval.h insnsi.h nasm.h \ + nasmlib.h opflags.h outform.h outlib.h pptok.h preproc.h regs.h stdscan.h +outrdf2.o: outrdf2.c compiler.h config.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h outform.h outlib.h pptok.h preproc.h rdoff.h regs.h \ + saa.h +parser.o: parser.c compiler.h config.h directives.h eval.h float.h insns.h \ + insnsi.h nasm.h nasmlib.h opflags.h parser.h pptok.h preproc.h regs.h \ + stdscan.h tables.h tokens.h +pptok.o: pptok.c compiler.h config.h hashtbl.h nasmlib.h pptok.h preproc.h +preproc.o: preproc.c compiler.h config.h directives.h eval.h hashtbl.h \ + insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h \ + stdscan.h tables.h tokens.h +quote.o: quote.c compiler.h config.h nasmlib.h quote.h +raa.o: raa.c compiler.h config.h nasmlib.h raa.h +rbtree.o: rbtree.c compiler.h config.h rbtree.h +regdis.o: regdis.c regdis.h regs.h +regflags.o: regflags.c compiler.h config.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h tables.h +regs.o: regs.c compiler.h config.h insnsi.h opflags.h tables.h +regvals.o: regvals.c compiler.h config.h insnsi.h opflags.h tables.h +saa.o: saa.c compiler.h config.h nasmlib.h saa.h +stdscan.o: stdscan.c compiler.h config.h directives.h insns.h insnsi.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h \ + tokens.h +strfunc.o: strfunc.c compiler.h config.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h +sync.o: sync.c compiler.h config.h nasmlib.h sync.h +tokhash.o: tokhash.c compiler.h config.h directives.h hashtbl.h insns.h \ + insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +ver.o: ver.c compiler.h config.h directives.h insnsi.h nasm.h nasmlib.h \ + opflags.h pptok.h preproc.h regs.h version.h diff --git a/Mkfiles/openwcom.mak b/Mkfiles/openwcom.mak new file mode 100644 index 0000000..32a67c4 --- /dev/null +++ b/Mkfiles/openwcom.mak @@ -0,0 +1,329 @@ +# -*- makefile -*- +# +# Makefile for building NASM using OpenWatcom 1.7 +# building on a DOS/Win/OS2 platform host (backslashes +# used in pathnames) +# + +top_srcdir = . +srcdir = . +VPATH = .\output +prefix = C:\Program Files\NASM +exec_prefix = $(prefix) +bindir = $(prefix)\bin +mandir = $(prefix)\man + +CC = wcl386 +DEBUG = +CFLAGS = -6 -ox -wx -ze -fpi $(DEBUG) +BUILD_CFLAGS = $(CFLAGS) $(TARGET_FLAGS) # -I$(srcdir)/inttypes +INTERNAL_CFLAGS = -I$(srcdir) -I. -DHAVE_SNPRINTF -DHAVE_VSNPRINTF +ALL_CFLAGS = $(BUILD_CFLAGS) $(INTERNAL_CFLAGS) +LD = $(CC) +LDFLAGS = $(ALL_CFLAGS) +LIBS = +PERL = perl -I$(srcdir)/perllib + +STRIP = wstrip + +# Binary suffixes +O = obj +X = .exe + +# WMAKE errors out if a suffix is declared more than once, including +# its own built-in declarations. Thus, we need to explicitly clear the list +# first. Also, WMAKE only allows implicit rules that point "to the left" +# in this list! +.SUFFIXES: +.SUFFIXES: .man .1 .$(O) .i .c + +# Needed to find C files anywhere but in the current directory +.c : $(VPATH) + +.c.$(O): + $(CC) -c $(ALL_CFLAGS) -fo=$^@ $[@ + +# Note: wcl386 is broken if forward slashes are used as path separators. +#-- Begin File Lists --# +# Edit in Makefile.in, not here! +NASM = nasm.$(O) nasmlib.$(O) ver.$(O) & + raa.$(O) saa.$(O) rbtree.$(O) & + float.$(O) insnsa.$(O) insnsb.$(O) & + directives.$(O) & + assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) & + output\outform.$(O) output\outlib.$(O) output\nulldbg.$(O) & + output\nullout.$(O) & + output\outbin.$(O) output\outaout.$(O) output\outcoff.$(O) & + output\outelf.$(O) output\outelf32.$(O) output\outelf64.$(O) & + output\outobj.$(O) output\outas86.$(O) output\outrdf2.$(O) & + output\outdbg.$(O) output\outieee.$(O) output\outmacho32.$(O) & + output\outmacho64.$(O) preproc.$(O) quote.$(O) pptok.$(O) & + macros.$(O) listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) & + strfunc.$(O) tokhash.$(O) regvals.$(O) regflags.$(O) & + lib\strlcpy.$(O) + +NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) ver.$(O) & + insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O) +#-- End File Lists --# + +what: .SYMBOLIC + @echo Please build "dos", "win32" or "os2" + +dos: .SYMBOLIC + $(MAKE) /f $(__MAKEFILES__) all TARGET_FLAGS="-bt=DOS -l=DOS4G" + +win32: .SYMBOLIC + $(MAKE) /f $(__MAKEFILES__) all TARGET_FLAGS="-bt=NT -l=NT" + +os2: .SYMBOLIC + $(MAKE) /f $(__MAKEFILES__) all TARGET_FLAGS="-bt=OS2 -l=OS2V2" + +all: nasm$(X) ndisasm$(X) .SYMBOLIC + rem cd rdoff && $(MAKE) all + +nasm$(X): $(NASM) + $(LD) $(LDFLAGS) -fe=nasm$(X) $(NASM) $(LIBS) + +ndisasm$(X): $(NDISASM) + $(LD) $(LDFLAGS) -fe=ndisasm$(X) $(NDISASM) $(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. + +insnsb.c: insns.dat insns.pl + $(PERL) $(srcdir)/insns.pl -b $(srcdir)/insns.dat +insnsa.c: insns.dat insns.pl + $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat +insnsd.c: insns.dat insns.pl + $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat +insnsi.h: insns.dat insns.pl + $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat +insnsn.c: insns.dat insns.pl + $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat + +# 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 + +version.mac: version version.pl + $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac + +# 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 standard.mac version.mac + $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.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 + +# 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 + +# 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 + +# 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 + +# 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 regdis.h regvals.c & + tokhash.c tokens.h pptok.h pptok.c & + version.h version.mac +perlreq: $(PERLREQ) + +clean: .SYMBOLIC + -del /f *.$(O) + -del /f *.s + -del /f *.i + -del /f output\*.$(O) + -del /f output\*.s + -del /f output\*.i + -del /f nasm$(X) + -del /f ndisasm$(X) + rem cd rdoff && $(MAKE) clean + +distclean: clean .SYMBOLIC + -del /f config.h + -del /f config.log + -del /f config.status + -del /f Makefile + -del /f *~ + -del /f *.bak + -del /f *.lst + -del /f *.bin + -del /f output\*~ + -del /f output\*.bak + -del /f test\*.lst + -del /f test\*.bin + -del /f test\*.$(O) + -del /f test\*.bin + -del /f/s autom4te*.cache + rem cd rdoff && $(MAKE) distclean + +cleaner: clean .SYMBOLIC + -del /f $(PERLREQ) + -del /f *.man + -del /f nasm.spec + rem cd doc && $(MAKE) clean + +spotless: distclean cleaner .SYMBOLIC + -del /f doc\Makefile + -del doc\*~ + -del doc\*.bak + +strip: .SYMBOLIC + $(STRIP) *.exe + +rdf: + # cd rdoff && $(MAKE) + +doc: + # cd doc && $(MAKE) all + +everything: all doc rdf + +#-- Magic hints to mkdep.pl --# +# @object-ending: ".$(O)" +# @path-separator: "\" +# @exclude: "config.h" +# @continuation: "&" +#-- Everything below is generated by mkdep.pl - do not edit --# +assemble.$(O): assemble.c assemble.h compiler.h directives.h insns.h & + insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tables.h & + tokens.h +crc64.$(O): crc64.c compiler.h nasmlib.h +directives.$(O): directives.c compiler.h directives.h hashtbl.h insnsi.h & + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h +disasm.$(O): disasm.c compiler.h directives.h disasm.h insns.h insnsi.h & + nasm.h nasmlib.h opflags.h pptok.h preproc.h regdis.h regs.h sync.h & + tables.h tokens.h +eval.$(O): eval.c compiler.h directives.h eval.h float.h insnsi.h labels.h & + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h +exprlib.$(O): exprlib.c compiler.h directives.h insnsi.h nasm.h nasmlib.h & + opflags.h pptok.h preproc.h regs.h +float.$(O): float.c compiler.h directives.h float.h insnsi.h nasm.h & + nasmlib.h opflags.h pptok.h preproc.h regs.h +hashtbl.$(O): hashtbl.c compiler.h directives.h hashtbl.h insnsi.h nasm.h & + nasmlib.h opflags.h pptok.h preproc.h regs.h +insnsa.$(O): insnsa.c compiler.h directives.h insns.h insnsi.h nasm.h & + nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +insnsb.$(O): insnsb.c compiler.h directives.h insns.h insnsi.h nasm.h & + nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +insnsd.$(O): insnsd.c compiler.h directives.h insns.h insnsi.h nasm.h & + nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +insnsn.$(O): insnsn.c compiler.h insnsi.h opflags.h tables.h +labels.$(O): labels.c compiler.h directives.h hashtbl.h insnsi.h nasm.h & + nasmlib.h opflags.h pptok.h preproc.h regs.h +lib\snprintf.$(O): lib\snprintf.c compiler.h nasmlib.h +lib\strlcpy.$(O): lib\strlcpy.c compiler.h +lib\vsnprintf.$(O): lib\vsnprintf.c compiler.h nasmlib.h +listing.$(O): listing.c compiler.h directives.h insnsi.h listing.h nasm.h & + nasmlib.h opflags.h pptok.h preproc.h regs.h +macros.$(O): macros.c compiler.h directives.h hashtbl.h insnsi.h nasm.h & + nasmlib.h opflags.h output\outform.h pptok.h preproc.h regs.h tables.h +nasm.$(O): nasm.c assemble.h compiler.h directives.h eval.h float.h insns.h & + insnsi.h labels.h listing.h nasm.h nasmlib.h opflags.h output\outform.h & + parser.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h tokens.h +nasmlib.$(O): nasmlib.c compiler.h directives.h insns.h insnsi.h nasm.h & + nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +ndisasm.$(O): ndisasm.c compiler.h directives.h disasm.h insns.h insnsi.h & + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h sync.h tokens.h +output\nulldbg.$(O): output\nulldbg.c compiler.h directives.h insnsi.h & + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h +output\nullout.$(O): output\nullout.c compiler.h directives.h insnsi.h & + nasm.h nasmlib.h opflags.h output\outlib.h pptok.h preproc.h regs.h +output\outaout.$(O): output\outaout.c compiler.h directives.h eval.h & + insnsi.h nasm.h nasmlib.h opflags.h output\outform.h output\outlib.h & + pptok.h preproc.h raa.h regs.h saa.h stdscan.h +output\outas86.$(O): output\outas86.c compiler.h directives.h insnsi.h & + nasm.h nasmlib.h opflags.h output\outform.h output\outlib.h pptok.h & + preproc.h raa.h regs.h saa.h +output\outbin.$(O): output\outbin.c compiler.h directives.h eval.h insnsi.h & + labels.h nasm.h nasmlib.h opflags.h output\outform.h output\outlib.h & + pptok.h preproc.h regs.h saa.h stdscan.h +output\outcoff.$(O): output\outcoff.c compiler.h directives.h eval.h & + insnsi.h nasm.h nasmlib.h opflags.h output\outform.h output\outlib.h & + pptok.h preproc.h raa.h regs.h saa.h +output\outdbg.$(O): output\outdbg.c compiler.h directives.h insnsi.h nasm.h & + nasmlib.h opflags.h output\outform.h pptok.h preproc.h regs.h +output\outelf.$(O): output\outelf.c compiler.h directives.h insnsi.h nasm.h & + nasmlib.h opflags.h output\dwarf.h output\elf.h output\outelf.h & + output\outform.h pptok.h preproc.h regs.h +output\outelf32.$(O): output\outelf32.c compiler.h directives.h eval.h & + insnsi.h nasm.h nasmlib.h opflags.h output\dwarf.h output\elf.h & + output\outelf.h output\outform.h output\outlib.h output\stabs.h pptok.h & + preproc.h raa.h rbtree.h regs.h saa.h stdscan.h +output\outelf64.$(O): output\outelf64.c compiler.h directives.h eval.h & + insnsi.h nasm.h nasmlib.h opflags.h output\dwarf.h output\elf.h & + output\outelf.h output\outform.h output\outlib.h output\stabs.h pptok.h & + preproc.h raa.h rbtree.h regs.h saa.h stdscan.h +output\outform.$(O): output\outform.c compiler.h directives.h insnsi.h & + nasm.h nasmlib.h opflags.h output\outform.h pptok.h preproc.h regs.h +output\outieee.$(O): output\outieee.c compiler.h directives.h insnsi.h & + nasm.h nasmlib.h opflags.h output\outform.h output\outlib.h pptok.h & + preproc.h regs.h +output\outlib.$(O): output\outlib.c compiler.h directives.h insnsi.h nasm.h & + nasmlib.h opflags.h output\outlib.h pptok.h preproc.h regs.h +output\outmacho32.$(O): output\outmacho32.c compiler.h directives.h eval.h & + insnsi.h nasm.h nasmlib.h opflags.h output\outform.h output\outlib.h & + pptok.h preproc.h raa.h regs.h saa.h +output\outmacho64.$(O): output\outmacho64.c compiler.h directives.h insnsi.h & + nasm.h nasmlib.h opflags.h output\outform.h output\outlib.h pptok.h & + preproc.h raa.h regs.h saa.h +output\outobj.$(O): output\outobj.c compiler.h directives.h eval.h insnsi.h & + nasm.h nasmlib.h opflags.h output\outform.h output\outlib.h pptok.h & + preproc.h regs.h stdscan.h +output\outrdf2.$(O): output\outrdf2.c compiler.h directives.h insnsi.h & + nasm.h nasmlib.h opflags.h output\outform.h output\outlib.h pptok.h & + preproc.h rdoff\rdoff.h regs.h saa.h +parser.$(O): parser.c compiler.h directives.h eval.h float.h insns.h & + insnsi.h nasm.h nasmlib.h opflags.h parser.h pptok.h preproc.h regs.h & + stdscan.h tables.h tokens.h +pptok.$(O): pptok.c compiler.h hashtbl.h nasmlib.h pptok.h preproc.h +preproc.$(O): preproc.c compiler.h directives.h eval.h hashtbl.h insnsi.h & + nasm.h nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h & + tables.h tokens.h +quote.$(O): quote.c compiler.h nasmlib.h quote.h +raa.$(O): raa.c compiler.h nasmlib.h raa.h +rbtree.$(O): rbtree.c compiler.h rbtree.h +regdis.$(O): regdis.c regdis.h regs.h +regflags.$(O): regflags.c compiler.h directives.h insnsi.h nasm.h nasmlib.h & + opflags.h pptok.h preproc.h regs.h tables.h +regs.$(O): regs.c compiler.h insnsi.h opflags.h tables.h +regvals.$(O): regvals.c compiler.h insnsi.h opflags.h tables.h +saa.$(O): saa.c compiler.h nasmlib.h saa.h +stdscan.$(O): stdscan.c compiler.h directives.h insns.h insnsi.h nasm.h & + nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h tokens.h +strfunc.$(O): strfunc.c compiler.h directives.h insnsi.h nasm.h nasmlib.h & + opflags.h pptok.h preproc.h regs.h +sync.$(O): sync.c compiler.h nasmlib.h sync.h +tokhash.$(O): tokhash.c compiler.h directives.h hashtbl.h insns.h insnsi.h & + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +ver.$(O): ver.c compiler.h directives.h insnsi.h nasm.h nasmlib.h opflags.h & + pptok.h preproc.h regs.h version.h diff --git a/Mkfiles/owlinux.mak b/Mkfiles/owlinux.mak new file mode 100644 index 0000000..a52a667 --- /dev/null +++ b/Mkfiles/owlinux.mak @@ -0,0 +1,339 @@ +# -*- makefile -*- +# +# Makefile for cross-compiling NASM from Linux +# to DOS, Win32 or OS/2 using OpenWatcom. +# +# Please see http://bugzilla.openwatcom.org/show_bug.cgi?id=751 +# for some caveats in using OpenWatcom as a cross-compiler +# from Linux, in particular: +# +# > Second and more importantly, the makefile needs to ensure that the +# > proper headers are included. This is normally not a problem when +# > building on DOS, Windows, or OS/2, as they share the same C +# > library headers. But when cross-compiling from (or to) Linux, it +# > is crucial. +# > +# > This may be accomplished by setting the INCLUDE env var in the +# > makefile, or setting OS2_INCLUDE, DOS_INCLUDE, NT_INCLUDE env vars +# > *and* making sure that the proper -bt switch is used, or passing a +# > switch like -I"$(%WATCOM)/h". The last variant is probably the +# > easiest to implement and least likely to break. +# + +top_srcdir = . +srcdir = . +prefix = C:/Program Files/NASM +exec_prefix = $(prefix) +bindir = $(prefix)/bin +mandir = $(prefix)/man + +CC = wcl386 +DEBUG = +CFLAGS = -6 -ox -wx -ze -fpi $(DEBUG) +BUILD_CFLAGS = $(CFLAGS) $(TARGET_FLAGS) # -I$(srcdir)/inttypes +INTERNAL_CFLAGS = -I$(srcdir) -I. \ + -DHAVE_SNPRINTF -DHAVE_VSNPRINTF +ALL_CFLAGS = $(BUILD_CFLAGS) $(INTERNAL_CFLAGS) +LD = $(CC) +LDFLAGS = $(ALL_CFLAGS) +LIBS = +PERL = perl -I$(srcdir)/perllib + +STRIP = wstrip + +# Binary suffixes +O = obj +X = .exe + +# WMAKE errors out if a suffix is declared more than once, including +# its own built-in declarations. Thus, we need to explicitly clear the list +# first. Also, WMAKE only allows implicit rules that point "to the left" +# in this list! +.SUFFIXES: +.SUFFIXES: .man .1 .$(O) .i .c + +.c.$(O): + $(CC) -c $(ALL_CFLAGS) -fo=$@ $< + +#-- Begin File Lists --# +# Edit in Makefile.in, not here! +NASM = nasm.$(O) nasmlib.$(O) ver.$(O) \ + raa.$(O) saa.$(O) rbtree.$(O) \ + float.$(O) insnsa.$(O) insnsb.$(O) \ + directives.$(O) \ + assemble.$(O) labels.$(O) hashtbl.$(O) crc64.$(O) parser.$(O) \ + output/outform.$(O) output/outlib.$(O) output/nulldbg.$(O) \ + output/nullout.$(O) \ + output/outbin.$(O) output/outaout.$(O) output/outcoff.$(O) \ + output/outelf.$(O) output/outelf32.$(O) output/outelf64.$(O) \ + output/outobj.$(O) output/outas86.$(O) output/outrdf2.$(O) \ + output/outdbg.$(O) output/outieee.$(O) output/outmacho32.$(O) \ + output/outmacho64.$(O) preproc.$(O) quote.$(O) pptok.$(O) \ + macros.$(O) listing.$(O) eval.$(O) exprlib.$(O) stdscan.$(O) \ + strfunc.$(O) tokhash.$(O) regvals.$(O) regflags.$(O) \ + lib/strlcpy.$(O) + +NDISASM = ndisasm.$(O) disasm.$(O) sync.$(O) nasmlib.$(O) ver.$(O) \ + insnsd.$(O) insnsb.$(O) insnsn.$(O) regs.$(O) regdis.$(O) +#-- End File Lists --# + +what: + @echo 'Please build "dos", "win32" or "os2"' + +dos: + $(MAKE) -f $(MAKEFILE_LIST) all TARGET_FLAGS='-bt=DOS -l=DOS4G' + +win32: + $(MAKE) -f $(MAKEFILE_LIST) all TARGET_FLAGS='-bt=NT -l=NT' + +os2: + $(MAKE) -f $(MAKEFILE_LIST) all TARGET_FLAGS='-bt=OS2 -l=OS2V2' + +all: nasm$(X) ndisasm$(X) + +nasm$(X): $(NASM) + $(LD) $(LDFLAGS) -fe=nasm$(X) $(NASM) $(LIBS) + +ndisasm$(X): $(NDISASM) + $(LD) $(LDFLAGS) -fe=ndisasm$(X) $(NDISASM) $(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. + +insnsb.c: insns.dat insns.pl + $(PERL) $(srcdir)/insns.pl -b $(srcdir)/insns.dat +insnsa.c: insns.dat insns.pl + $(PERL) $(srcdir)/insns.pl -a $(srcdir)/insns.dat +insnsd.c: insns.dat insns.pl + $(PERL) $(srcdir)/insns.pl -d $(srcdir)/insns.dat +insnsi.h: insns.dat insns.pl + $(PERL) $(srcdir)/insns.pl -i $(srcdir)/insns.dat +insnsn.c: insns.dat insns.pl + $(PERL) $(srcdir)/insns.pl -n $(srcdir)/insns.dat + +# 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 + +version.mac: version version.pl + $(PERL) $(srcdir)/version.pl mac < $(srcdir)/version > version.mac + +# 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 standard.mac version.mac + $(PERL) $(srcdir)/macros.pl $(srcdir)/standard.mac version.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 + +# 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 + +# 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 + +# 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 + +# 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 regdis.h regvals.c \ + tokhash.c tokens.h pptok.h pptok.c \ + version.h version.mac +perlreq: $(PERLREQ) + +clean: + -rm -f *.$(O) + -rm -f *.s + -rm -f *.i + -rm -f output/*.$(O) + -rm -f output/*.s + -rm -f output/*.i + -rm -f nasm$(X) + -rm -f ndisasm$(X) + # cd rdoff && $(MAKE) clean + +distclean: clean .SYMBOLIC + -rm -f config.h + -rm -f config.log + -rm -f config.status + -rm -f Makefile + -rm -f *~ + -rm -f *.bak + -rm -f *.lst + -rm -f *.bin + -rm -f output/*~ + -rm -f output/*.bak + -rm -f test/*.lst + -rm -f test/*.bin + -rm -f test/*.$(O) + -rm -f test/*.bin + -rm -f/s autom4te*.cache + # cd rdoff && $(MAKE) distclean + +cleaner: clean .SYMBOLIC + -rm -f $(PERLREQ) + -rm -f *.man + -rm -f nasm.spec + # cd doc && $(MAKE) clean + +spotless: distclean cleaner .SYMBOLIC + -rm -f doc/Makefile + -rm -f doc/*~ + -rm -f doc/*.bak + +strip: + $(STRIP) *.exe + +rdf: + # cd rdoff && $(MAKE) + +doc: + # cd doc && $(MAKE) all + +everything: all doc rdf + +#-- Magic hints to mkdep.pl --# +# @object-ending: ".$(O)" +# @path-separator: "/" +# @exclude: "config.h" +# @continuation: "\" +#-- Everything below is generated by mkdep.pl - do not edit --# +assemble.$(O): assemble.c assemble.h compiler.h directives.h insns.h \ + insnsi.h nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tables.h \ + tokens.h +crc64.$(O): crc64.c compiler.h nasmlib.h +directives.$(O): directives.c compiler.h directives.h hashtbl.h insnsi.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h +disasm.$(O): disasm.c compiler.h directives.h disasm.h insns.h insnsi.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h regdis.h regs.h sync.h \ + tables.h tokens.h +eval.$(O): eval.c compiler.h directives.h eval.h float.h insnsi.h labels.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h +exprlib.$(O): exprlib.c compiler.h directives.h insnsi.h nasm.h nasmlib.h \ + opflags.h pptok.h preproc.h regs.h +float.$(O): float.c compiler.h directives.h float.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h +hashtbl.$(O): hashtbl.c compiler.h directives.h hashtbl.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h +insnsa.$(O): insnsa.c compiler.h directives.h insns.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +insnsb.$(O): insnsb.c compiler.h directives.h insns.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +insnsd.$(O): insnsd.c compiler.h directives.h insns.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +insnsn.$(O): insnsn.c compiler.h insnsi.h opflags.h tables.h +labels.$(O): labels.c compiler.h directives.h hashtbl.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h +lib/snprintf.$(O): lib/snprintf.c compiler.h nasmlib.h +lib/strlcpy.$(O): lib/strlcpy.c compiler.h +lib/vsnprintf.$(O): lib/vsnprintf.c compiler.h nasmlib.h +listing.$(O): listing.c compiler.h directives.h insnsi.h listing.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h +macros.$(O): macros.c compiler.h directives.h hashtbl.h insnsi.h nasm.h \ + nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h tables.h +nasm.$(O): nasm.c assemble.h compiler.h directives.h eval.h float.h insns.h \ + insnsi.h labels.h listing.h nasm.h nasmlib.h opflags.h output/outform.h \ + parser.h pptok.h preproc.h raa.h regs.h saa.h stdscan.h tokens.h +nasmlib.$(O): nasmlib.c compiler.h directives.h insns.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +ndisasm.$(O): ndisasm.c compiler.h directives.h disasm.h insns.h insnsi.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h sync.h tokens.h +output/nulldbg.$(O): output/nulldbg.c compiler.h directives.h insnsi.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h +output/nullout.$(O): output/nullout.c compiler.h directives.h insnsi.h \ + nasm.h nasmlib.h opflags.h output/outlib.h pptok.h preproc.h regs.h +output/outaout.$(O): output/outaout.c compiler.h directives.h eval.h \ + insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \ + pptok.h preproc.h raa.h regs.h saa.h stdscan.h +output/outas86.$(O): output/outas86.c compiler.h directives.h insnsi.h \ + nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \ + preproc.h raa.h regs.h saa.h +output/outbin.$(O): output/outbin.c compiler.h directives.h eval.h insnsi.h \ + labels.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \ + pptok.h preproc.h regs.h saa.h stdscan.h +output/outcoff.$(O): output/outcoff.c compiler.h directives.h eval.h \ + insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \ + pptok.h preproc.h raa.h regs.h saa.h +output/outdbg.$(O): output/outdbg.c compiler.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h +output/outelf.$(O): output/outelf.c compiler.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h output/dwarf.h output/elf.h output/outelf.h \ + output/outform.h pptok.h preproc.h regs.h +output/outelf32.$(O): output/outelf32.c compiler.h directives.h eval.h \ + insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \ + output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \ + preproc.h raa.h rbtree.h regs.h saa.h stdscan.h +output/outelf64.$(O): output/outelf64.c compiler.h directives.h eval.h \ + insnsi.h nasm.h nasmlib.h opflags.h output/dwarf.h output/elf.h \ + output/outelf.h output/outform.h output/outlib.h output/stabs.h pptok.h \ + preproc.h raa.h rbtree.h regs.h saa.h stdscan.h +output/outform.$(O): output/outform.c compiler.h directives.h insnsi.h \ + nasm.h nasmlib.h opflags.h output/outform.h pptok.h preproc.h regs.h +output/outieee.$(O): output/outieee.c compiler.h directives.h insnsi.h \ + nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \ + preproc.h regs.h +output/outlib.$(O): output/outlib.c compiler.h directives.h insnsi.h nasm.h \ + nasmlib.h opflags.h output/outlib.h pptok.h preproc.h regs.h +output/outmacho32.$(O): output/outmacho32.c compiler.h directives.h eval.h \ + insnsi.h nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h \ + pptok.h preproc.h raa.h regs.h saa.h +output/outmacho64.$(O): output/outmacho64.c compiler.h directives.h insnsi.h \ + nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \ + preproc.h raa.h regs.h saa.h +output/outobj.$(O): output/outobj.c compiler.h directives.h eval.h insnsi.h \ + nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \ + preproc.h regs.h stdscan.h +output/outrdf2.$(O): output/outrdf2.c compiler.h directives.h insnsi.h \ + nasm.h nasmlib.h opflags.h output/outform.h output/outlib.h pptok.h \ + preproc.h rdoff/rdoff.h regs.h saa.h +parser.$(O): parser.c compiler.h directives.h eval.h float.h insns.h \ + insnsi.h nasm.h nasmlib.h opflags.h parser.h pptok.h preproc.h regs.h \ + stdscan.h tables.h tokens.h +pptok.$(O): pptok.c compiler.h hashtbl.h nasmlib.h pptok.h preproc.h +preproc.$(O): preproc.c compiler.h directives.h eval.h hashtbl.h insnsi.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h \ + tables.h tokens.h +quote.$(O): quote.c compiler.h nasmlib.h quote.h +raa.$(O): raa.c compiler.h nasmlib.h raa.h +rbtree.$(O): rbtree.c compiler.h rbtree.h +regdis.$(O): regdis.c regdis.h regs.h +regflags.$(O): regflags.c compiler.h directives.h insnsi.h nasm.h nasmlib.h \ + opflags.h pptok.h preproc.h regs.h tables.h +regs.$(O): regs.c compiler.h insnsi.h opflags.h tables.h +regvals.$(O): regvals.c compiler.h insnsi.h opflags.h tables.h +saa.$(O): saa.c compiler.h nasmlib.h saa.h +stdscan.$(O): stdscan.c compiler.h directives.h insns.h insnsi.h nasm.h \ + nasmlib.h opflags.h pptok.h preproc.h quote.h regs.h stdscan.h tokens.h +strfunc.$(O): strfunc.c compiler.h directives.h insnsi.h nasm.h nasmlib.h \ + opflags.h pptok.h preproc.h regs.h +sync.$(O): sync.c compiler.h nasmlib.h sync.h +tokhash.$(O): tokhash.c compiler.h directives.h hashtbl.h insns.h insnsi.h \ + nasm.h nasmlib.h opflags.h pptok.h preproc.h regs.h tokens.h +ver.$(O): ver.c compiler.h directives.h insnsi.h nasm.h nasmlib.h opflags.h \ + pptok.h preproc.h regs.h version.h |