iptogeo/src/Makefile

38 lines
565 B
Makefile

BIN_DIR =../bin
SRCS = ip_to_geo.c test.c cmdline.c server.c
TARGET = $(BIN_DIR)/ip_to_geo
CFLAGS = -Wall
LDFLAGS = -lpthread
ifneq ($(DEBUG),)
CFLAGS += -ggdb -O0
else
CFLAGS += -O2
endif
ifeq ($(USE_SECCOMP),1)
CFLAGS += -DUSE_SECCOMP=1
LDFLAGS += -lseccomp
endif
all: $(BIN_DIR) ip_data.c $(TARGET)
$(BIN_DIR):
@mkdir $(BIN_DIR)
ip_data.c: $(BIN_DIR)
make -C ../data
cmdline.c: cmdline.ggo
gengetopt --input $^
$(TARGET): ip_data.c $(SRCS)
gcc $(CFLAGS) $(SRCS) $(LDFLAGS) -o $@
clean:
rm -f *~ $(TARGET)
ultra_clean: clean
rm -f ip_data.c