From d4dab917963dd3b07bb3dd2d614beeb516b16434 Mon Sep 17 00:00:00 2001 From: helloKaiDing <32038097+helloKaiDing@users.noreply.github.com> Date: Sun, 8 Apr 2018 17:23:03 +0800 Subject: [PATCH] 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. --- binding/c/Makefile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 binding/c/Makefile diff --git a/binding/c/Makefile b/binding/c/Makefile new file mode 100644 index 0000000..47a58ac --- /dev/null +++ b/binding/c/Makefile @@ -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