Yet Another Intercepting Proxy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
# This was stolen from here: https://avikdas.com/2019/12/16/makefiles-for-c-cpp-projects.html
|
|
|
|
|
|
|
|
CFILES = $(wildcard src/*.c)
|
|
|
|
OBJFILES = $(CFILES:.c=.o)
|
|
|
|
TESTFILES = $(wildcard tests/*.c)
|
|
|
|
TESTOUT = $(TESTFILES:.c=)
|
|
|
|
OUT = yaip
|
|
|
|
CFLAGS = -Wall -g
|
|
|
|
LDLIBS = -lsqlite3 -lm -lssl -lcrypto
|
|
|
|
CC = gcc
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: default
|
|
|
|
default: $(OUT)
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: run
|
|
|
|
run: $(OUT)
|
|
|
|
./$(OUT)
|
|
|
|
|
|
|
|
$(OUT): $(OBJFILES)
|
|
|
|
$(CC) -o $@ $^ $(LDLIBS)
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $^
|
|
|
|
|
|
|
|
tests/%.test: tests/%.test.c tests/munit/munit.c $(filter-out src/main.o, $(OBJFILES))
|
|
|
|
$(CC) -o $@ $^ $(LDLIBS)
|
|
|
|
|
|
|
|
|
|
|
|
test-%: tests/%.test
|
|
|
|
$<
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -f $(OBJFILES) $(OUT) $(TESTOUT)
|