Update CHANGES for 0.98.35
[nasm/autotest.git] / Mkfiles / Makefile.bc3
blob342aadc94ad4c20b3a81c7034e12c39a12d33871
1 # Makefile for the Netwide Assembler under 16-bit DOS (aimed at Borland C)
3 # The Netwide Assembler is copyright (C) 1996 Simon Tatham and
4 # Julian Hall. All rights reserved. The software is
5 # redistributable under the licence given in the file "Licence"
6 # distributed in the NASM archive.
8 # This Makefile compiles NASM and NDISASM for 16 bit DOS using Borland
9 # C++; tested with version 3.1.  It probably should work for any
10 # version of Turbo C++ or Borland C++ from version 3.0 upwards.
11 # For Turbo C++, replace "bcc" with "tcc", and replace "-O1" with "-O".
13 # Most everything is remarked, and explaned in full, it should be
14 # easy to convert it to another compiler. I tried to make the devision
15 # of information logical, and easy to follow.
17 # BEFORE YOU USE THIS MAKE FILE!!!
19 # Make sure the line below is set to the propper location of your standard
20 # Libaries, if not you'll get some errors. Make sure to keep the trailing
21 # backslash, as it's needed, and remeber to use \\ not \ as that will cause
22 # some errors.
24 # This Makefile was updated with NASM 0.98.31, and could compile that
25 # version correctly using Borland C++ 3.1 under DOS.
28 CC = bcc                #compiler
30 # opimizations
31 OPTFLAGS = -d -O1 -Ogmp -k-
32   # -d  = merge duplicate strings
33   # -O1 = optimize for size
34   # -Og = enable global common subexpression elimination
35   # -Om = enable loop invariant removal
36   # -Op = enable constant propagation
37   # ** WARNING: DO NOT ENABLE -Ov (strength reduction) ON BORLAND C++ 3.1 **
38   # ** NASM IS KNOWN TO MISCOMPILE WITH -Ov **
39   # -k- = omit stack frames where practical
40 #output formats
41 OUTFORMS = -DOF_ONLY -DOF_BIN -DOF_OBJ -DOF_WIN32 -DOF_AS86
43 #compiler flags
44 CFLAGS = $(OPTFLAGS) -mh -f- $(OUTFORMS) -DFARDATA=far
45   # -mh = model huge
46   # -f- = no floating point
48 LINKFLAGS = -d -mh -M -f-
49   # -d  = merge duplicate strings
50   # -M  = generate map file (to find address space bottlenecks)
52 LIBS =                  #any libaries to add, out side of the standard libary
53 EXE = .exe              #executable file extention (keep the . as the start)
54 OBJ = obj               #OBJ file extention
55 LIB = lib               #LIB file extension
57 .c.$(OBJ):
58         $(CC) $(CFLAGS) -c -o$@ $<
60 ################################################################
61 # The OBJ files that NASM is dependent on
63 NASMOBJS = nasm.$(OBJ)   nasmlib.$(OBJ)  float.$(OBJ)  \
64            assemble.$(OBJ) labels.$(OBJ) \
65            parser.$(OBJ) outform.$(OBJ)  preproc.$(OBJ) \
66            listing.$(OBJ) eval.$(OBJ) insnsa.$(OBJ)
68 ################################################################
69 # The OBJ files that NDISASM is dependent on
71 NDISASMOBJS = ndisasm.$(OBJ)  disasm.$(OBJ) sync.$(OBJ) \
72               nasmlib.$(OBJ) insnsd.$(OBJ)
74 ################################################################
75 # The OBJ file for the output formats
77 OUTOBJ= output\\outbin.$(OBJ) output\\outaout.$(OBJ) output\\outcoff.$(OBJ) \
78         output\\outelf.$(OBJ) output\\outobj.$(OBJ)  output\\outas86.$(OBJ) \
79         output\\outdbg.$(OBJ) output\\outrdf2.$(OBJ) output\\outieee.$(OBJ)
81 ################################################################
82 # Build everything
84 all : nasm$(EXE) ndisasm$(EXE)
86 ################################################################
87 # Rules to put the CFLAGS in a file
88 CFLAGS: Makefile
89         echo $(CFLAGS) > CFLAGS
90         $(MAKE) clean
92 ################################################################
93 # NASM, NDISASM link.  The &&!...! construct in Borland Make
94 # creates a temporary file and inserts its name on the command
95 # line.  It works around the DOS 127-character command line
96 # limit.
98 nasm$(EXE): $(NASMOBJS) output\\out.$(LIB)
99         $(CC) $(LINKFLAGS) -onasm$(EXE) @&&!
100 $(NASMOBJS)
101 output\\out.$(LIB)
104 ndisasm$(EXE): $(NDISASMOBJS)
105         $(CC) $(LINKFLAGS) -ondisasm$(EXE) @&&!
106 $(NDISASMOBJS)
109 ################################################################
110 # Build the output formats as a library
111 # The & ... $? construct tells Borland Make to repeat for all
112 # out of date dependencies
113 output\\out.$(LIB): $(OUTOBJ)
114         -del output\\out.$(LIB)
115         for %a in (output\\*.$(OBJ)) do tlib /C output\\out.$(LIB) +%a
117 ################################################################
118 # A quick way to delete the OBJ files as well as the binaries.
120 clean :
121         -del *.$(OBJ)
122         -del output\\*.$(OBJ)
123         -del output\\out.$(LIB)
124         -del *.$(LIB)
125         -del insnsa_?.c
126         -del nasm$(EXE)
127         -del ndisasm$(EXE)
128         -del *.map
129         -del CFLAGS
131 #-- Magic hints to mkdep.pl --#
132 # @object-ending: ".$(OBJ)"
133 # @path-separator: "\\"
134 #-- Everything below is generated by mkdep.pl - do not edit --#
135 assemble.$(OBJ): assemble.c insns.h assemble.h regvals.c nasm.h regs.h \
136  insnsi.h nasmlib.h version.h
137 disasm.$(OBJ): disasm.c insns.h regs.c sync.h names.c nasm.h disasm.h regs.h \
138  insnsn.c insnsi.h version.h regdis.c
139 eval.$(OBJ): eval.c nasm.h regs.h labels.h nasmlib.h version.h eval.h
140 float.$(OBJ): float.c nasm.h regs.h version.h
141 insnsa.$(OBJ): insnsa.c insns.h nasm.h regs.h insnsi.h version.h
142 insnsd.$(OBJ): insnsd.c insns.h nasm.h regs.h insnsi.h version.h
143 insnsn.$(OBJ): insnsn.c
144 labels.$(OBJ): labels.c nasm.h regs.h nasmlib.h version.h
145 listing.$(OBJ): listing.c listing.h nasm.h regs.h nasmlib.h version.h
146 macros.$(OBJ): macros.c
147 names.$(OBJ): names.c regs.c insnsn.c
148 nasm.$(OBJ): nasm.c listing.h preproc.h insns.h outform.h assemble.h \
149  parser.h nasm.h regs.h labels.h insnsi.h nasmlib.h version.h eval.h
150 nasmlib.$(OBJ): nasmlib.c insns.h regs.c names.c nasm.h regs.h insnsn.c \
151  insnsi.h nasmlib.h version.h
152 ndisasm.$(OBJ): ndisasm.c insns.h sync.h nasm.h disasm.h regs.h insnsi.h \
153  nasmlib.h version.h
154 outform.$(OBJ): outform.c outform.h nasm.h regs.h version.h
155 output\\outaout.$(OBJ): output\\outaout.c outform.h nasm.h regs.h nasmlib.h \
156  version.h
157 output\\outas86.$(OBJ): output\\outas86.c outform.h nasm.h regs.h nasmlib.h \
158  version.h
159 output\\outbin.$(OBJ): output\\outbin.c outform.h nasm.h regs.h nasmlib.h \
160  version.h
161 output\\outcoff.$(OBJ): output\\outcoff.c outform.h nasm.h regs.h nasmlib.h \
162  version.h
163 output\\outdbg.$(OBJ): output\\outdbg.c outform.h nasm.h regs.h nasmlib.h \
164  version.h
165 output\\outelf.$(OBJ): output\\outelf.c outform.h nasm.h regs.h nasmlib.h \
166  version.h
167 output\\outieee.$(OBJ): output\\outieee.c outform.h nasm.h regs.h nasmlib.h \
168  version.h
169 output\\outobj.$(OBJ): output\\outobj.c outform.h nasm.h regs.h nasmlib.h \
170  version.h
171 output\\outrdf.$(OBJ): output\\outrdf.c outform.h nasm.h regs.h nasmlib.h \
172  version.h
173 output\\outrdf2.$(OBJ): output\\outrdf2.c outform.h nasm.h regs.h nasmlib.h \
174  version.h
175 parser.$(OBJ): parser.c insns.h parser.h nasm.h regs.h insnsi.h regflags.c \
176  float.h nasmlib.h version.h
177 preproc.$(OBJ): preproc.c nasm.h macros.c regs.h nasmlib.h version.h
178 regdis.$(OBJ): regdis.c
179 regflags.$(OBJ): regflags.c
180 regs.$(OBJ): regs.c
181 regvals.$(OBJ): regvals.c
182 sync.$(OBJ): sync.c sync.h