home *** CD-ROM | disk | FTP | other *** search
Makefile | 1990-04-25 | 9.4 KB | 338 lines |
- #**********************************************************************
- # builtins.mak - "built-in" rules for Borland MAKE utility
- #**********************************************************************
-
- # we're on drive c
- DRIVE=C:
-
- #**********************************************************************
- # if the symbol MAKE_INIT is defined, then it should contain a
- # filename which will be included here. this file can override
- # defaults supplied below, etc.
- #**********************************************************************
-
- !if $d(MAKE_INIT)
- !include "$(MAKE_INIT)"
- !endif
-
- #**********************************************************************
- # set the names for the compiler, assembler, etc.
- #**********************************************************************
-
- !if !$d(CMD_COMPILER)
- CMD_COMPILER=tcc
- !endif
-
- !if !$d(CMD_PREPROCESS)
- CMD_PREPROCESS=cpp
- !endif
-
- !if !$d(CMD_ASSEMBLER)
- CMD_ASSEMBLER=tasm
- !endif
-
- !if !$d(CMD_LINKER)
- CMD_LINKER=tlink
- !endif
-
- !if !$d(CMD_LIBMGR)
- CMD_LIBMGR=tlib
- !endif
-
- #**********************************************************************
- # set the memory model if not already specified
- #**********************************************************************
-
- !if $d(CC_SMALL_MODEL)
- CC_MEM_MODEL=s
- !endif
- !if $d(CC_MEDIUM_MODEL)
- CC_MEM_MODEL=m
- !endif
- !if $d(CC_COMPACT_MODEL)
- CC_MEM_MODEL=c
- !endif
- !if $d(CC_LARGE_MODEL)
- CC_MEM_MODEL=l
- !endif
-
- !if $d(CC_HUGE_MODEL)
- CC_MEM_MODEL=h
- !endif
-
- !if !$d(CC_MEM_MODEL)
- CC_MEM_MODEL=l
- !endif
-
- #**********************************************************************
- # set the optimization if not already specified
- #**********************************************************************
-
- !if !$d(CC_OPTIMIZE)
- !if !$d(CC_DEBUG)
- CC_OPTIMIZE=-G -O -Z
- !else
- CC_OPTIMIZE=-G- -O- -Z-
- !endif
- !endif
-
- #**********************************************************************
- # set the debugging options, if not already specified
- #**********************************************************************
-
- !if !$d(CC_DEBUG)
- CC_DEBUG=
- !else
- CC_DEBUG=-v -N
- !endif
-
- #**********************************************************************
- # miscellaneous compiler flags the user might want
- #**********************************************************************
-
- !if !$d(CFLAGS)
- CFLAGS=
- !endif
-
- #**********************************************************************
- # the compiler include files are here
- #**********************************************************************
-
- CC_INCLUDE=$(DRIVE)\tc\inc
-
- #**********************************************************************
- # tell where to find application include files
- #**********************************************************************
-
- !if !$d(CC_APPL_INCLUDE)
- CC_APPL_INCLUDE=
- !endif
-
- #**********************************************************************
- # controls structure packing
- #**********************************************************************
-
- !if !$d(CC_ALIGN)
- CC_PACK=1
- !endif
-
- !if !$d(CC_PACK)
- CC_STRUC=-a
- !else
- CC_STRUC=-a-
- !endif
-
- #**********************************************************************
- # this command runs the compiler
- #**********************************************************************
-
- RUN_CC=$(CMD_COMPILER) -m$(CC_MEM_MODEL) $(CC_DEBUG) \
- -I$(CC_INCLUDE) -I$(CC_APPL_INCLUDE) $(CC_OPTIMIZE) -c -K $(CC_STRUC)
-
- #**********************************************************************
- # here's how to compile a .c to get a .obj file
- #**********************************************************************
-
- CC=$(RUN_CC) -o$* $&
-
- .c.obj:
- $(CC)
-
- #**********************************************************************
- # this command runs the c preprocessor
- #**********************************************************************
-
- RUN_CPP=$(CMD_PREPROCESS) -m$(CC_MEM_MODEL) \
- -I$(CC_INCLUDE) -I$(CC_APPL_INCLUDE) -A -P-
-
- #**********************************************************************
- # create a .i file from a .c file (run cpp)
- #**********************************************************************
-
- CPP=$(RUN_CPP) -o$&.i $&
-
- .c.i:
- $(CPP)
-
- #**********************************************************************
- # this command runs the prototype generator
- #**********************************************************************
-
- PROTO_ARGS=-r -i$(CC_APPL_INCLUDE) -i$(CC_INCLUDE) -o $*.pro
-
- PROTO=-proto $&.i $(PROTO_ARGS)
-
- MAKEPROTO=-mkproto $&.i $(PROTO_ARGS)
-
- RUN_PROTO=-proto $(PROTO_ARGS)
-
- #**********************************************************************
- # a .pro file is a .h file containing function prototypes
- #**********************************************************************
-
- .c.pro:
- $(CPP)
- $(MAKEPROTO)
-
- .i.pro:
- $(PROTO)
-
- #**********************************************************************
- # user assembly language includes
- #**********************************************************************
-
- !if !$d(ASM_APPL_INCLUDE)
- ASM_APPL_INCLUDE=
- !endif
-
- #**********************************************************************
- # the assembler include files are here
- #**********************************************************************
-
- ASM_INCLUDE=$(DRIVE)\tc\mac
-
- #**********************************************************************
- # by default, it thinks it's masm 5.1
- #**********************************************************************
-
- !if !$d(ASM_SYNTAX)
- ASM_SYNTAX=MASM51
- !endif
-
- #**********************************************************************
- # by default, everything should be case sensitive (for C)
- #**********************************************************************
-
- !if !$d(ASM_CASE_SENS)
- ASM_CASE_SENS=/ml
- !endif
-
- #**********************************************************************
- # debug info from assembler
- #**********************************************************************
-
- !if !$d(ASM_DEBUG)
- ASM_DEBUG=/zi
- !endif
-
- #**********************************************************************
- # miscellaneous assembler flags the user might want
- #**********************************************************************
-
- !if !$d(AFLAGS)
- AFLAGS=
- !endif
-
- #**********************************************************************
- # this command runs the assembler
- #**********************************************************************
-
- RUN_ASM=$(CMD_ASSEMBLER) $(ASM_DEBUG) /j$(ASM_SYNTAX) /i$(ASM_INCLUDE) \
- /i$(ASM_APPL_INCLUDE) $(ASM_CASE_SENS) $(AFLAGS)
-
- #**********************************************************************
- # here's how to assemble a .asm to get a .obj file
- #**********************************************************************
-
- ASM=$(RUN_ASM) $&,$*
-
- .asm.obj:
- $(ASM)
-
- #**********************************************************************
- # how to create a .lib from a .bld (a list of .obj's)
- #
- # a .bld file is a file containing a list of .obj filenames, each
- # preceded by a '-+' sequence, and each line except the last ends
- # with a '&' character
- #
- # the list of files in the .bld file should match the list of
- # .obj files in the library's dependency list in the makefile,
- # or else it isn't of much use
- #**********************************************************************
-
- RUN_LIB=$(CMD_LIBMGR) /C
-
- MAKELIB=$(RUN_LIB) $*.lib @$&.bld
-
- .bld.lib:
- $(MAKELIB)
-
- #**********************************************************************
- # misc linker flags
- #**********************************************************************
-
- !if !$d(LFLAGS)
- LFLAGS=
- !endif
-
- #**********************************************************************
- # linker map file options
- #**********************************************************************
-
- !if !$d(LINK_MAP)
- LINK_MAP=/m
- !endif
-
- #**********************************************************************
- # linker debug info options
- #**********************************************************************
-
- !if !$d(LINK_DBG)
- LINK_DBG=/v
- !endif
-
- #**********************************************************************
- # macro for location of turbo libraries
- #**********************************************************************
-
- !if !$d(CC_LIB_DIR)
- CC_LIB_DIR=$(DRIVE)\tc\lib
- !endif
-
- #**********************************************************************
- # macros for full pathnames of compiler libraries
- #
- # if CC_NO_FLOAT is defined, then math libs will not be linked in
- # if CC_GRAFIX is defined, the graphics library will be searched
- #**********************************************************************
-
- CC_STARTUP=$(CC_LIB_DIR)\c0$(CC_MEM_MODEL)
-
- !if $d(CC_GRAFIX)
- CC_GRAFLIB=$(CC_LIB_DIR)\graphics
- !else
- CC_GRAFLIB=
- !endif
-
- !if !$d(CC_FP_LIB)
- CC_FP_LIB=$(CC_LIB_DIR)\emu
- !endif
-
- CC_MATH_LIB=$(CC_LIB_DIR)\math$(CC_MEM_MODEL)
-
- CC_C_LIB=$(CC_LIB_DIR)\c$(CC_MEM_MODEL)
-
- !if !$d(CC_NO_FLOAT)
- CC_LIBS=$(CC_GRAFLIB) $(CC_FP_LIB) $(CC_MATH_LIB) $(CC_C_LIB)
- !else
- CC_LIBS=$(CC_GRAFLIB) $(CC_C_LIB)
- !endif
-
- #**********************************************************************
- # how to create a .exe file from a .lnk file
- #
- # a .lnk file is a list of objs, libs, etc in linker command format
- # (see the documentation of the linker for more information)
- #
- # the list of .objs and .libs in the .lnk file should match the
- # dependency list for the .exe file, or else it isn't of much use
- #**********************************************************************
-
- RUN_LINK=$(CMD_LINKER) /c $(LFLAGS) $(LINK_MAP) $(LINK_DBG)
-
- LINK=$(RUN_LINK) $(CC_STARTUP)+ @$&.lnk $(CC_LIBS)
-
- .lnk.exe:
- $(LINK)
-