diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2014-02-11 07:29:32 +0100 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2014-02-11 07:29:32 +0100 |
commit | 67932f829fbf7aaa269725e646d1c35f74d97be5 (patch) | |
tree | 9da011ee5d3cc834e59bb64f841bd024a4d786fa /Makefile | |
parent | e9d34a8805f14361272864ea0470def2914315b4 (diff) | |
download | luaotfload-67932f829fbf7aaa269725e646d1c35f74d97be5.tar.gz |
[*] adapt Makefile to ./scripts and ./build
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 44 |
1 files changed, 29 insertions, 15 deletions
@@ -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 |