mirror of
https://github.com/thepigeongenerator/cpusetcores.git
synced 2025-12-16 13:35:46 +01:00
makefile is now more compiler-agnostic and consistent with how one expects a makefile to be built.
33 lines
516 B
Makefile
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)
|