From 3c06d3fd4562389537f9acc448aa7d62644cd433 Mon Sep 17 00:00:00 2001 From: Tomasz Polgrabia Date: Sun, 9 Feb 2025 20:46:22 +0100 Subject: [PATCH] Initial makefile. --- .../.gitignore | 1 + .../Makefile | 19 +++++++++++++++++++ .../src/main.c | 5 +++++ 3 files changed, 25 insertions(+) create mode 100644 2025/02/cracking_code_interview_17_26_sparse_similarity/.gitignore create mode 100644 2025/02/cracking_code_interview_17_26_sparse_similarity/Makefile create mode 100644 2025/02/cracking_code_interview_17_26_sparse_similarity/src/main.c diff --git a/2025/02/cracking_code_interview_17_26_sparse_similarity/.gitignore b/2025/02/cracking_code_interview_17_26_sparse_similarity/.gitignore new file mode 100644 index 0000000..ba077a4 --- /dev/null +++ b/2025/02/cracking_code_interview_17_26_sparse_similarity/.gitignore @@ -0,0 +1 @@ +bin diff --git a/2025/02/cracking_code_interview_17_26_sparse_similarity/Makefile b/2025/02/cracking_code_interview_17_26_sparse_similarity/Makefile new file mode 100644 index 0000000..ae1f104 --- /dev/null +++ b/2025/02/cracking_code_interview_17_26_sparse_similarity/Makefile @@ -0,0 +1,19 @@ +BIN_DIR=bin +SRC_DIR=src +DEST=bin/program +SRC=$(wildcard $(SRC_DIR)/*.c) +BIN=$(patsubst $(SRC_DIR)/%.c,$(BIN_DIR)/%.c.o,$(SRC)) + +all: $(DEST) + +.PHONY: clean + +$(DEST): $(BIN) + ${CC} $(LDFLAGS) -o $@ $^ + +$(BIN_DIR)/%.c.o: $(SRC_DIR)/%.c + @mkdir -p $(BIN_DIR) + $(CC) $(CFLAGS) -c -o $@ $< + +clean: + rm -rf $(BIN_DIR) diff --git a/2025/02/cracking_code_interview_17_26_sparse_similarity/src/main.c b/2025/02/cracking_code_interview_17_26_sparse_similarity/src/main.c new file mode 100644 index 0000000..dc79d60 --- /dev/null +++ b/2025/02/cracking_code_interview_17_26_sparse_similarity/src/main.c @@ -0,0 +1,5 @@ +#include + +int main() { + return 0; +}