2021-03-08 23:16:14 -05:00
|
|
|
CC = g++
|
|
|
|
CFLAGS += -g -O -Wall -Weffc++ -pedantic \
|
|
|
|
-pedantic-errors -Wextra -Waggregate-return -Wcast-align \
|
|
|
|
-Wcast-qual -Wconversion \
|
|
|
|
-Wdisabled-optimization \
|
|
|
|
-Werror -Wfloat-equal -Wformat=2 \
|
|
|
|
-Wformat-nonliteral -Wformat-security \
|
|
|
|
-Wformat-y2k \
|
|
|
|
-Wimport -Winit-self -Winline \
|
|
|
|
-Winvalid-pch \
|
|
|
|
-Wlong-long \
|
|
|
|
-Wmissing-field-initializers -Wmissing-format-attribute \
|
|
|
|
-Wmissing-include-dirs -Wmissing-noreturn \
|
|
|
|
-Wpacked -Wpadded -Wpointer-arith \
|
|
|
|
-Wredundant-decls \
|
|
|
|
-Wshadow -Wstack-protector \
|
|
|
|
-Wstrict-aliasing=2 -Wswitch-default \
|
|
|
|
-Wswitch-enum \
|
|
|
|
-Wunreachable-code -Wunused \
|
|
|
|
-Wunused-parameter \
|
|
|
|
-Wvariadic-macros \
|
|
|
|
-Wwrite-strings
|
|
|
|
#-ggdb -O0 -std=c89 -W -Wall -Wextra -pedantic
|
2021-03-08 16:59:27 -05:00
|
|
|
LDFLAGS += -lpthread -lircclient -lsqlite3
|
|
|
|
|
2021-03-09 01:39:19 -05:00
|
|
|
OBJ = db.o events.o io.o levenshtein.o spammer.o
|
|
|
|
|
2021-03-08 16:59:27 -05:00
|
|
|
all: spammer
|
|
|
|
|
2021-03-09 01:39:19 -05:00
|
|
|
spammer: $(OBJ)
|
2021-03-08 23:16:14 -05:00
|
|
|
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
|
2021-03-08 16:59:27 -05:00
|
|
|
|
|
|
|
# TODO: client side / offline access
|
2021-03-08 23:16:14 -05:00
|
|
|
db: db.o io.o
|
|
|
|
$(CC) -DTEST_DB $(CFLAGS) $^ -o $@ $(LDFLAGS)
|
2021-03-08 16:59:27 -05:00
|
|
|
|
|
|
|
clean:
|
2021-03-09 01:39:19 -05:00
|
|
|
$(RM) -rf spammer db a.out *.o *.db *.sqlite3
|