Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
# This file:
#   http://angg.twu.net/dednat5/Makefile.html
#   http://angg.twu.net/dednat5/Makefile
#                    (find-dn5 "Makefile")
# Author:  Eduardo Ochs <eduardoochs@gmail.com>
# Varsion: 2011may26
# License: GPL3
# To do: steal things from:
#   (find-blogme4 "Makefile")
#   (find-RETRO   "Makefile")

# «.tarball»		(to "tarball")
# «.lua»		(to "lua")
# «.dednat5.lua»	(to "dednat5.lua")
# «.test»		(to "test")


default help:
	@echo "Usage:"
	@echo "  make test   download & build lua, preprocess and typeset tests"


OTHERFILES = README VERSION Makefile dednat-eev.el
LUAMODULES = common.lua eoo.lua errors.lua prefixes.lua parse.lua \
	preamble.lua process.lua options.lua \
	treetex.lua treesegs.lua treehead.lua \
	diagstacks.lua diagtex.lua diagforth.lua \
	diagmiddle.lua begriff.lua repl.lua
LUAOTHER = build.lua dednat5.lua
TESTFILES = tests/Makefile \
	tests/test1.tex tests/test2.tex tests/test3.tex tests/testbegr.tex \
	tests/testpgf.tex tests/testpgf.lua
OUTPUTS = tests/test1.dnt tests/test1.pdf \
	tests/test2.dnt tests/test2.mp tests/test1.pdf \
	tests/test3.dnt tests/test3.pdf \
	tests/testbegr.dnt tests/testbegr.pdf \
	tests/testpgf.dnt
FILES = $(OTHERFILES) $(LUAMODULES) $(LUAOTHER) $(TESTFILES) $(OUTPUTS)


# «tarball»  (to ".tarball")
# (find-dn4 "Makefile" "tarball")
#tgz: dednat5.lua
tgz: dednat5.lua test
	(TZ=GMT date; date) | tee VERSION
	tar -cvzf dednat5.tgz $(FILES)


# «lua»  (to ".lua")
# Download and build lua5.1.
# From: (find-dn4 "Makefile" "lua")
wget      = wget
S         = $(PWD)/snarf
USRC      = $(PWD)/usrc

LUAURL    =    http://www.lua.org/ftp/lua-5.1.4.tar.gz
LUATGZ    = $(S)/http/www.lua.org/ftp/lua-5.1.4.tar.gz
LUATGZDIR = $(S)/http/www.lua.org/ftp/
LUASRC    = $(USRC)/lua-5.1.4
LUA51_    = $(LUASRC)/bin/lua
LUA51     = $(PWD)/lua51
LUAOS     = linux

luadownload: $(LUATGZ)
$(LUATGZ):
	mkdir -p $(LUATGZDIR)
	cd       $(LUATGZDIR) && \
	$(wget)  $(LUAURL)

cleanluabuild:
	rm -Rfv $(LUASRC)/

luabuild: $(LUA51_)
$(LUA51_): $(LUATGZ)
	rm -Rfv $(LUASRC)/
	mkdir -p $(USRC)/
	tar   -C $(USRC)/ -xvzf $(LUATGZ)
	cd $(LUASRC) && make $(LUAOS) local test

lua51 $(LUA51): $(LUA51_)
	cp -v $(LUA51_) $(LUA51)



# «dednat5.lua»  (to ".dednat5.lua")
# See: (find-dn5 "build.lua")
#      (find-dn5 "dednat5.lua")
dednat5.lua: $(LUA51) $(LUAMODULES)
	$(LUA51) build.lua && chmod 755 dednat5.lua


# «test»  (to ".test")
# See: (find-dn5 "tests/")
#      (find-dn5 "tests/Makefile")
# and here are the two tests and the generated pdfs:
#                    (find-dn5 "tests/test1.tex")
#   http://angg.twu.net/dednat5/tests/test1.pdf
#                    (find-dn5 "tests/test2.tex")
#   http://angg.twu.net/dednat5/tests/test1.pdf
#
cleantests:
	cd tests/ && make veryclean
test: $(LUA51) dednat5.lua
	cd tests/ && make all

cleanlua:
	rm -Rfv lua51 snarf/ usrc/
cleandednat5:
	rm -fv VERSION dednat5.lua dednat5.tgz
veryveryclean: cleantests cleanlua cleandednat5




#  Local Variables:
#  coding:               raw-text-unix
#  ee-anchor-format:     "«%s»"
#  End: