Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -7,7 +7,9 @@ PHP ?= php
 
 # Variables
 
-DESTDIR ?= deploy
+ifeq ($(DESTDIR),)
+DESTDIR := deploy
+endif
 
 # Javascript compiler
 
@@ -66,9 +68,9 @@ JSFILES = $(sort $(shell find client/zarafa -name '*.j
 
 .PHONY: deploy server client all
 
-all: deploy
+all: deploy clearartifacts
 
-deploy: node_modules server client plugins css clearartifacts
+deploy: node_modules server client plugins css
 
 build: node_modules deploy
 
@@ -89,20 +91,20 @@ css:
 svgo: node_modules
 	find client plugins -type f -name "*.svg" -exec $(SVGCOMPRESS) --multipass {} \;
 
-clearartifacts:
+clearartifacts: deploy
 	find $(DESTDIR) -iname "*readme*" -exec rm -f {} \;
 	find $(DESTDIR) -iname "*license*.txt" -exec rm -f {} \;
 	find $(DESTDIR) -iname "*gpl*.txt" -exec rm -f {} \;
 
 js: $(JSDEPLOY)/fingerprint.js $(JSDEPLOY)/resize.js $(JSDEPLOY)/grommunio.js $(JSDEPLOY)/extjs-mod/extjs-mod.js $(JSDEPLOY)/extjs/ext-base-all.js $(DESTDIR)/client/third-party/ux-thirdparty.js $(DEPLOYPURIFYJS) $(JSDEPLOY)/filepreviewer/pdfjs/build/pdf.sandbox.js $(JSDEPLOY)/filepreviewer/pdfjs/build/pdf.worker.js $(JSDEPLOY)/filepreviewer/pdfjs/build/pdf.js $(JSDEPLOY)/filepreviewer/pdfjs/web/viewer.js $(JSDEPLOY)/filepreviewer/ViewerJS/ImageViewerPlugin.js $(JSDEPLOY)/filepreviewer/ViewerJS/MultimediaViewerPlugin.js $(JSDEPLOY)/filepreviewer/ViewerJS/ODFViewerPlugin.js $(JSDEPLOY)/filepreviewer/ViewerJS/UnknownFilePlugin.js $(JSDEPLOY)/filepreviewer/ViewerJS/viewer.js $(JSDEPLOY)/filepreviewer/ViewerJS/video-js/video.js
-	cp -rn client/tinymce $(DESTDIR)/client/
-	cp -rn client/tinymce-languages $(DESTDIR)/client/
-	cp -rn client/extjs $(DESTDIR)/client/
-	cp -rn client/filepreviewer $(DESTDIR)/client/
+	cp -r client/tinymce $(DESTDIR)/client/
+	cp -r client/tinymce-languages $(DESTDIR)/client/
+	cp -r client/extjs $(DESTDIR)/client/
+	cp -r client/filepreviewer $(DESTDIR)/client/
 	rm $(DESTDIR)/client/extjs/ext-base.js $(DESTDIR)/client/extjs/ext-base-debug.js $(DESTDIR)/client/extjs/ext-all.js $(DESTDIR)/client/filepreviewer/pdfjs/web/debugger.js
 
 $(DESTDIR)/%.php: %.php
-	php -l $<
+#	$(PHP) -l $<
 	mkdir -p $$(dirname $@)
 	cp $< $@
 
@@ -289,7 +291,7 @@ phplintci:
 vendor: node_modules
 
 node_modules:
-	$(NPM) install
+	#$(NPM) install
 
 # Icons
 
@@ -337,11 +339,11 @@ tokenizr: node_modules
 
 .PHONY: plugins
 plugins:
-	make -C plugins
+	$(MAKE) -C plugins
 
 .PHONY: clean
 clean:
-	make -C plugins clean
+	$(MAKE) -C plugins clean
 	@rm -rf deploy
 	@rm -rf node_modules
 
