22 lines
552 B
Makefile
22 lines
552 B
Makefile
CROSS_COMPILE ?=
|
|
CC := $(CROSS_COMPILE)gcc
|
|
STRIP := $(CROSS_COMPILE)strip
|
|
CFLAGS += -g -Os -Wall -Iip2region -Iqqwry
|
|
LIBS = -lm -static
|
|
BIN := denyip
|
|
|
|
all: $(BIN) # 默认目标
|
|
|
|
ipquery: # Go 构建目标
|
|
cd IP_region_query && CGO_ENABLED=0 go build -ldflags '-w -s'
|
|
|
|
$(BIN): main.o common.o ip2region/ip2region.o ip2region/xdb_searcher.o qqwry/qqwry.o
|
|
$(CC) $(CFLAGS) -o $(BIN) $^ $(LIBS)
|
|
|
|
%.o: %.c
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
clean:
|
|
rm -rf $(BIN) ipquery
|
|
rm -rf main.o common.o ip2region/ip2region.o ip2region/xdb_searcher.o qqwry/qqwry.o
|