diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-04-02 01:15:39 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-04-02 01:15:39 +0200 |
commit | 90a1bd9dc21fea8a1ba8532d2cba957b7f14bec5 (patch) | |
tree | 23832b309922ece496faf484975ff5b446bcb965 /templates/c/Makefile | |
parent | feat(common/init): Add a shell script, that populates variables (diff) | |
download | flake-templates-90a1bd9dc21fea8a1ba8532d2cba957b7f14bec5.tar.gz flake-templates-90a1bd9dc21fea8a1ba8532d2cba957b7f14bec5.zip |
fix(templates/c): Make the `makefile` more standards complying
Diffstat (limited to 'templates/c/Makefile')
-rw-r--r-- | templates/c/Makefile | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/templates/c/Makefile b/templates/c/Makefile deleted file mode 100644 index 4a37b4b..0000000 --- a/templates/c/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -PREFIX := /usr/local -BINPREFIX := $(DESTDIR)$(PREFIX)/bin -MANPREFIX := $(DESTDIR)$(PREFIX)/share/man/man1 - -BIN_NAME := TODO -# The trailing slash is important -BUILD_DIR := ./target/ -BIN_PATH := $(BUILD_DIR)$(BIN_NAME) - - -SRC := $(wildcard src/*.c) -OBJ := $(SRC:.c=.o) -DEP := $(OBJ:.o=.d) - -LIBS := - -ALL_CFLAGS := -O3 -MMD -Wall -Wextra -Wno-unused-parameter $(CFLAGS) $(CPPFLAGS) -ALL_LDFLAGS := $(addprefix -l,$(LIBS)) -L $(LD_LIBRARY_PATH) $(LDFLAGS) - - -$(BIN_NAME): $(OBJ) - $(CC) $(addprefix $(BUILD_DIR),$(notdir $(OBJ))) -o $(addprefix $(BUILD_DIR),$(notdir $(BIN_NAME))) $(ALL_CFLAGS) $(ALL_LDFLAGS) - -$(OBJ): $(SRC) - mkdir --parents $(BUILD_DIR) - $(CC) -c $< -o $(addprefix $(BUILD_DIR),$(notdir $(OBJ))) $(ALL_CFLAGS) - -manual: - mkdir --parents $(BUILD_DIR)docs - pandoc "./docs/$(BIN_NAME).1.md" -s -t man > $(BUILD_DIR)docs/$(BIN_NAME).1 - -.PHONY : clean options install memory_leak_test -options: - @echo "PREFIX = $(PREFIX)" - @echo "BINPREFIX = $(BINPREFIX)" - @echo "MANPREFIX = $(MANPREFIX)" - @echo "" - @echo "BIN_NAME = $(BIN_NAME)" - @echo "BUILD_DIR = $(BUILD_DIR)" - @echo "BIN_PATH = $(BIN_PATH)" - @echo "" - @echo "SRC = $(SRC)" - @echo "OBJ = $(OBJ)" - @echo "DEP = $(DEP)" - @echo "" - @echo "LIBS = $(LIBS)" - @echo "" - @echo "ALL_CFLAGS = $(ALL_CFLAGS)" - @echo "ALL_LDFLAGS = $(ALL_LDFLAGS)" - @echo "" - -clean : - rm --recursive $(BUILD_DIR) - -install: $(BIN_NAME) manual - install -D $(BUILD_DIR)docs/$(BIN_NAME).1 $(MANPREFIX)/$(BIN_NAME); - install -D $(BUILD_DIR)$(BIN_NAME) $(BINPREFIX)/$(BIN_NAME); - -memory_leak_test: - sh ./scripts/valgrind_test.sh $(BIN_NAME) |