From 858ae4d03def568a03f53826c31842f24d9c49c0 Mon Sep 17 00:00:00 2001 From: Fabrice Date: Fri, 20 Mar 2026 18:08:24 +0100 Subject: init --- makefile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 makefile (limited to 'makefile') diff --git a/makefile b/makefile new file mode 100644 index 0000000..8e7686a --- /dev/null +++ b/makefile @@ -0,0 +1,28 @@ +# Header in which assert(x) is defined +CM_OPT_ASSERT_PATH ?= + +CC ?= gcc + +CM_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))) + +CM_SOURCE := $(CM_DIR)/cheesemap.c +CM_OBJECT := $(CM_SOURCE:.c=.o) +CM_DEPEND := $(CM_SOURCE:.c=.d) + +CM_CC_FLAGS := \ + -Wall -Wextra -pedantic \ + -MMD -MP -I$(CM_DIR) + +CM_CC_FLAGS += -DCM_OPT_ASSERT_PATH='$(CM_OPT_ASSERT_PATH)' + +.PHONY: all +all: $(CM_OBJECT) + +$(CM_OBJECT): $(CM_SOURCE) + $(CC) $(CM_CC_FLAGS) -c $< -o $@ + +.PHONY: clean +clean:: + $(RM) $(CM_OBJECT) $(CM_DEPEND) + +-include $(CM_DEPEND) \ No newline at end of file -- cgit v1.2.3