iptogeo/src/Makefile

38 lines
565 B
Makefile
Raw Permalink Normal View History

2016-01-31 11:42:28 +01:00
2016-02-17 18:15:04 +01:00
BIN_DIR =../bin
SRCS = ip_to_geo.c test.c cmdline.c server.c
TARGET = $(BIN_DIR)/ip_to_geo
CFLAGS = -Wall
LDFLAGS = -lpthread
2016-01-31 11:42:28 +01:00
2016-02-04 20:39:50 +01:00
ifneq ($(DEBUG),)
CFLAGS += -ggdb -O0
else
CFLAGS += -O2
endif
2016-02-17 18:15:04 +01:00
ifeq ($(USE_SECCOMP),1)
2016-02-04 20:39:50 +01:00
CFLAGS += -DUSE_SECCOMP=1
LDFLAGS += -lseccomp
endif
2016-02-04 20:39:50 +01:00
all: $(BIN_DIR) ip_data.c $(TARGET)
$(BIN_DIR):
@mkdir $(BIN_DIR)
2016-01-31 11:42:28 +01:00
2016-02-24 19:17:40 +01:00
ip_data.c: $(BIN_DIR)
2016-02-04 20:39:50 +01:00
make -C ../data
2016-01-31 11:42:28 +01:00
cmdline.c: cmdline.ggo
gengetopt --input $^
2016-02-24 19:17:40 +01:00
$(TARGET): ip_data.c $(SRCS)
gcc $(CFLAGS) $(SRCS) $(LDFLAGS) -o $@
2016-01-31 11:42:28 +01:00
clean:
rm -f *~ $(TARGET)
2016-02-04 20:39:50 +01:00
ultra_clean: clean
rm -f ip_data.c