Warning: this is an htmlized version!
The original is here, 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")

# «.dirs»		(to "dirs")
# «.Makefile.auto»	(to "Makefile.auto")
# «.NOTCL»		(to "NOTCL")
# «.MAKEFILEAUTO»	(to "MAKEFILEAUTO")
# «.echo-tgzfiles»	(to "echo-tgzfiles")


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)



# «dirs»  (to ".dirs")
# (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 .doom.d .eev .fvwm .lua50 .lua51 .maxima .ruby
	mkdir -p .xmonad 2011-dec-13 2009.1/MD 2012-greve 2013-rfm-rcn
	mkdir -p 2012.1-GA 2012.2-GA 2013.1-GA 2013.1-ES 2013.2-GA
	mkdir -p 2014.1-FM 2014.1-GA 2014.2-FM 2014.2-GA 2015.1-C2
	mkdir -p 2015.1-GA 2015.2-C2 2015.2-GA 2016.1-C2 2016.1-GA
	mkdir -p 2016.1-LA 2016.2-C2 2016.2-GA 2016.2-LA 2017.1-C2
	mkdir -p 2017.1-GA 2017.1-LA 2017.2-C2 2017.2-GA 2017.2-LA
	mkdir -p 2018.1-C2 2018.1-GA 2018.1-LA 2018.2-C2 2018.2-MD
	mkdir -p 2019-CLG 2019.1-C2 2019.1-C3 2019.1-TD 2019.2-C2
	mkdir -p 2019.2-C3 2020.1-C2 2020.1-C3 2020.2-C2 2020.2-C3
	mkdir -p 2020-2-C2-C3 2021.1-C2 2021.1-C3 2021.2-C2
	mkdir -p 2021-1-C2-C3 2022-1-C2-C3 2022.2-C2 2022.2-C3
	mkdir -p 2022-2-C2-C3 2021.1-projeto 2021-oficina
	mkdir -p 2021-org-for-non-users 2021-ffll 2022.1-C2 2022.1-C3
	mkdir -p 4NT AGDA BIBER BISON BUSYBOX C C2 C4 COQ CRIM1 CV
	mkdir -p DANIEL DAVINCI EDRXPAGE EEG EEV/debian ETC EXPECT
	mkdir -p FENNEL FISL FundComp GA-abaixo-assinados GDB
	mkdir -p GELADEIRA GNUPLOT HASKELL HASKELL/RW HELP HIGHLIGHT
	mkdir -p HOWM HOWM4 HTML ICON IDRIS IDRIS/brady/02 IMAGES
	mkdir -p INKSCAPE JS LATEX LATEX/dednat6
	mkdir -p LATEX/dednat6/lua-repl/repl LFORTH LILYPOND LINUX
	mkdir -p LOGS LOVE2D LUA/loadlib LUA/ldb LUATEX MAKE MANIM
	mkdir -p MARCOS MARKDOWN MAXIMA MD MINICATS MONTREAL MTA OCAML
	mkdir -p OMNISYS ORG PFORTH PHP PIC PLURALL PS PURO PYTHON
	mkdir -p RETRO REXX RUBY SCANS/univ_form_cid SCHEME SDL SML
	mkdir -p SQL SRF SUBTITLES SWIG TCL TEXINFO TH TH/audios
	mkdir -p TH/eev TH/ferramentas TH/songs/ TIKZ VIDEOS WebWiki
	mkdir -p Wiki acker audios bin blogme blogme3 blogme4/doc
	mkdir -p 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/__music
	mkdir -p books/__peirce books/__phil books/__physics
	mkdir -p books/__piaget books/__pichacoes books/__politics
	mkdir -p books/__shibari books/__small books/__anime
	mkdir -p books/__tantra coiote concurso crim debian dednat
	mkdir -p dednat4/debian dednat4/downloads dednat4/examples
	mkdir -p dednat5/tests dednat6/dednat6
	mkdir -p dednat6/dednat6/lua-repl/repl dednat6-old/ex
	mkdir -p dednat6-old/tests diaglib dnc doria duoforths dynkin
	mkdir -p e edrxrepl elisp eev-deb-old/debian eev-intros
	mkdir -p eev-old/debian eev-old/demo eev-old/e eev-old/libeeg
	mkdir -p eev-old/rcfiles eev-old/texts eev-current/anim
	mkdir -p eev-current/article eev-current/debian
	mkdir -p eev-current/doc eev-current/elpa eev-current/examples
	mkdir -p eev-current/rcfiles eev-current/rcfiles/tmp
	mkdir -p eev-current/slides/ eev-current/tmp eev-intro
	mkdir -p eev-puro/debian eev-puro/menu eev-lua-extras/debian
	mkdir -p eev-videos eev-wconfig emacs-lua emlua faceutils
	mkdir -p fbcache ferramentas flua gab gabp genericfigures
	mkdir -p glyphs grub live-build lua-4.0/debian lua-4.0/doc
	mkdir -p lua-4.0/include lua-4.0/src/lua lua-4.0/src/libdllua
	mkdir -p luatex luatree manifs markdown-dednat6 miniforth
	mkdir -p miniforth/crim mktclapp-3.9/debian
	mkdir -p mktclapp-3.9/examples packages-el peek pict2e-lua
	mkdir -p quadradinho rcirc replace rubyforth/demos
	mkdir -p rubyforth/tools sheavesforchildren sisrot social
	mkdir -p songs usrc/rcirc vtutil vtutil4 windows-emacs
	mkdir -p 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) $(EI_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


# «MAKEFILEAUTO»  (to ".MAKEFILEAUTO")
# 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: $(MAKEFILEAUTO)
$(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


# «echo-tgzfiles»  (to ".echo-tgzfiles")
# (find-node "(make)Echoing" "@echo")
#
echo-tgzfiles:
	@echo $(TGZFILES) | tr ' ' '\n'



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