44 lines
627 B
Makefile
44 lines
627 B
Makefile
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
|
|
|
|
OPT := -ggdb -O0
|
|
|
|
ifeq ($(O),1)
|
|
OPT := -g -O1
|
|
endif
|
|
|
|
ifeq ($(O),2)
|
|
OPT := -g0 -O2
|
|
endif
|
|
|
|
ifeq ($(O),s)
|
|
OPT := -g0 -Os
|
|
endif
|
|
|
|
CFLAGS += $(OPT) -std=c99 $(WARN)
|
|
CFLAGS += -I.
|
|
|
|
LDFLAGS += -lircclient -lpthread
|
|
|
|
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 *.exe *.dll
|