-extra_build:
- ./ikiwiki doc html --templatedir=templates --underlaydir=basewiki \
- --wikiname="ikiwiki" --verbose --no-rcs \
- --exclude=/discussion --no-discussion \
- --plugin=brokenlinks --plugin=pagecount \
- --plugin=orphans --plugin=haiku --plugin=meta
+VER=$(shell perl -e '$$_=<>;print m/\((.*?)\)/'<debian/changelog)
+
+PROBABLE_INST_LIB=$(shell \\
+ if [ "$(INSTALLDIRS)" = "perl" ]; then \\
+ echo $(INSTALLPRIVLIB); \\
+ elif [ "$(INSTALLDIRS)" = "site" ]; then \\
+ echo $(INSTALLSITELIB); \\
+ elif [ "$(INSTALLDIRS)" = "vendor" ]; then \\
+ echo $(INSTALLVENDORLIB); \\
+ fi \\
+)
+
+tflag=$(shell if [ "$$NOTAINT" != 0 ]; then printf -- "-T"; fi)
+extramodules=$(shell if [ "$$PROFILE" = 1 ]; then printf -- "-MDevel::Profiler"; fi)
+
+ikiwiki.out: ikiwiki.in
+ ./pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB) < ikiwiki.in > ikiwiki.out
+ chmod +x ikiwiki.out
+
+extra_build: ikiwiki.out
+ LANG= perl -I. $(extramodules) $(tflag) ikiwiki.out doc html --templatedir=templates \
+ --underlaydir=underlays/basewiki --nousedirs\
+ --wikiname="ikiwiki" --verbose \
+ --exclude=/discussion --no-discussion --userdir=users \
+ --plugin=goodstuff \
+ --plugin=haiku --plugin=polygen --plugin=fortune