From 92a9fb163fce1997e2a8057edf5505e68df81872 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Sat, 10 Feb 2024 14:09:43 +0100 Subject: [PATCH] clean up makefile --- Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index c19b6e8..4e146b3 100644 --- a/Makefile +++ b/Makefile @@ -24,18 +24,18 @@ modules: dirs $(MOD:.c=.so) dirs: mkdir -p ./$(BIN) -run: all - $(BIN)/$(PROGRAM) - -$(PROGRAM): $(OBJ) +$(PROGRAM): $(addprefix $(BIN)/, $(OBJ)) $(CC) -o $(BIN)/$(PROGRAM) $^ $(LDFLAGS) -$(BIN)/%.o: %.c - $(CC) -o $@ -c $< $(CFLAGS) +%.o: %.c + $(CC) -o $(BIN)/$@ -c $< $(CFLAGS) %.so: modules/%.c $(CC) -o $(BIN)/$@ $^ -shared -fPIC $(CFLAGS) -clean: +clean: clean_modules rm -rf $(OBJ) rm -rf $(PROGRAM) + +clean_modules: + rm -rf $(wildcard $(BIN)/*.so)