Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
# Makefile for http://angg.twu.net/, 2013feb10.

# (find-es "tourism")

# See: http://angg.twu.net/e/tourism.html

# This file is full of GNUmake-isms and if you're running BSD you need
# to use gmake on it instead of the default (p?)make; also you may
# have to pass a parameter like "TCLSH=tclsh8.2" (or other version)
# because the default tclsh there may be a boring script that tells
# you to invoke tclsh with an explicit version number.

# (find-es "make" "shell_functions")
# (find-es "escripts" "copy_of_edrxs_page")
# (find-fline "/freebsd/usr/local/bin/tclsh")

# (find-fline "Generate")
# (find-fline "Htmllib.tcl")
# (find-fline "Files.tcl")

# (find-es "make" "page")
# (find-node "(make)Conditional Example")
# (find-node "(make)Conditional Syntax")

# (find-es "make" "environment")
# (find-es "page" "test_unpacking")
# (find-es "page" "upload_changes")
# (find-angg ".zshrc" "minimakepage")
# (find-node "(make)Conditional Example")
# (find-node "(make)Conditional Syntax" "`ifdef VARIABLE-NAME'")
# (find-node "(bash)Bourne Shell Builtins" "`test'")
# (find-node "(bash)Conditional Constructs" "`if'")
# (find-node "(make)Call Function")
# (find-es "make" "call_function")
# (find-node "(make)Conditional Syntax" "To test for an empty value")
# (find-es "escripts" "home_from_pagetgz")

# «.Makefile.auto»	(to "Makefile.auto")
# «.NOTCL»		(to "NOTCL")


TCLSH		?= tclsh
CP		?= cp -av
#CP		?= function CP () { cp -av $$1 $$2 && touch $$2; }; CP

ifeq ($(COPYING),1)
 # As "THDIR ?= $(HOME)/TH" doesn't work in GNU make 3.77,
 ifeq ($(THDIR),)
  THDIR		= $(HOME)/TH
 endif
else
 THDIR		?= TH
endif

GENERATE	= $(TCLSH) $(THDIR)/Generate
FILESTCL	= $(THDIR)/Files.tcl
MAKEFILE	= $(THDIR)/Makefile
MAKEFILEAUTO	= TH/Makefile.auto
TGZ		?= edrx.tgz
HOMETGZ		?= $(HOME)/edrx.tgz      # beware: needs to be an absolute path
ES		?= e

# BLOGME	= lua50 $(THDIR)/blogme.lua
# BLOGME	= lua50 blogme/blogme.lua
BLOGME		= lua50 blogme/blogme2.lua
BLOGME3		= lua51 blogme3/blogme3.lua



default: page

page: dirs copies htmls
fullpage: page $(TGZ)



# (find-angg "TH/Files.tcl")
# (progn (text-mode) (setq fill-prefix "\tmkdir -p "))
# (eek "4*<down> C-a RET M-q <up> DEL 3*<up>")
# (progn (normal-mode) (setq fill-prefix nil))

dirs:
	mkdir -p .a2ps .eev .fvwm .lua50 .lua51 .ruby .xmonad
	mkdir -p 2011-dec-13 2009.1/MD 2012-greve 2012.1-GA 2012.2-GA
	mkdir -p 2013.1-GA 2013.1-ES 2013.2-GA 2014.1-FM 2014.1-GA
	mkdir -p 2014.2-FM 2014.2-GA 2015.1-C2 2015.1-GA 2015.2-C2
	mkdir -p 2015.2-GA 2016.1-C2 2016.1-GA 2016.1-LA 2016.2-C2
	mkdir -p 2016.2-GA 2016.2-LA 2017.1-C2 2017.1-GA 2017.1-LA
	mkdir -p 2017.2-C2 2017.2-GA 2017.2-LA 2013-rfm-rcn 4NT BISON
	mkdir -p BUSYBOX C C2 C4 COQ CRIM1 CV DANIEL DAVINCI EDRXPAGE
	mkdir -p EEG EEV/debian ETC EXPECT FISL FundComp
	mkdir -p GA-abaixo-assinados HASKELL HIGHLIGHT HOWM HOWM4 HTML
	mkdir -p ICON IMAGES LATEX LATEX/dednat6
	mkdir -p LATEX/dednat6/lua-repl/repl LFORTH LILYPOND LINUX
	mkdir -p LOGS LOVE2D LUA/loadlib LUA/ldb LUATEX MARCOS MD
	mkdir -p MINICATS MONTREAL MTA OCAML OMNISYS ORG PFORTH PHP
	mkdir -p PIC PLURALL PS PURO PYTHON RETRO REXX
	mkdir -p SCANS/univ_form_cid SCHEME SDL SQL SWIG TCL TEXINFO
	mkdir -p TH TH/audios TH/eev TH/ferramentas TH/songs/ TIKZ
	mkdir -p VIDEOS WebWiki Wiki audios bin blogme blogme3
	mkdir -p blogme4/doc books/__alg books/__analysis books/__cats
	mkdir -p books/__chomsky books/__comp books/__etc
	mkdir -p books/__discrete books/__frege books/__gaiman
	mkdir -p books/__gardner books/__gender books/__habermas
	mkdir -p books/__logic books/__modal books/__phil
	mkdir -p books/__piaget books/__pichacoes books/__physics
	mkdir -p books/__politics books/__small coiote concurso crim
	mkdir -p debian dednat dednat4/debian dednat4/downloads
	mkdir -p dednat4/examples dednat5/tests dednat6/ex
	mkdir -p dednat6/tests diaglib dnc doria duoforths dynkin e
	mkdir -p elisp eev/debian eev-intros eev-old/debian
	mkdir -p eev-old/demo eev-old/e eev-old/libeeg eev-old/rcfiles
	mkdir -p eev-old/texts eev-current/anim eev-current/article
	mkdir -p eev-current/debian eev-current/doc
	mkdir -p eev-current/examples eev-current/rcfiles
	mkdir -p eev-current/rcfiles/tmp eev-current/slides/
	mkdir -p eev-current/tmp eev-intro eev-puro/debian
	mkdir -p eev-puro/menu eev-lua-extras/debian eev-videos
	mkdir -p faceutils fbcache ferramentas flua gab genericfigures
	mkdir -p glyphs lua-4.0/debian lua-4.0/doc lua-4.0/include
	mkdir -p lua-4.0/src/lua lua-4.0/src/libdllua luatex manifs
	mkdir -p miniforth miniforth/crim mktclapp-3.9/debian
	mkdir -p mktclapp-3.9/examples packages-el peek quadradinho
	mkdir -p replace rubyforth/demos rubyforth/tools
	mkdir -p sheavesforchildren sisrot social songs usrc/rcirc
	mkdir -p vtutil vtutil4 windows-emacs youtube-db



