-define prepare_build
- rm -rf build-$1
- mkdir build-$1
- cp -a debian build-$1/debian
- mv build-$1/debian/control.in build-$1/debian/control
- echo >> build-$1/debian/control
- cat debian/$1.control >> build-$1/debian/control
- echo "git clone git://git.proxmox.com/git/pve-docs.git\\ngit checkout ${GITVERSION}" > build-$1/debian/SOURCE
- install -dm755 build-$1/usr/share/$1
- install -dm755 build-$1/usr/share/doc/$1
-endef
-
-.PHONY: gen-deb
-gen-deb: $(GEN_DEB)
-$(GEN_DEB): $(GEN_DEB_SOURCES) asciidoc-pve asciidoc/mediawiki.conf
- $(call prepare_build,$(GEN_PACKAGE))
- install -dm755 build-$(GEN_PACKAGE)/usr/bin
+.PHONY: install
+install: gen-install doc-install mediawiki-install
+
+.PHONY: gen-install
+gen-install: $(GEN_DEB_SOURCES) asciidoc-pve asciidoc/mediawiki.conf
+ install -dm755 $(DESTDIR)/usr/share/$(GEN_PACKAGE)
+ install -dm755 $(DESTDIR)/usr/share/doc/$(GEN_PACKAGE)
+ install -dm755 $(DESTDIR)/usr/bin