Makefile for binding/c

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.
This commit is contained in:
helloKaiDing 2018-04-08 17:23:03 +08:00 committed by GitHub
parent d22d96cae2
commit d4dab91796
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 0 deletions

26
binding/c/Makefile Normal file
View File

@ -0,0 +1,26 @@
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