-extra_build:
- ./ikiwiki doc html --templatedir=templates --underlaydir=basewiki \
- --wikiname="ikiwiki" --verbose --nosvn \
- --exclude=/discussion --plugin=brokenlinks \
- --plugin=pagecount
- ./mdwn2man doc/usage.mdwn > ikiwiki.man
-
+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=C perl -I. $(extramodules) $(tflag) ikiwiki.out doc html --templatedir=templates \
+ --underlaydir=basewiki --nousedirs\
+ --wikiname="ikiwiki" --verbose \
+ --exclude=/discussion --no-discussion --userdir=users \
+ --plugin=goodstuff \
+ --plugin=haiku --plugin=polygen --plugin=fortune
+ ./mdwn2man ikiwiki 1 doc/usage.mdwn > ikiwiki.man
+ ./mdwn2man ikiwiki-mass-rebuild 8 doc/ikiwiki-mass-rebuild.mdwn > ikiwiki-mass-rebuild.man
+ $(MAKE) -C po
+ if [ "$$PROFILE" = 1 ]; then dprofpp; fi
+