INLINE_SQLITE ?= 0 WARN := -W -Wall -Wextra -pedantic -pedantic-errors CC ?= gcc SRC := $(wildcard *.c) OBJ := $(SRC:.c=.o) ifeq ($(INLINE_SQLITE),0) TMP := $(OBJ) OBJ := $(filter-out sqlite3.o,$(TMP)) LDFLAGS += -lsqlite3 endif CFLAGS += -ggdb -O0 -std=c99 $(WARN) CFLAGS += -I. LDFLAGS += -lpthread -lircclient -ldl all: spammer sqlite3.o: sqlite3.c $(CC) -c $< -o $@ $(LDFLAGS) spammer: $(OBJ) $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) clean: $(RM) -rf spammer db a.out *.o *.db *.sqlite3