-build/webapp.tar.gz: $(STATIC_BUILD_DIR)/main.js $(STATIC_BUILD_DIR)/index.html $(STATIC_BUILD_DIR)/style.css
- tar czf $@ --directory=$(dir $<) $(notdir $^)
+build/webapp.tar.gz: $(addprefix $(STATIC_BUILD_DIR)/, $(STATIC_FILES)) build/static/main.js $(ICONS)
+ tar czf $@ --directory=$(dir $<) $(subst $(STATIC_BUILD_DIR)/,,$^)