aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Info/10/Makefile4
-rw-r--r--common.mk5
2 files changed, 7 insertions, 2 deletions
diff --git a/Info/10/Makefile b/Info/10/Makefile
index af11d41e..9a8c4823 100644
--- a/Info/10/Makefile
+++ b/Info/10/Makefile
@@ -1,8 +1,8 @@
-include ../../common.mk
+COMMON_MK = $(shell bash -c 'upfind() { [[ -f "$$1" ]] && printf "$$1" || ([ "$$(realpath $$(dirname "$$1"))" == "/" ] || upfind "../$$1") }; upfind common.mk')
+include $(COMMON_MK)
java_cheatsheet.pdf: java_cheatsheet.tex
rubber --pdf $< && rubber --clean -q $<
java_cheatsheet.tex: java_cheatsheet.md | Makefile
pandoc $< -o $@ --standalone && sed -i '/[^,]\\\\$$/a \\\\midrule' $@
-
diff --git a/common.mk b/common.mk
index cae111b7..dceb5997 100644
--- a/common.mk
+++ b/common.mk
@@ -1,3 +1,8 @@
+# The full path to the Makefile
+MAKEFILE_PATH ?= $(abspath $(lastword $(MAKEFILE_LIST)))
+# The path to the directory of the Makefile
+MAKEFILE_DIR ?= $(dir $(MAKEFILE_PATH))
+
IMGS := $(wildcard img/*)
LATEX_BASE := $(MAKEFILE_DIR)latex