Makefile.b32   [plain text]

# Makefile for the Netwide Assembler under 32 bit NT console
# The Netwide Assembler is copyright (C) 1996 Simon Tatham and
# Julian Hall. All rights reserved. The software is
# redistributable under the licence given in the file "Licence"
# distributed in the NASM archive.
# This Makefile is designed to build NASM with the latest
# version of Borland C++Builder and has been tested with 
# Borland C++ 5.5 (Borland C++Builder 5.0) in combination
# Borland MAKE 5.2
# Additionally, the free Borland C++ Compiler 5.5 is supported;
# see
# MAKEFILE is maintained by



# If "BINDIR=C:\...." has not been defined on the command line
# assume that the binary files are in the same directory as the
# MAKE utility
!message ****************************************************
!message Note:
!message -----
!if $d(BINDIR)
  !message Path to tools set to $(BINDIR)
  !message Assuming path to tools to be $(BINDIR)
  !message You can change this assumption by specifying
  !message   -DBINDIR=C:\my_path
  !message as a command line paramter for MAKE
!message ****************************************************

CCFLAGS=-q -Q -tWC -c -O2 -A -d -w-8057
  # /q:    Suppress compiler identification banner
  # /Q:    Extended compiler error information
  # /-tWC: Windows console mode application
  # /c:    Compile, do not link
  # /O2:   Optimize for speed
  # /A:    ANSI compatible code only
  # /d:    Merge duplicate strings
  # /-w-8057: Turn off "Parameter <param> never used in function <func>" warning

LINKFLAGS=/V4.0 /q /x /c /ap /L$(BINDIR)\..\LIB     # /L -> default LIB directory
  # /V4.0: marked as Win95 / NT application in PE header
  # /q:    suppress command-line banner
  # /x:    no map file
  # /c:    case sensitive link
  # /ap:   link for 32-bit console application
  # /L...: path to .lib directory

# default libraries for Win32 console applications
LIBRARIES=cw32.lib import32.lib
# default startup code for Win32 console applications

# default extension for our EXE
# default extension for OBJ files

SUFFIX= w#       # by default, this makefile produces nasmw.exe and ndisasmw.exe

# Builds C files to OBJ
  $(CC) $(CCFLAGS) $*.c

NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) insnsa.$(OBJ) \
	     assemble.$(OBJ) labels.$(OBJ) parser.$(OBJ) outform.$(OBJ) \
		  output\outbin.$(OBJ) output\outaout.$(OBJ) output\outcoff.$(OBJ) output\outelf.$(OBJ) \
		  output\outobj.$(OBJ) output\outas86.$(OBJ) output\outrdf.$(OBJ) output\outdbg.$(OBJ) \
        output\outrdf2.$(OBJ) output\outieee.$(OBJ) \
		  preproc.$(OBJ) listing.$(OBJ) eval.$(OBJ)

NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) nasmlib.$(OBJ) \

BuildAll: nasm$(SUFFIX)$(EXE) ndisasm$(SUFFIX)$(EXE)

  $(LINK) $(LINKFLAGS) @&&|     #open temp response file
    $(STARTUP) $**
    # default MAP file name for EXE
|                                # close temp file, first column!

  $(LINK) $(LINKFLAGS) @&&|     #open temp response file
    $(STARTUP) $**
    # default MAP file name for EXE
|                                # close temp file, first column!

# 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.

insnsa.c: insns.dat
	$(PERL) $(srcdir)/ -a $(srcdir)/insns.dat

insnsd.c: insns.dat
	$(PERL) $(srcdir)/ -d $(srcdir)/insns.dat

insnsi.h: insns.dat
	$(PERL) $(srcdir)/ -i $(srcdir)/insns.dat

insnsn.c: insns.dat
	$(PERL) $(srcdir)/ -n $(srcdir)/insns.dat

# 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: standard.mac version.mac
	$(PERL) $(srcdir)/ $(srcdir)/standard.mac version.mac

# These files contains all the standard macros that are derived from
# the version number.
version.h: version
        $(PERL) $(srcdir)/ h < $(srcdir)/version > version.h

version.mac: version
        $(PERL) $(srcdir)/ mac < $(srcdir)/version > version.mac

# These source files are generated from regs.dat by yet another
# perl script.
regs.c: regs.dat
	$(PERL) $(srcdir)/ c $(srcdir)/regs.dat > regs.c
