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

33 lines
623 B
Makefile
Raw Normal View History

2019-11-06 07:36:00 +01:00
CC := gcc -Wall -Wextra -Wpedantic -Werror -Iinclude -g
2019-10-25 11:37:27 +02:00
2019-11-06 07:36:00 +01:00
LIBS :=
2019-10-25 11:37:27 +02:00
2019-11-06 07:36:00 +01:00
LDFLAGS := $(LDFLAGS) $(shell pkg-config --libs $(LIBS))
CFLAGS := $(CFLAGS) $(shell pkg-config --cflags $(LIBS))
2019-10-25 11:37:27 +02:00
2019-11-06 07:36:00 +01:00
CFLAGS := $(CFLAGS) -D_POSIX_C_SOURCE=200809L
2019-10-25 11:37:27 +02:00
2019-11-06 07:36:00 +01:00
BUILD_DIR ?= build
2019-10-25 23:53:43 +02:00
2019-11-06 07:36:00 +01:00
OUT := $(notdir $(shell pwd))
2019-10-25 23:53:43 +02:00
2019-11-06 07:36:00 +01:00
SRC := $(wildcard src/*.c)
OBJS := $(patsubst src/%.c,$(BUILD_DIR)/%.o,$(SRC))
DEPS := $(wildcard $(BUILD_DIR)/*.d)
2019-10-25 23:53:43 +02:00
2019-11-06 07:36:00 +01:00
all: ext-in ext-out test-iftun tunnel64d
2019-10-25 23:53:43 +02:00
2019-11-06 07:36:00 +01:00
$(OUT): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $^
2019-10-25 23:53:43 +02:00
2019-10-25 11:37:27 +02:00
2019-11-06 07:36:00 +01:00
-include $(DEPS)
$(BUILD_DIR)/%.o: src/%.c
$(CC) $(CFLAGS) -MP -MD $< -c -o $@
2019-10-25 11:37:27 +02:00
clean:
-rm -f $(BUILD_DIR)/*.o
-rm -f $(BUILD_DIR)/*.d