summaryrefslogtreecommitdiff
path: root/Mkfiles
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2002-06-06 03:33:38 +0000
committerH. Peter Anvin <hpa@zytor.com>2002-06-06 03:33:38 +0000
commit6d4680a68de4ca57a5c53e7ccbba0eb9da4e35b5 (patch)
tree567586357357ea7730c46f2b4b33d830937e5ea1 /Mkfiles
parent232badbbbcbc14e53f319d52211061424ee6b1e6 (diff)
downloadnasm-6d4680a68de4ca57a5c53e7ccbba0eb9da4e35b5.tar.gz
nasm-6d4680a68de4ca57a5c53e7ccbba0eb9da4e35b5.tar.bz2
nasm-6d4680a68de4ca57a5c53e7ccbba0eb9da4e35b5.zip
Update Makefile.bc3 so that it actually works again.
Diffstat (limited to 'Mkfiles')
-rw-r--r--Mkfiles/Makefile.bc359
1 files changed, 30 insertions, 29 deletions
diff --git a/Mkfiles/Makefile.bc3 b/Mkfiles/Makefile.bc3
index 2cf9047..80049ac 100644
--- a/Mkfiles/Makefile.bc3
+++ b/Mkfiles/Makefile.bc3
@@ -26,29 +26,35 @@
#
CC = bcc #compiler
+# opimizations
+OPTFLAGS = -d -O1 -Ogmpv -k-
+ # -d = merge duplicate strings
+ # -O1 = optimize for size
+ # -Og = enable global common subexpression elimination
+ # -Om = enable loop invariant removal
+ # -Op = enable constant propagation
+ # -Ov = enable strength-reduction optimization
+ # -k- = omit stack frames where practical
+#output formats
+OUTFORMS = -DOF_ONLY -DOF_BIN -DOF_OBJ -DOF_WIN32 -DOF_AS86
#compiler flags
-CCFLAGS = -d -c -O1 -mh -DOF_ONLY -DOF_BIN -DOF_OBJ -DOF_WIN32 -DOF_AS86
- # -d = merge dupicate strings
- # -c = compile only
- # -O1 = optimise for size
+CFLAGS = -mh $(OPTFLAGS) $(OUTFORMS)
# -mh = model huge
- # -n = put the OBJ files in the diectory given.
LINKFLAGS = -d -mh
+ # -d = merge duplicate strings
+ # -mh = model huge
-LIBS = #any libaries to add, out side of the standard libary
+LIBS = #any libaries to add, out side of the standard libary
EXE = .exe #executable file extention (keep the . as the start)
OBJ = obj #OBJ file extention
-LIB = lib #LIB file extension
-
-# Compilation command line
-NASM_ASM=$(CC) $(CCFLAGS) -o$*.$(OBJ) $*.c
+LIB = lib #LIB file extension
-.c.o:
- $(NASM_ASM)
+.c.$(OBJ):
+ $(CC) $(CFLAGS) -c -o$@ $<
################################################################
-#The OBJ files that NASM is dependent on
+# The OBJ files that NASM is dependent on
NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) \
insnsa.$(OBJ) assemble.$(OBJ) labels.$(OBJ) \
@@ -56,20 +62,17 @@ NASMOBJS = nasm.$(OBJ) nasmlib.$(OBJ) float.$(OBJ) \
listing.$(OBJ) eval.$(OBJ)
################################################################
-#The OBJ files that NDISASM is dependent on
+# The OBJ files that NDISASM is dependent on
NDISASMOBJS = ndisasm.$(OBJ) disasm.$(OBJ) sync.$(OBJ) \
nasmlib.$(OBJ) insnsd.$(OBJ)
################################################################
-# The OBJ file for the output formats we want to compile in.
-# It doesn't make sense for 16-bit MS-DOS to include all formats.
+# The OBJ file for the output formats
OUTOBJ= 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)
-
+ output\\outdbg.$(OBJ) output\\outrdf2.$(OBJ) output\\outieee.$(OBJ)
################################################################
# Build everything
@@ -77,15 +80,21 @@ OUTOBJ= output\\outbin.$(OBJ) output\\outaout.$(OBJ) output\\outcoff.$(OBJ) \
all : nasm$(EXE) ndisasm$(EXE)
################################################################
+# Build the output formats as a library
+output\\out.$(LIB): $(OUTOBJ)
+ -del output\\out.$(LIB)
+ for %a in (output\\*.$(OBJ)) do tlib /C output\\out.$(LIB) +%a
+
+################################################################
# NASM, NDISASM link. The &&!...! construct in Borland Make
# creates a temporary file and inserts its name on the command
# line. It works around the DOS 127-character command line
# limit.
-nasm$(EXE): $(NASMOBJS) output\\out.lib
+nasm$(EXE): $(NASMOBJS) output\\out.$(LIB)
$(CC) $(LINKFLAGS) -onasm$(EXE) @&&!
$(NASMOBJS)
-output\\out.lib
+output\\out.$(LIB)
!
ndisasm$(EXE): $(NDISASMOBJS)
@@ -94,14 +103,6 @@ $(NDISASMOBJS)
!
################################################################
-# Build the output formats as a library
-# The & ... $? construct tells Borland Make to repeat for all
-# out of date dependencies
-output\\out.$(LIB): $(OUTOBJ)
- -del output\\out.$(LIB)
- for %a in (output\\*.obj) do tlib /C output\\out.$(LIB) +%a
-
-################################################################
# A quick way to delete the OBJ files as well as the binaries.
clean :