# «Makefile.auto»  (to ".Makefile.auto")
# (find-angg "TH/Files.tcl" "makefile_template")
# (find-angg "TH/Files.tcl" "makeautomakefile")
# The difficult part: we may have to regenerate Makefile.auto (from
# the files in ~/TH/ if COPYING=1) before attempting to make any of
# the targets "copies", "htmls" or "$(TGZ)". The trick is that we
# first remake Makefile.auto and then call "make" a second time; only
# in that second time it will include the Makefile.auto, that will
# then be up-to-date.

MAKE2 = $(MAKE) -f $(THDIR)/Makefile NEEDMAKEFILEAUTO=1

ifeq ($(NEEDMAKEFILEAUTO),1)
include $(MAKEFILEAUTO)
LOADEDMAKEFILEAUTO = 1
endif

# «NOTCL»  (to ".NOTCL")
# (find-es "page" "NOTCL")
# 2008jun17 (for angg):
# NOTCL = 1
# 2008jan18:
ifeq ($(NOTCL),1)
TH_HTMLS :=
endif

ifeq ($(LOADEDMAKEFILEAUTO),1)
  copies: $(COPIES)
  htmls: $(COPIES) $(TH_HTMLS) $(A_HTMLS) $(E_HTMLS)
  $(TGZ): $(TGZFILES)
	# Running tar -czf $(TGZ) $$(TGZFILES) ...
	@tar -czf $(TGZ) $(TGZFILES)
	pwd; ls -lAF $(TGZ)
  $(HOMETGZ): $(TGZFILES)
	# Running cd; tar -czf $(TGZ0) $$(TGZFILES) ...
	@cd; tar -czf $(HOMETGZ) $(TGZFILES)
	pwd; ls -lAF $(HOMETGZ)
else
  FORCE:
  copies: $(MAKEFILEAUTO) FORCE
	$(MAKE2) copies
  htmls: $(MAKEFILEAUTO) FORCE
	$(MAKE2) htmls
  $(TGZ): $(MAKEFILEAUTO) FORCE
	$(MAKE2) $(TGZ)
  $(HOMETGZ): $(MAKEFILEAUTO) FORCE
	$(MAKE2) $(HOMETGZ)
endif

# 2007may06: commented out the old TH-based make-thing,
# and replaced it by something that is blogme3-based
# (but the "~/blogme3/blogme3.lua" is kind of dirty...)
#
#$(MAKEFILEAUTO): $(FILESTCL)
#	$(GENERATE) $(MAKEFILEAUTO) $(FILESTCL) "makeautomakefile "
#
#$(MAKEFILEAUTO): $(FILESTCL) $(HOME)/blogme3/anggmake.lua
$(MAKEFILEAUTO): $(HOME)/blogme3/anggmake.lua
	lua51 ~/blogme3/blogme3.lua -e 'require"anggmake"' > $@ 



ifeq ($(DEST),)
homedir:
	# You need to set DEST to be able to do a "make homedir".
	# Example:
	#	make DEST=/home/edrx homedir
	false
else
homedir: $(TGZ)
	mkdir -p $(DEST)
	tar -xvzf $(TGZ) -C $(DEST)
	# Now you should be able to log in your copy of edrx's home with:
	#
	#   HOME=$(DEST) zsh
	#
	# It is a good idea to set an alias for that in your ~/.bashrc
	# or ~/.zshrc; the syntax is:
	#
	#   alias edrxlog='HOME=$(DEST) zsh'
endif



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