CC := gcc -Wall -Wextra -Wpedantic -Werror -Iinclude -std=c11 -g
all: build test-iftun
build:
-mkdir build
test-iftun: build/test-iftun.o build/iftun.a
$(CC) $(CFLAGS) $^ -o $@
build/test-iftun.o: src/test-iftun.c src/iftun.h
$(CC) $(CFLAGS) $< -c -o $@
build/iftun.a: build/iftun.o
ar rcs $@ $<
build/iftun.o: src/iftun.c src/iftun.h
clean:
-rm -f $(BUILD_DIR)/*.o
-rm -f $(BUILD_DIR)/*.d