From d797758769d033c64babdf77ea6b64262f792b23 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Mon, 3 Oct 2022 18:14:31 +0200 Subject: add zip make target and clean up global makefile --- .gitignore | 1 + makefile | 12 ++++++++++-- week.mk | 6 +++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index d82a6c2..aca116d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ **/*.o **/*.pdf **/main +**/compile_commands.json diff --git a/makefile b/makefile index 71eabae..4e05b91 100644 --- a/makefile +++ b/makefile @@ -1,8 +1,16 @@ MK = make -j WEKEN = $(wildcard week-*) +submake = $(foreach WEEK,$(WEKEN), $(MK) -C $(WEEK) $(1);) + all: - $(foreach WEEK,$(WEKEN), $(MK) -C $(WEEK);) + $(call submake) clean: - $(foreach WEEK,$(WEKEN), $(MK) -C $(WEEK) clean;) + $(call submake, clean) + +compile_commands: + $(call submake, compile_commands) + +zip: + $(call submake, zip) diff --git a/week.mk b/week.mk index e506711..dfb9c20 100644 --- a/week.mk +++ b/week.mk @@ -2,6 +2,7 @@ CC = g++ LD = g++ RM = rm -f TARGET = main +OUTPUT_ZIP = Huiswerk_2180996.zip LFLAGS += -lstdc++ @@ -17,8 +18,11 @@ $(TARGET): $(OBJS) $(LD) $^ $(LFLAGS) -o $@ clean: - $(RM) $(TARGET) $(OBJS) + $(RM) $(TARGET) $(OBJS) $(OUTPUT_ZIP) compile_commands: clean compiledb make +zip: all + zip -q $(OUTPUT_ZIP) makefile $(wildcard *.cpp) $(wildcard *.h) $(wildcard *.hpp) + -- cgit v1.2.3