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