# Makefile for the Netwide Assembler under OS/2 (aimed at Borland C++ for OS/2) # # 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 made to compile NASMOS2 and NDISASM2 # using Borland C++ for OS/2. # #------------------------------------------------------------------- # Make Directives #------------------------------------------------------------------- .AUTODEPEND : .SUFFIXES : .rc .res .obj .c .cpp .asm .hlp .itl .ipf #------------------------------------------------------------------- # Make Macros #------------------------------------------------------------------- LIBS = c2 + os2 # -------------------------------------------------------------------------- # # c compile only # v include full sybolic debugging information # b force enums to be of type int # # -------------------------------------------------------------------------- CCFLAGS = /c /v /b CC = bcc #compiler LINK = tlink #linker DCCFLAGS = /d /c /O /A #compiler flags for NDISASM #/d=merge dupicate strings #/c=compile only #/O=Optimise jumps #/A=ANSI standard C LINKFLAGS = /c /x #linker flags #/c=case sIgnificance on symbols #/x=No map file at all LIBRARIES = #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 NASM_ASM=$(CC) $(CCFLAGS) $&.c #Command line for NASM DASM_ASM=$(CC) $(DCCFLAGS) $&.c #command line for NDISASM # NOTE: $& is used to create the file name, as it only gives the name it's # self, where as using $* would have give the full path of the file it # want's done. This becomes a problem if the OBJ files are in a seperate # directory, becuse it will then try to find the source file in the OBJ # dir. ################################################################ #The OBJ files that NASM is dependent on NASMOBJS = $(OBJD)nasm.$(OBJ) $(OBJD)nasmlib.$(OBJ) $(OBJD)float.$(OBJ) \ $(OBJD)insnsa.$(OBJ) $(OBJD)assemble.$(OBJ) $(OBJD)labels.$(OBJ) \ $(OBJD)parser.$(OBJ) $(OBJD)outform.$(OBJ) $(OBJD)preproc.$(OBJ) \ $(OBJD)listing.$(OBJ) $(OBJD)eval.$(OBJ) $(OBJD)outrdf2.$(OBJ) $(OBJD)zoutieee.$(OBJ) ################################################################ #The OBJ files that NDISASM is dependent on NDISASMOBJS = $(OBJD)ndisasm.$(OBJ) $(OBJD)disasm.$(OBJ) $(OBJD)sync.$(OBJ) \ $(OBJD)nasmlibd.$(OBJ) $(OBJD)insnsd.$(OBJ) ################################################################ #The OBJ file for the output formats. OUTOBJ= $(OBJD)outbin.$(OBJ) $(OBJD)outaout.$(OBJ) $(OBJD)outcoff.$(OBJ) \ $(OBJD)outelf.$(OBJ) $(OBJD)outobj.$(OBJ) $(OBJD)outas86.$(OBJ) \ $(OBJD)outrdf.$(OBJ) $(OBJD)outdbg.$(OBJ) ################################################################ # Build everything all : nasmos2$(EXE) ndisasm2$(EXE) ################################################################ #NASM, NDISASM compile, I hope it's self explanitory nasmos2$(EXE): $(NASMOBJS) $(OUTOBJ) $(LINK) $(LINKFLAGS) @&&! #command for the linker C02 $(NASMOBJS) $(OUTOBJ) #OBJ file list $(EXED)nasmos2$(EXE) #EXE file name NASMOS2.MAP $(LIBS) #Libaries needed NASMOS2.DEF #Link Definition file ! ndisasm2$(EXE): $(NDISASMOBJS) $(LINK) $(LINKFLAGS) @&&! #command for the linker c02.obj $(NDISASMOBJS) #OBJ file list $(EXED)ndisasm2$(EXE) #EXE file name NDISAMS2.MAP $(LIBS) $(LIBRARIES) #Libaries needed ! ################################################################ # Dependencies for all of NASM's obj files $(OBJD)assemble.$(OBJ): assemble.c nasm.h assemble.h insns.h $(NASM_ASM) $(OBJD)float.$(OBJ): float.c nasm.h $(NASM_ASM) $(OBJD)labels.$(OBJ): labels.c nasm.h nasmlib.h $(NASM_ASM) $(OBJD)listing.$(OBJ): listing.c nasm.h nasmlib.h listing.h $(NASM_ASM) $(OBJD)eval.$(OBJ): eval.c nasm.h nasmlib.h eval.h $(NASM_ASM) $(OBJD)nasm.$(OBJ): nasm.c nasm.h nasmlib.h parser.h assemble.h labels.h \ listing.h outform.h $(NASM_ASM) $(OBJD)nasmlib.$(OBJ): nasmlib.c nasm.h nasmlib.h names.c insnsn.c $(NASM_ASM) $(OBJD)parser.$(OBJ): parser.c nasm.h nasmlib.h parser.h float.h names.c $(NASM_ASM) $(OBJD)preproc.$(OBJ): preproc.c macros.c preproc.h nasm.h nasmlib.h $(NASM_ASM) $(OBJD)insnsa.$(OBJ): insnsa.c nasm.h insns.h $(NASM_ASM) ################################################################ # Dependencies for all of NDISASM's obj files $(OBJD)disasm.$(OBJ): disasm.c nasm.h disasm.h sync.h insns.h names.c $(DASM_ASM) $(OBJD)ndisasm.$(OBJ): ndisasm.c nasm.h sync.h disasm.h $(DASM_ASM) $(OBJD)sync.$(OBJ): sync.c sync.h $(DASM_ASM) $(OBJD)insnsd.$(OBJ): insnsd.c nasm.h insns.h $(DASM_ASM) # This is a kludge from the word go, as we can't use the nasmlib.obj compiled # for NASM, as it's could be the wrong model size, so we have to compile it # again as huge to make sure. # # So as not to overwrite the nasmlib.obj for NASM (if it did, that # could cause all kinds of problems) it compiles it into nasmlibd.obj. # # the -o... switch tells it the name to compile the obj file to, right here # $(OBJD)nasmlibd.obj $(OBJD)nasmlibd.$(OBJ): nasmlib.c nasm.h nasmlib.h $(CC) $(DCCFLAGS) -o$(OBJD)nasmlibd.obj nasmlib.c ################################################################ # Dependencies for all of the output format's OBJ files $(OBJD)outas86.$(OBJ): outas86.c nasm.h nasmlib.h $(NASM_ASM) $(OBJD)outaout.$(OBJ): outaout.c nasm.h nasmlib.h $(NASM_ASM) $(OBJD)outbin.$(OBJ): outbin.c nasm.h nasmlib.h $(NASM_ASM) $(OBJD)outcoff.$(OBJ): outcoff.c nasm.h nasmlib.h $(NASM_ASM) $(OBJD)outdbg.$(OBJ): outdbg.c nasm.h nasmlib.h $(NASM_ASM) $(OBJD)outelf.$(OBJ): outelf.c nasm.h nasmlib.h $(NASM_ASM) $(OBJD)outobj.$(OBJ): outobj.c nasm.h nasmlib.h $(NASM_ASM) $(OBJD)outrdf.$(OBJ): outrdf.c nasm.h nasmlib.h $(NASM_ASM) $(OBJD)outform.$(OBJ): outform.c outform.h nasm.h $(NASM_ASM) ################################################################ # A quick way to delete the OBJ files as well as the binaries. clean : del $(OBJD)*.obj del nasmos2$(EXE) del ndisasm2$(EXE) # Makefile created by Chuck Crayne --05/4/99 # Based on Makefile.bc2 by Fox Cutter --01/27/97