summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile44
1 files changed, 29 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index 3ed893c..689d9da 100644
--- a/Makefile
+++ b/Makefile
@@ -3,17 +3,21 @@
NAME = luaotfload
LUAOTFLOAD = $(wildcard luaotfload-*.lua) luaotfload-blacklist.cnf
-GLYPHSCRIPT = mkglyphlist
-GLYPHSOURCE = glyphlist.txt
-CHARSCRIPT = mkcharacters
-STATUSSCRIPT = mkstatus
+DOCSRCDIR = ./doc
+SCRIPTSRCDIR = ./scripts
+BUILDDIR = ./build
+
+GLYPHSCRIPT = $(SCRIPTSRCDIR)/mkglyphlist
+CHARSCRIPT = $(SCRIPTSRCDIR)/mkcharacters
+STATUSSCRIPT = $(SCRIPTSRCDIR)/mkstatus
+
+GLYPHSOURCE = $(BUILDDIR)/glyphlist.txt
RESOURCESCRIPTS = $(GLYPHSCRIPT) $(CHARSCRIPT) $(STATUSSCRIPT)
SCRIPTNAME = luaotfload-tool
SCRIPT = $(SCRIPTNAME).lua
-DOCSRCDIR = ./doc
GRAPH = filegraph
DOCSRC = $(DOCSRCDIR)/$(NAME).dtx
GRAPHSRC = $(DOCSRCDIR)/$(GRAPH).dot
@@ -26,15 +30,15 @@ MANPAGE = $(DOCSRCDIR)/$(SCRIPTNAME).1
DOCS = $(DOCPDF) $(DOTPDF) $(MANPAGE)
# Files grouped by generation mode
-GLYPHS = luaotfload-glyphlist.lua
-CHARS = luaotfload-characters.lua
-STATUS = luaotfload-status.lua
+GLYPHS = $(BUILDDIR)/$(NAME)-glyphlist.lua
+CHARS = $(BUILDDIR)/$(NAME)-characters.lua
+STATUS = $(BUILDDIR)/$(NAME)-status.lua
RESOURCES = $(GLYPHS) $(CHARS) $(STATUS)
SOURCE = $(DOCSRC) $(MANSRC) $(LUAOTFLOAD) README Makefile NEWS $(RESOURCESCRIPTS)
# Files grouped by installation location
SCRIPTSTATUS = $(SCRIPT) $(OLDSCRIPT) $(RESOURCESCRIPTS)
-RUNSTATUS = $(UNPACKED) $(filter-out $(SCRIPTSTATUS),$(LUAOTFLOAD))
+RUNSTATUS = $(filter-out $(SCRIPTSTATUS),$(LUAOTFLOAD))
DOCSTATUS = $(DOCPDF) $(DOTPDF) README NEWS
MANSTATUS = $(MANPAGE)
SRCSTATUS = $(DOCSRC) $(MANSRC) $(GRAPHSRC) Makefile
@@ -61,15 +65,18 @@ ZIPS = $(CTAN_ZIP) $(TDS_ZIP)
LUA = texlua
+## For now the $(BUILDDIR) is hardcoded in the scripts
+## but we might just as well pass it to them by as environment
+## variables.
DO_GLYPHS = $(LUA) $(GLYPHSCRIPT) > /dev/null
DO_CHARS = $(LUA) $(CHARSCRIPT) > /dev/null
DO_STATUS = $(LUA) $(STATUSSCRIPT) > /dev/null
all: $(GENERATED)
-unpack: $(UNPACKED)
-resources: $(RESOURCES)
-chars: $(CHARS)
-status: $(STATUS)
+builddir: $(BUILDDIR)
+resources: builddir $(RESOURCES)
+chars: builddir $(CHARS)
+status: builddir $(STATUS)
ctan: $(CTAN_ZIP)
tds: $(TDS_ZIP)
world: all ctan
@@ -97,6 +104,9 @@ $(CHARS): /dev/null
$(STATUS): /dev/null
$(DO_STATUS)
+$(BUILDDIR): /dev/null
+ mkdir -p $(BUILDDIR)
+
define make-ctandir
@$(RM) -rf $(DISTDIR)
@mkdir -p $(DISTDIR) && cp $(SOURCE) $(COMPILED) $(DISTDIR)
@@ -142,13 +152,17 @@ manifest:
@echo "Derived files:"
@for f in $(GENERATED); do echo $$f; done
+CLEANEXTS = log aux toc idx ind ilg out
+CLEANME = $(foreach ext,$(CLEANEXTS),$(wildcard *.$(ext)))
+CLEANME += $(foreach ext,$(CLEANEXTS),$(wildcard $(BUILDDIR)/*$(ext)))
+
clean:
$(MAKE) -C $(DOCSRCDIR) $@
- @$(RM) -- *.log *.aux *.toc *.idx *.ind *.ilg *.out
+ @$(RM) -- $(CLEANME)
mrproper: clean
$(MAKE) -C $(DOCSRCDIR) $@
@$(RM) -- $(GENERATED) $(ZIPS) $(GLYPHSOURCE)
- @$(RM) -r -- $(DISTDIR)
+ @$(RM) -r -- $(DISTDIR) $(BUILDDIR)
# vim:set noexpandtab:tabstop=8:shiftwidth=2