diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a645c9f..49b43c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,12 +36,10 @@ jobs: # 3. Build the documents - name: "Build the documents" - run: | - make -j + run: make -j compile # 4. Upload artifacts to GitHub - name: Upload artifacts to GitHub - if: ${{ !env.ACT }} uses: actions/upload-artifact@v3 with: name: Vorkurs-Materialien diff --git a/Makefile b/Makefile index 662b893..eb18de3 100644 --- a/Makefile +++ b/Makefile @@ -1,39 +1,45 @@ OUT_DIR := pdfout/ # find all makefiles in subdirectories -FILES := $(shell find . -mindepth 2 -name 'Makefile' -not -path './.git/*' -not -path './.devcontainer') +MAKEFILES := $(shell find . -mindepth 2 -name 'Makefile' -not -path './.git/*' -not -path './.devcontainer') -$(FILES:Makefile=Makefile.all): - $(eval FILE := $(patsubst %.all,%,$@)) - @$(MAKE) -C $(dir $(FILE)) -f $(notdir $(FILE)) all +$(MAKEFILES:Makefile=Makefile.all): + $(eval MAKEFILE := $(patsubst %.all,%,$@)) + @$(MAKE) -C $(dir $(MAKEFILE)) -f $(notdir $(MAKEFILE)) all + @mkdir -p $(OUT_DIR) + @cp $(dir $(MAKEFILE))/$(OUT_DIR)/*.pdf $(OUT_DIR) -$(FILES:Makefile=Makefile.compile): - $(eval FILE := $(patsubst %.compile,%,$@)) - @$(MAKE) -C $(dir $(FILE)) -f $(notdir $(FILE)) compile +$(MAKEFILES:Makefile=Makefile.compile): + $(eval MAKEFILE := $(patsubst %.compile,%,$@)) + $(MAKE) -C $(dir $(MAKEFILE)) -f $(notdir $(MAKEFILE)) compile + @mkdir -p $(OUT_DIR) + @cp $(dir $(MAKEFILE))/$(OUT_DIR)/*.pdf $(OUT_DIR) -$(FILES:Makefile=Makefile.clean): - $(eval FILE := $(patsubst %.clean,%,$@)) - @$(MAKE) -C $(dir $(FILE)) -f $(notdir $(FILE)) clean +$(MAKEFILES:Makefile=Makefile.clean): + $(eval MAKEFILE := $(patsubst %.clean,%,$@)) + $(MAKE) -C $(dir $(MAKEFILE)) -f $(notdir $(MAKEFILE)) clean -$(FILES:Makefile=Makefile.cleanBuild): - $(eval FILE := $(patsubst %.cleanBuild,%,$@)) - @$(MAKE) -C $(dir $(FILE)) -f $(notdir $(FILE)) cleanBuild +# $(MAKEFILES:Makefile=Makefile.cleanBuild): +# $(eval MAKEFILE := $(patsubst %.cleanBuild,%,$@)) +# @$(MAKE) -C $(dir $(MAKEFILE)) -f $(notdir $(MAKEFILE)) cleanBuild -$(FILES:Makefile=Makefile.cleanAll): - $(eval FILE := $(patsubst %.cleanAll,%,$@)) - @$(MAKE) -C $(dir $(FILE)) -f $(notdir $(FILE)) cleanAll +$(MAKEFILES:Makefile=Makefile.cleanAll): + $(eval MAKEFILE := $(patsubst %.cleanAll,%,$@)) + @$(MAKE) -C $(dir $(MAKEFILE)) -f $(notdir $(MAKEFILE)) cleanAll -all: $(FILES:Makefile=Makefile.all) +all: $(MAKEFILES:Makefile=Makefile.all) @echo -e "\e[1;42mAll Done. PDFs can be found in $(OUT_DIR)\e[0m" -compile: $(FILES:Makefile=Makefile.compile) +compile: $(MAKEFILES:Makefile=Makefile.compile) @echo -e "\e[1;42mAll Done. PDFs can be found in $(OUT_DIR)\e[0m" -clean: $(FILES:Makefile=Makefile.clean) +clean: $(MAKEFILES:Makefile=Makefile.clean) @echo -e "\e[1;44mCleaned up all subdirectories.\e[0m" -cleanBuild: $(FILES:Makefile=Makefile.cleanBuild) - @echo -e "\e[1;44mCleaned up build dir in all subdirectories.\e[0m" +cleanBuild: + @echo -e "\e[1;34mCleaning up build directory...$<\e[0m" + @rm -rf $(OUT_DIR) + @echo -e "\e[1;44mDone cleaning up build directory.$<\e[0m" -cleanAll: $(FILES:Makefile=Makefile.cleanAll) +cleanAll: $(MAKEFILES:Makefile=Makefile.cleanAll) cleanBuild @echo -e "\e[1;44mCleaned up all subdirectories + build dirs.\e[0m" diff --git a/exercises/preamble.tex b/exercises/preamble.tex index 996d8de..cc3a8ff 100644 --- a/exercises/preamble.tex +++ b/exercises/preamble.tex @@ -34,7 +34,9 @@ } \newboolean{sln}\setboolean{sln}{false} \newboolean{SoSe}\setboolean{SoSe}{false} -\newcounter{nextyear}\setcounter{nextyear}{\year+1} +\AtBeginDocument{ + \newcounter{nextyear}\setcounter{nextyear}{\year+1} +} % \newcommand{\ext}{py}