1#NMAKE makefile for Windows developers. 2#Produces a static library (GeoIP.lib). 3 4################################################################# 5# configuration section 6################################################################ 7 8# place to put the GeoIP.dat database file 9# !!! Please keep the 2 \\ as directory separators !!! 10# 11GEOIPDATADIR="C:\\Windows\\SYSTEM32" 12# 13# System inc, lib, and bin directories 14!ifndef INSTDIR 15INSTDIR="C:\GeoIP-1.4.5" 16!endif 17 18# Location where GeoIP.lib should be installed my "make install" 19INSTALL_LIB=$(INSTDIR)\Lib 20 21#Location where .h files should be installed by "make install". 22INSTALL_INC=$(INSTDIR)\Include 23 24#Location where programs should be installed by "make install". 25INSTALL_BIN=$(INSTDIR)\Bin 26 27################################################################ 28# end configuration section 29################################################################ 30 31DATA_DIR=data 32 33DATA_FILE=GeoIP.dat 34 35LIB_DIR = libGeoIP 36 37TEST_DIR=test 38 39APP_DIR=apps 40 41GEOIP_LIB = GeoIP.lib 42 43APP_PROGRAMS = geoiplookup.exe 44 45TEST_PROGRAMS = benchmark.exe test-geoip.exe 46 47all: GeoIP.lib test_progs app_progs 48 49$(GEOIP_LIB): 50 cd $(LIB_DIR) 51 $(MAKE) -nologo -f Makefile.vc GEOIPDATADIR=$(GEOIPDATADIR) 52 cd .. 53 54test_progs: 55 cd $(TEST_DIR) 56 $(MAKE) -nologo -f Makefile.vc 57 cd .. 58 59app_progs: 60 cd $(APP_DIR) 61 $(MAKE) -nologo -f Makefile.vc 62 cd .. 63 64test: $(GEOIP_LIB) test_progs 65 cd $(TEST_DIR) 66 benchmark.exe 67 test-geoip.exe 68 cd .. 69 70install: $(GEOIP_LIB) app_progs 71 cd $(LIB_DIR) 72 copy $(GEOIP_LIB) $(INSTALL_LIB) 73 copy *.h $(INSTALL_INC) 74 cd ..\$(APP_DIR) 75 copy $(APP_PROGRAMS) $(INSTALL_BIN) 76 cd ..\$(DATA_DIR) 77 copy $(DATA_FILE) $(GEOIPDATADIR) 78 cd .. 79 80clean: 81 del $(LIB_DIR)\*.obj $(LIB_DIR)\*.lib \ 82 $(APP_DIR)\*.obj $(APP_DIR)\*.exe \ 83 $(TEST_DIR)\*.obj $(TEST_DIR)\*.exe 84 85