mirror of
https://github.com/lionsoul2014/ip2region.git
synced 2026-01-25 17:16:11 +00:00
This is an Makefile for the binding/c program, can use to generate the db file ip2config.db and the test program testSearcher, can be very convient for the new starter.
27 lines
506 B
Makefile
27 lines
506 B
Makefile
A = @
|
|
CFLAGS= -g
|
|
CC= gcc
|
|
LIBS= -I./
|
|
LDFLAGS=
|
|
RM = rm -f
|
|
MV = mv
|
|
|
|
testSearcher: ip2region.o
|
|
$(A) $(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) -o testSearcher testSearcher.c ip2region.c
|
|
$(A) $(RM) ip2region.o testSearcher.o
|
|
|
|
db:
|
|
$(A) cd ../../;\
|
|
export LANG=en_US.UTF-8;\
|
|
java -jar dbMaker-1.2.2.jar -src ./data/ip.merge.txt -region ./data/global_region.csv -dst .;\
|
|
$(MV) ./ip2region.db ./binding/c/;\
|
|
cd ./binding/c
|
|
|
|
all: db testSearcher
|
|
|
|
|
|
clean:
|
|
$(A) $(RM) testSearcher
|
|
|
|
.PHONY: all clean testSearcher db
|