quote-bot/makefile
Bubblegumdrop 823330dde9 Insert, update, run script, run single query.
Most of the basic db functionality is in place now.

Changing print_col out for a user-supplied callback function might be a
cool idea.
2021-03-11 12:48:15 -05:00

47 lines
1.1 KiB
Makefile

INLINE_SQLITE ?= 0
CC ?= gcc
WARN := -W -Wall -Wextra -pedantic -pedantic-errors \
-Wcast-qual -Wconversion \
-Wdisabled-optimization \
-Werror -Wfloat-equal -Wformat=2 \
-Wformat-nonliteral -Wformat-security \
-Wformat-y2k \
-Wimport -Winit-self -Winline \
-Winvalid-pch \
-Wmissing-field-initializers -Wmissing-format-attribute \
-Wmissing-include-dirs -Wmissing-noreturn \
-Wpointer-arith \
-Wredundant-decls \
-Wshadow -Wstack-protector \
-Wstrict-aliasing=2 -Wswitch-default \
-Wswitch-enum \
-Wunreachable-code -Wunused \
-Wunused-parameter \
-Wvariadic-macros \
-Wwrite-strings
#-Wpacked -Wpadded
CFLAGS += -ggdb -O0 -std=c99 $(WARN)
CFLAGS += -I.
LDFLAGS += -lpthread -lircclient -ldl
SRC = $(wildcard *.c)
OBJ = $(SRC:.c=.o)
ifeq ($(INLINE_SQLITE),0)
TMP := $(OBJ)
OBJ := $(filter-out sqlite3.o,$(TMP))
LDFLAGS += -lsqlite3
endif
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