regflags.c: regs.dat
	$(PERL) $(srcdir)/ fc $(srcdir)/regs.dat > regflags.c
regdis.c: regs.dat
	$(PERL) $(srcdir)/ dc $(srcdir)/regs.dat > regdis.c
regvals.c: regs.dat
	$(PERL) $(srcdir)/ vc $(srcdir)/regs.dat > regvals.c
regs.h: regs.dat
	$(PERL) $(srcdir)/ h $(srcdir)/regs.dat > regs.h

  @-del /S *.obj  2> NUL 1>&2
  @-del /S *.il?  2> NUL 1>&2
  @-del /S *.tds  2> NUL 1>&2
  @-del /S *.~*  2> NUL 1>&2
  @-del /S nasm$(SUFFIX)$(EXE)  2> NUL 1>&2
  @-del /S ndisasm$(SUFFIX)$(EXE)  2> NUL 1>&2

#-- Magic hints to --#
# @object-ending: ".$(OBJ)"
# @path-separator: "\"
#-- Everything below is generated by - do not edit --#
assemble.$(OBJ): assemble.c preproc.h insns.h regs.h version.h nasmlib.h \
 nasm.h regvals.c insnsi.h assemble.h
disasm.$(OBJ): disasm.c insns.h sync.h regdis.c regs.h regs.c version.h \
 nasm.h insnsn.c names.c insnsi.h disasm.h
eval.$(OBJ): eval.c labels.h eval.h regs.h version.h nasmlib.h nasm.h
float.$(OBJ): float.c regs.h version.h nasm.h
insnsa.$(OBJ): insnsa.c insns.h regs.h version.h nasm.h insnsi.h
insnsd.$(OBJ): insnsd.c insns.h regs.h version.h nasm.h insnsi.h
insnsn.$(OBJ): insnsn.c
labels.$(OBJ): labels.c regs.h version.h nasmlib.h nasm.h
listing.$(OBJ): listing.c regs.h version.h nasmlib.h nasm.h listing.h
macros.$(OBJ): macros.c
names.$(OBJ): names.c regs.c insnsn.c
nasm.$(OBJ): nasm.c labels.h preproc.h insns.h parser.h eval.h regs.h \
 outform.h version.h nasmlib.h nasm.h assemble.h insnsi.h listing.h
nasmlib.$(OBJ): nasmlib.c insns.h regs.h regs.c version.h nasmlib.h nasm.h \
 insnsn.c names.c insnsi.h
ndisasm.$(OBJ): ndisasm.c insns.h sync.h regs.h version.h nasmlib.h nasm.h \
 insnsi.h disasm.h
outform.$(OBJ): outform.c regs.h outform.h version.h nasm.h
output\outaout.$(OBJ): output\outaout.c regs.h outform.h version.h nasmlib.h \
output\outas86.$(OBJ): output\outas86.c regs.h outform.h version.h nasmlib.h \
output\outbin.$(OBJ): output\outbin.c labels.h eval.h regs.h outform.h \
 version.h nasmlib.h nasm.h
output\outcoff.$(OBJ): output\outcoff.c regs.h outform.h version.h nasmlib.h \
output\outdbg.$(OBJ): output\outdbg.c regs.h outform.h version.h nasmlib.h \
output\outelf.$(OBJ): output\outelf.c regs.h outform.h version.h nasmlib.h \
output\outieee.$(OBJ): output\outieee.c regs.h outform.h version.h nasmlib.h \
output\outobj.$(OBJ): output\outobj.c regs.h outform.h version.h nasmlib.h \
output\outrdf.$(OBJ): output\outrdf.c regs.h outform.h version.h nasmlib.h \
output\outrdf2.$(OBJ): output\outrdf2.c rdoff\rdoff.h regs.h outform.h \
 version.h nasmlib.h nasm.h
parser.$(OBJ): parser.c insns.h parser.h float.h regs.h regflags.c version.h \
 nasmlib.h nasm.h insnsi.h
preproc.$(OBJ): preproc.c macros.c regs.h version.h nasmlib.h nasm.h
regdis.$(OBJ): regdis.c
regflags.$(OBJ): regflags.c
regs.$(OBJ): regs.c
regvals.$(OBJ): regvals.c
sync.$(OBJ): sync.c sync.h