This repository has been archived on 2019-11-14. You can view files and clone it, but cannot push or open issues or pull requests.
rip-vm2/partage/Makefile
COLIN Cyril 2642e66fde lol
2019-10-25 11:37:27 +02:00

37 lines
629 B
Makefile

CC := gcc -Wall -Wextra -Wpedantic -Werror -Iinclude -g
build/iftun.a: build/iftun.o
ar rcs $@ $^
build/iftun: build/iftun.a
# LIBS :=
# LDFLAGS := $(LDFLAGS) $(shell pkg-config --libs $(LIBS))
# CFLAGS := $(CFLAGS) $(shell pkg-config --cflags $(LIBS))
BUILD_DIR ?= build
OUT := $(notdir $(shell pwd))
SRC := $(wildcard src/*.c)
OBJS := $(patsubst src/%.c,$(BUILD_DIR)/%.o,$(SRC))
DEPS := $(wildcard $(BUILD_DIR)/*.d)
$(BUILD_DIR)/$(OUT): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $^
-include $(DEPS)
$(BUILD_DIR)/%.o: src/%.c
$(CC) $(CFLAGS) -MP -MD $< -c -o $@
clean:
-rm -f $(BUILD_DIR)/*.o
-rm -f $(BUILD_DIR)/*.d