1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
|
#####
# Paths
#####
# This path should point to where the icmp files are.
!ifndef ICMP_DIR
ICMP_DIR=../icmp_dev-0.1.1
!endif
ICMP_INCLUDE=$(ICMP_DIR)
ICMP_LIB=$(ICMP_DIR)/i386
# This is where you want the compiler to put the binaries
# (including bing.exe).
BIN=bin
#####
# Macro definitions
#####
# General options
APPVER = 4.0
TARGETOS = BOTH
TARGETLANG = LANG_FRENCH
CPU=i386
!ifndef DEBUG
NODEBUG=1
!endif
!include <win32.mak>
# compilation
!ifdef BROWSER
cbrowser=-FR$(*D)/
!endif
!ifdef DEBUG
cdebug=-Od -Zi -Fd$(*D)/
!endif
!ifdef DLL
bing_cvars=$(cvarsdll)
!else
bing_cvars=$(cvars)
!endif
bing_cvars=-nologo $(bing_cvars) $(cdebug) $(cbrowser) -D$(CPU) -DNO_RANDOM -I$(ICMP_INCLUDE) -I. -Iinclude -c -Fo$(*D)/
# linking
!ifdef DEBUG
!ifdef DLL
ldebug=-debug msvcrtd.lib
!else
ldebug=-debug libcd.lib
!endif
!endif
bing_lflags=-nologo -nodefaultlib $(ldebug) -out:$@
!ifdef DLL
bing_libs=$(conlibsdll)
!else
bing_libs=$(conlibs)
!endif
bing_libs=$(bing_libs) wsock32.lib $(ICMP_LIB)/icmp.lib
######
# What to do
######
L_OBJS= \
$(BIN)/bing.obj \
$(BIN)/icmp_win32.obj \
$(BIN)/getopt.obj \
L_EXE= \
$(BIN)/bing.exe \
L_BSC= \
!ifdef BROWSER
$(BIN)/bing.bsc \
!endif
all: bin_dir $(L_EXE) $(L_BSC)
clean:
if exist $(BIN)\*.obj del $(BIN)\*.obj
if exist $(BIN)\*.exe del $(BIN)\*.exe
if exist $(BIN)\*.ilk del $(BIN)\*.ilk
if exist $(BIN)\*.pdb del $(BIN)\*.pdb
if exist $(BIN)\*.sbr del $(BIN)\*.sbr
if exist $(BIN)\*.bsc del $(BIN)\*.bsc
if exist $(BIN)\nul rmdir $(BIN)
bin_dir:
-if not exist $(BIN)\nul mkdir $(BIN)
help:
@echo "Usage: nmake -f makefile.nt [DLL=1] [DEBUG=1] [BROWSER=1] [all | clean | help]
@echo "
@echo " DLL=1
@echo " Causes bing to be dynamically linked with the C library.
@echo " DEBUG=1
@echo " Set DEBUG to 1 to generate debugging information for bing
@echo " BROWSER=1
@echo " Use this option to generate information for the Microsoft browser
@echo "
@echo " all
@echo " This causes bing to be built as specified by the options
@echo " above. This is the default action. Note that if you
@echo " change the options you should probably do a 'make clean'
@echo " before you re-generate bing.
@echo " clean
@echo " This action deletes all the generated files *including* 'bing.exe'.
@echo " help
@echo " This action displays this help information.
######
# Commands
######
# compilation
$(L_OBJS):
$(CC) $(bing_cvars) -o $*.obj $**
# link
$(L_EXE):
$(link) $(bing_lflags) $(bing_libs) $**
# browser
!ifdef BROWSER
$(L_BSC):
bscmake -nologo -o $@ $**
!endif
#####
# Dependencies
#####
$(BIN)/bing.obj: bing.c
$(BIN)/icmp_win32.obj: win32/icmp_win32.c
$(BIN)/getopt.obj: win32/getopt.c
$(BIN)/bing.exe: \
$(BIN)/bing.obj \
$(BIN)/icmp_win32.obj \
$(BIN)/getopt.obj \
!ifdef BROWSER
$(BIN)/bing.bsc: \
$(BIN)/bing.sbr \
$(BIN)/icmp_win32.sbr \
$(BIN)/getopt.sbr \
!endif
|