# # $Id$ # # # Makefile for Harbour Project for Microsoft Visual C (32 bits) # # # NOTE: You can use these envvars to configure the make process: # (note that these are all optional) # # CFLAGS - Extra C compiler options for libraries and for # executables # C_USR - Extra C compiler options for libraries and for # executables (GNU make compatible envvar) # CLIBFLAGS - Extra C compiler options for the libraries # HARBOURFLAGS - Extra Harbour compiler options # PRG_USR - Extra Harbour compiler options # (GNU make compatible envvar) # # # Notes about this makefile: # # 1. To add new files to a dependancy list, add an obj name to one of the # OBJ lists for the appropriate library. # NOTE: put .prg related obj's last in the lib list. # # 2. This is a recursive script. If you change the name of this file, # be sure to change MK_FILE (a few lines down) to the new name as well. # # 3. Recurrsion rules are quite simple: # If you specifiy /a on the command line, files in the obj\vc dir # will be deleted, and when nmake recurses, it's without the /a flag # # If a .prg.obj rule is fired, nmake will execute this script with # a specific target as a parameter immediatley after compiling a given # set of prg files. # ie: Harbour $< # nmake /fmakefile.vc obj\vc\rtl.lib2 # which will simply get make to re-evaluate the dependancy list for the # lib, and as a result, it will execute the C compiler using the .c.obj # rule below to create the obj's for the prg's that were created just # prior to the recurrsive call. Once the obj's are created, the # recurrsion is complete. # See additional notes under RTL.LIB below. # MK_FILE = makefile.vc MK_FLAGS = $(MAKEFLAGS: =) OBJ_DIR = ..\..\obj\vc LIB_DIR = ..\..\lib\vc BIN_DIR = ..\..\bin # # Directory macros. These should never have to change. # INCLUDE_DIR = ..\..\include TOOLS_DIR = . # # C compiler definition and C flags. These should never have to change. # AS = masm CFLAGS = -I$(INCLUDE_DIR) -TP -W3 -nologo $(C_USR) $(CFLAGS) CLIBFLAGS = -c $(CFLAGS) $(CLIBFLAGS) CLIBFLAGSDEBUG = -Zi $(CLIBFLAGS) HARBOURFLAGS = -i$(INCLUDE_DIR) -n -q0 -w -es2 -gc0 $(PRG_USR) $(HARBOURFLAGS) LDFLAGS = $(LDFLAGS) # # Macros to access our library names # TOOLS_LIB = $(LIB_DIR)\libct.lib HARBOUR_EXE = $(BIN_DIR)\harbour.exe # # Rules # .SUFFIXES: .prg .lib .c .obj .asm # override builtin .c.obj:: $(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $< # # # LIBLIST = \ $(TOOLS_LIB) # # TOOLS.LIB rules # {$(TOOLS_DIR)}.c{$(OBJ_DIR)}.obj:: $(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $< {$(TOOLS_DIR)}.prg{$(OBJ_DIR)}.obj:: $(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $< $(MAKE) -nologo /$(MK_FLAGS) /f$(MK_FILE) $(TOOLS_LIB)2 TOOLS_LIB_OBJS = \ $(OBJ_DIR)\addascii.obj \ $(OBJ_DIR)\asciisum.obj \ $(OBJ_DIR)\ascpos.obj \ $(OBJ_DIR)\atadjust.obj \ $(OBJ_DIR)\atnum.obj \ $(OBJ_DIR)\atrepl.obj \ $(OBJ_DIR)\bit1.obj \ $(OBJ_DIR)\bit2.obj \ $(OBJ_DIR)\bit3.obj \ $(OBJ_DIR)\charevod.obj \ $(OBJ_DIR)\charlist.obj \ $(OBJ_DIR)\charmirr.obj \ $(OBJ_DIR)\charmix.obj \ $(OBJ_DIR)\charone.obj \ $(OBJ_DIR)\charonly.obj \ $(OBJ_DIR)\charop.obj \ $(OBJ_DIR)\charrepl.obj \ $(OBJ_DIR)\charsort.obj \ $(OBJ_DIR)\charswap.obj \ $(OBJ_DIR)\count.obj \ $(OBJ_DIR)\ctc.obj \ $(OBJ_DIR)\ctmath.obj \ $(OBJ_DIR)\ctset.obj \ $(OBJ_DIR)\ctstr.obj \ $(OBJ_DIR)\ctchksum.obj \ $(OBJ_DIR)\ctcrypt.obj \ $(OBJ_DIR)\exponent.obj \ $(OBJ_DIR)\finan.obj \ $(OBJ_DIR)\ftoc.obj \ $(OBJ_DIR)\justify.obj \ $(OBJ_DIR)\keyset.obj \ $(OBJ_DIR)\math.obj \ $(OBJ_DIR)\misc1.obj \ $(OBJ_DIR)\num1.obj \ $(OBJ_DIR)\numat.obj \ $(OBJ_DIR)\pad.obj \ $(OBJ_DIR)\pos1.obj \ $(OBJ_DIR)\pos2.obj \ $(OBJ_DIR)\posdiff.obj \ $(OBJ_DIR)\print.obj \ $(OBJ_DIR)\range.obj \ $(OBJ_DIR)\relation.obj \ $(OBJ_DIR)\remove.obj \ $(OBJ_DIR)\replace.obj \ $(OBJ_DIR)\screen1.obj \ $(OBJ_DIR)\strdiff.obj \ $(OBJ_DIR)\strswap.obj \ $(OBJ_DIR)\tab.obj \ $(OBJ_DIR)\token1.obj \ $(OBJ_DIR)\token2.obj \ $(OBJ_DIR)\trig.obj \ $(OBJ_DIR)\wordrepl.obj \ $(OBJ_DIR)\wordtoch.obj \ \ $(OBJ_DIR)\color.obj \ $(OBJ_DIR)\ct.obj \ $(OBJ_DIR)\ctmisc.obj \ $(OBJ_DIR)\datetime.obj \ $(OBJ_DIR)\dattime2.obj \ $(OBJ_DIR)\invertwin.obj \ $(OBJ_DIR)\numconv.obj \ $(OBJ_DIR)\screen2.obj \ $(OBJ_DIR)\setlast.obj \ # # Our default target # all: \ $(TOOLS_LIB) CLEAN: -@if exist $(OBJ_DIR)\addascii.* del $(OBJ_DIR)\addascii.* -@if exist $(OBJ_DIR)\asciisum.* del $(OBJ_DIR)\asciisum.* -@if exist $(OBJ_DIR)\ascpos.* del $(OBJ_DIR)\ascpos.* -@if exist $(OBJ_DIR)\atadjust.* del $(OBJ_DIR)\atadjust.* -@if exist $(OBJ_DIR)\atnum.* del $(OBJ_DIR)\atnum.* -@if exist $(OBJ_DIR)\atrepl.* del $(OBJ_DIR)\atrepl.* -@if exist $(OBJ_DIR)\bit1.* del $(OBJ_DIR)\bit2.* -@if exist $(OBJ_DIR)\bit2.* del $(OBJ_DIR)\bit2.* -@if exist $(OBJ_DIR)\bit3.* del $(OBJ_DIR)\bit2.* -@if exist $(OBJ_DIR)\charevod.* del $(OBJ_DIR)\charevod.* -@if exist $(OBJ_DIR)\charlist.* del $(OBJ_DIR)\charlist.* -@if exist $(OBJ_DIR)\charmirr.* del $(OBJ_DIR)\charmirr.* -@if exist $(OBJ_DIR)\charmix.* del $(OBJ_DIR)\charmix.* -@if exist $(OBJ_DIR)\charone.* del $(OBJ_DIR)\charone.* -@if exist $(OBJ_DIR)\charonly.* del $(OBJ_DIR)\charonly.* -@if exist $(OBJ_DIR)\charop.* del $(OBJ_DIR)\charop.* -@if exist $(OBJ_DIR)\charrepl.* del $(OBJ_DIR)\charrepl.* -@if exist $(OBJ_DIR)\charsort.* del $(OBJ_DIR)\charsort.* -@if exist $(OBJ_DIR)\charswap.* del $(OBJ_DIR)\charswap.* -@if exist $(OBJ_DIR)\count.* del $(OBJ_DIR)\count.* -@if exist $(OBJ_DIR)\ctc.* del $(OBJ_DIR)\ctc.* -@if exist $(OBJ_DIR)\ctmath.* del $(OBJ_DIR)\ctmath.* -@if exist $(OBJ_DIR)\ctset.* del $(OBJ_DIR)\ctset.* -@if exist $(OBJ_DIR)\ctstr.* del $(OBJ_DIR)\ctstr.* -@if exist $(OBJ_DIR)\ctchksum.* del $(OBJ_DIR)\ctchksum.* -@if exist $(OBJ_DIR)\ctcrypt.* del $(OBJ_DIR)\ctcrypt.* -@if exist $(OBJ_DIR)\exponent.* del $(OBJ_DIR)\exponent.* -@if exist $(OBJ_DIR)\finan.* del $(OBJ_DIR)\finan.* -@if exist $(OBJ_DIR)\ftoc.* del $(OBJ_DIR)\ftoc.* -@if exist $(OBJ_DIR)\justify.* del $(OBJ_DIR)\justify.* -@if exist $(OBJ_DIR)\math.* del $(OBJ_DIR)\math.* -@if exist $(OBJ_DIR)\misc1.* del $(OBJ_DIR)\misc1.* -@if exist $(OBJ_DIR)\num1.* del $(OBJ_DIR)\num1.* -@if exist $(OBJ_DIR)\numat.* del $(OBJ_DIR)\numat.* -@if exist $(OBJ_DIR)\pad.* del $(OBJ_DIR)\pad.* -@if exist $(OBJ_DIR)\pos1.* del $(OBJ_DIR)\pos1.* -@if exist $(OBJ_DIR)\pos2.* del $(OBJ_DIR)\pos2.* -@if exist $(OBJ_DIR)\posdiff.* del $(OBJ_DIR)\posdiff.* -@if exist $(OBJ_DIR)\range.* del $(OBJ_DIR)\range.* -@if exist $(OBJ_DIR)\relation.* del $(OBJ_DIR)\relation.* -@if exist $(OBJ_DIR)\remove.* del $(OBJ_DIR)\remove.* -@if exist $(OBJ_DIR)\replace.* del $(OBJ_DIR)\replace.* -@if exist $(OBJ_DIR)\strdiff.* del $(OBJ_DIR)\strdiff.* -@if exist $(OBJ_DIR)\screen1.* del $(OBJ_DIR)\screen1.* -@if exist $(OBJ_DIR)\strswap.* del $(OBJ_DIR)\strswap.* -@if exist $(OBJ_DIR)\tab.* del $(OBJ_DIR)\tab.* -@if exist $(OBJ_DIR)\token1.* del $(OBJ_DIR)\token1.* -@if exist $(OBJ_DIR)\token2.* del $(OBJ_DIR)\token2.* -@if exist $(OBJ_DIR)\trig.* del $(OBJ_DIR)\trig.* -@if exist $(OBJ_DIR)\wordrepl.* del $(OBJ_DIR)\wordrepl.* -@if exist $(OBJ_DIR)\wordtoch.* del $(OBJ_DIR)\wordtoch.* -@if exist $(OBJ_DIR)\color.* del $(OBJ_DIR)\color.* -@if exist $(OBJ_DIR)\ct.* del $(OBJ_DIR)\ct.* -@if exist $(OBJ_DIR)\ctmisc.* del $(OBJ_DIR)\ctmisc.* -@if exist $(OBJ_DIR)\datetime.* del $(OBJ_DIR)\datetime.* -@if exist $(OBJ_DIR)\dattime2.* del $(OBJ_DIR)\dattime2.* -@if exist $(OBJ_DIR)\invertwin.* del $(OBJ_DIR)\invertwin.* -@if exist $(OBJ_DIR)\numconv.* del $(OBJ_DIR)\numconv.* -@if exist $(OBJ_DIR)\screen2.* del $(OBJ_DIR)\screen2.* -@if exist $(OBJ_DIR)\setlast.* del $(OBJ_DIR)\setlast.* -@if exist $(TOOLS_LIB) del $(TOOLS_LIB) # # Library dependencies and build rules # $(TOOLS_LIB) : $(TOOLS_LIB_OBJS) lib /out:$@ $** # dummy targets used for prg to c creation $(TOOLS_LIB)2 : $(TOOLS_LIB_OBJS)