homepage/Makefile

62 lines
1.3 KiB
Makefile
Raw Normal View History

2010-05-28 18:03:09 -06:00
DESTDIR = $(HOME)/public_html
TEMPLATE = template.xml
MDWNTOHTML = ./mdwntohtml $(TEMPLATE)
# HTML to be generated
HTML = index.html
# Things to copy
COPY += mdwntohtml template.xml
2010-06-08 23:04:13 -06:00
COPY += face.png chumby-photo.cgi
2010-05-28 18:03:09 -06:00
COPY += format.css default.css print.css
COPY += gitweb.cgi git-logo.png gitweb.css gitweb.conf
2011-12-23 15:42:43 -07:00
COPY += portal.png portal.cgi
2010-05-28 18:03:09 -06:00
# Directories in which %.mdwn generates %.html
PLAIN = . papers poems misc
# Other targets for "make all"
2010-06-08 23:04:13 -06:00
TARGETS = html copy
TARGETS += $(DESTDIR)/tmp $(DESTDIR)/footer.xml $(DESTDIR)/projects
TARGETS += $(DESTDIR)/geneweb.cgi
2010-05-28 18:03:09 -06:00
all: default
include */*.mk
$(DESTDIR)/%.html: %.mdwn $(TEMPLATE)
@mkdir -p $(dir $@)
$(MDWNTOHTML) < $< > $@
$(DESTDIR)/%: %
@mkdir -p $(dir $@)
cp $< $@
$(DESTDIR)/tmp:
mkdir -p $@
$(DESTDIR)/footer.xml: $(TEMPLATE)
awk '(/FOOT/) { a += 1; next; } (a == 1) { print; }' $< > $@
$(DESTDIR)/projects:
ln -s $(HOME)/projects $@
2010-06-08 23:04:13 -06:00
$(DESTDIR)/geneweb.cgi: geneweb.c
$(CC) -o $@ $<
chmod +s $@
2010-12-03 16:25:12 -07:00
$(DESTDIR)/%-sm.jpg: %.jpg
jpegtopnm $< | pnmscale -xysize 200 200 | pnmtojpeg > $@
2010-05-28 18:03:09 -06:00
default: $(TARGETS)
MDWN = $(wildcard $(addsuffix /*.mdwn, $(PLAIN)))
HTML += $(patsubst %.mdwn, %.html, $(MDWN))
html: $(addprefix $(DESTDIR)/, $(HTML))
copy: $(addprefix $(DESTDIR)/, $(COPY))
clean:
rm -rf $(wildcard $(DESTDIR)/*)