iptogeo/src/Makefile

38 lines
539 B
Makefile
Raw 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
ip_data.c:
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 $^
$(TARGET): $(SRCS)
2016-02-04 20:39:50 +01:00
gcc $(CFLAGS) $^ $(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