homepage/Makefile

70 lines
1.5 KiB
Makefile
Raw Normal View History

2010-05-28 18:03:09 -06:00
DESTDIR = $(HOME)/public_html
2012-03-13 22:03:48 -06:00
TEMPLATE = template.m4
2010-05-28 18:03:09 -06:00
MDWNTOHTML = ./mdwntohtml $(TEMPLATE)
# HTML to be generated
HTML = index.html
# Things to copy
2012-03-14 16:51:20 -06:00
COPY += mdwntohtml $(TEMPLATE)
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
2012-03-14 16:51:20 -06:00
#COPY += gitweb.cgi git-logo.png gitweb.css gitweb.conf
2011-12-23 15:42:43 -07:00
COPY += portal.png portal.cgi
2014-03-11 12:25:13 -06:00
COPY += g.cgi cgitrc cgit-header.html cgit.css about-filter.sh
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
2012-03-14 16:33:35 -06:00
TARGETS += $(DESTDIR)/tmp $(DESTDIR)/footer.html $(DESTDIR)/projects
2010-06-08 23:04:13 -06:00
TARGETS += $(DESTDIR)/geneweb.cgi
2013-12-30 17:35:21 -07:00
TARGETS += $(DESTDIR)/mp.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 $@
2012-03-14 16:33:35 -06:00
$(DESTDIR)/footer.html: $(TEMPLATE)
2010-05-28 18:03:09 -06:00
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 $@
2015-02-25 22:49:21 -07:00
$(DESTDIR)/g.cgi: g.cgi.go
go build -o $@ $<
2012-03-14 16:33:35 -06:00
$(DESTDIR)/mp.cgi: minepig.cgi.go
2013-12-30 17:35:21 -07:00
go build -o $@ $<
2010-12-03 16:25:12 -07:00
$(DESTDIR)/%-sm.jpg: %.jpg
2012-09-11 23:23:44 -06:00
jpegtopnm $< | pnmscale -xysize 600 600 | pnmtojpeg > $@
2010-12-03 16:25:12 -07:00
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)/*)