This repository has been archived by the owner on Jun 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 129
/
Makefile.vc
110 lines (84 loc) · 2.9 KB
/
Makefile.vc
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
#NMAKE makefile for Windows developers.
#Produces a static library (libGeoIP.lib).
#Produces a DLL (GeoIP.dll) and import library (GeoIP.lib).
#################################################################
# configuration section
################################################################
# place to put the GeoIP.dat database file
# !!! Please keep the 2 \\ as directory separators !!!
#
GEOIPDATADIR="C:\\Windows\\SYSTEM32"
#
# System inc, lib, and bin directories
!ifndef INSTDIR
INSTDIR="C:\GeoIP"
!endif
# Location where GeoIP.lib should be installed my "make install"
INSTALL_LIB=$(INSTDIR)\Lib
#Location where .h files should be installed by "make install".
INSTALL_INC=$(INSTDIR)\Include
#Location where programs should be installed by "make install".
INSTALL_BIN=$(INSTDIR)\Bin
################################################################
# end configuration section
################################################################
DATA_DIR=data
DATA_FILE=GeoIP.dat
LIB_DIR = libGeoIP
TEST_DIR=test
APP_DIR=apps
GEOIP_LIB = GeoIP.lib
LIBGEOIP_LIB = libGeoIP.lib
APP_PROGRAMS = geoiplookup.exe
TEST_PROGRAMS = benchmark.exe test-geoip.exe
all: GeoIP.lib libGeoIP.lib test_progs app_progs
$(GEOIP_LIB):
cd $(LIB_DIR)
$(MAKE) -nologo -f Makefile.vc GeoIP.lib GEOIPDATADIR=$(GEOIPDATADIR) GEOIP_EXPORTS=1
cd ..
$(LIBGEOIP_LIB):
$(MAKE) -nologo -f Makefile.vc clean
cd $(LIB_DIR)
$(MAKE) -nologo -f Makefile.vc libGeoIP.lib GEOIPDATADIR=$(GEOIPDATADIR)
cd ..
test_progs:
cd $(TEST_DIR)
$(MAKE) -nologo -f Makefile.vc
cd ..
app_progs:
cd $(APP_DIR)
$(MAKE) -nologo -f Makefile.vc
cd ..
test: $(GEOIP_LIB) test_progs
cd $(TEST_DIR)
benchmark.exe
test-geoip.exe
cd ..
install: $(GEOIP_LIB) all
if not exist "$(INSTALL_LIB)" mkdir "$(INSTALL_LIB)"
if not exist "$(INSTALL_INC)" mkdir "$(INSTALL_INC)"
if not exist "$(INSTALL_BIN)" mkdir "$(INSTALL_BIN)"
cd "$(LIB_DIR)"
for %L in ($(GEOIP_LIB) $(LIBGEOIP_LIB)) do copy %L "$(INSTALL_LIB)"
for %I in (GeoIP.h GeoIPCity.h) do copy %I "$(INSTALL_INC)"
copy GeoIP.dll "$(INSTALL_BIN)"
cd ..\$(APP_DIR)
copy $(APP_PROGRAMS) "$(INSTALL_BIN)"
cd ..\$(DATA_DIR)
copy $(DATA_FILE) "$(GEOIPDATADIR)"
cd ..
uninstall:
if exist "$(INSTALL_LIB)\GeoIP.lib" del "$(INSTALL_LIB)\GeoIP.lib"
if exist "$(INSTALL_LIB)\libGeoIP.lib" del "$(INSTALL_LIB)\libGeoIP.lib"
if exist "$(INSTALL_INC)\GeoIP.h" del "$(INSTALL_INC)\GeoIP.h"
if exist "$(INSTALL_INC)\GeoIPCity.h" del "$(INSTALL_INC)\GeoIPCity.h"
if exist "$(INSTALL_BIN)\GeoIP.dll" del "$(INSTALL_BIN)\GeoIP.dll"
if exist "$(INSTALL_BIN)\$(APP_PROGRAMS)" del "$(INSTALL_BIN)\$(APP_PROGRAMS)"
clean:
del $(LIB_DIR)\*.obj
del $(APP_DIR)\*.obj
del $(TEST_DIR)\*.obj
realclean:
del $(LIB_DIR)\*.obj $(LIB_DIR)\*.lib $(LIB_DIR)\*.exp $(LIB_DIR)\*.dll
del $(APP_DIR)\*.obj $(APP_DIR)\*.exe
del $(TEST_DIR)\*.obj $(TEST_DIR)\*.exe