YAIP/Makefile
Jonathan Hodgson 8a5bfe9b36 Now working for simple, non-encrypted requests
making requests to something like example.com over a non-encrypted
connection now works. Binary files are unlikely to work at the moment
although I haven't tried. Also, non-encrypted doesn't work.

I have also changed a little about how tests work. Requests tests now
display much better.
2022-01-18 21:45:58 +00:00

37 lines
643 B
Makefile

# 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
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)