summaryrefslogtreecommitdiff
path: root/rules.common
blob: 4f3ec9e4692b7f8767c0aa71d5137e2d79471718 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Site-structural variables

SITE = $(notdir $(subst $(shell echo $(urlpath) | sed "s,/$$,,"),,$(CURDIR)))
pagedir = $(prefix)/$(SITE)/$(urlpath)


# Boring make stuff

BUILT_SOURCES = $(page_SCRIPTS)
CLEANFILES = $(BUILT_SOURCES)


# Interesting target stuff

%.html %.shtml: %.wml $(top_srcdir)/include/add-header.xsl
	@xsltproc -html --stringparam root $(HTTP_PREFIX)/$(SITE) \
	    $(top_srcdir)/include/add-header.xsl $< > $@

# XSLT mangles PHP because PHP is evil ...
%.php3 %.php %.phtml: %.wml $(top_srcdir)/include/evilsedhack
	@$(top_srcdir)/include/evilsedhack $< $(HTTP_PREFIX)/$(SITE) > $@


.htaccess: htaccess
	@sed -e "s,@SITE@,$(HTTP_PREFIX)/$(SITE)," $< > $@