30 lines
571 B
Makefile
30 lines
571 B
Makefile
|
CC := gcc -Wall -Wextra -Wpedantic -Werror -Iinclude -g
|
||
|
|
||
|
# LIBS :=
|
||
|
# LDFLAGS := $(LDFLAGS) $(shell pkg-config --libs $(LIBS))
|
||
|
# CFLAGS := $(CFLAGS) $(shell pkg-config --cflags $(LIBS))
|
||
|
|
||
|
LDFLAGS := -lglpk
|
||
|
|
||
|
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
|