Files
cpusetcores/makefile
Quinn 2731f908b3 update makefile
makefile is now more compiler-agnostic and consistent with how one
expects a makefile to be built.
2025-08-11 15:44:40 +02:00

33 lines
516 B
Makefile

SHELL = bash -e -o pipefail -O globstar
NAME = cpusetcores
VERSION = 0.0.2
DEBUG ?= 0
CC ?= cc
CFLAGS = -c -std=gnu99 -Wall -Wextra -Wpedantic -MMD -MP
LFLAGS = -flto
SRC := $(wildcard src/*.c) $(wildcard src/**/*.c)
OBJ := $(SRC:%.c=obj/%.o)
BIN := bin/$(NAME)
.PHONY:
compile: $(BIN)
$(BIN): $(OBJ)
$(info [CC/LD] $@)
@mkdir -p $(@D)
@$(CC) -o $@ $^ $(LDFLAGS)
obj/%.o: %.c
$(info [CC] $@)
@mkdir -p $(@D)
@$(CC) $(CFLAGS) -o $@ $<
clean:
rm -rv obj/ bin/
# include the dependencies
-include $(DEP)