Skip to content
Snippets Groups Projects
Unverified Commit 1a289341 authored by Jan-Tarek Butt's avatar Jan-Tarek Butt Committed by Matthias Schiffer
Browse files

build: add GluonSrcDiet define to package.mk

This call takes an input and an output argument and will copy all files
from the input to the output, while minifying the Lua files.

[Matthias Schiffer: simplified definition, added commit message.]
parent d0831aa8
No related branches found
No related tags found
No related merge requests found
# Dependencies for LuaSrcDiet
PKG_BUILD_DEPENDS += luci-base/host lua/host
include $(INCLUDE_DIR)/package.mk
# Annoyingly, make's shell function replaces all newlines with spaces, so we have to do some escaping work. Yuck.
......@@ -33,3 +36,16 @@ define GluonInstallI18N
fi; \
done
endef
define GluonSrcDiet
rm -rf $(2)
$(CP) $(1) $(2)
$(FIND) $(2) -type f | while read src; do \
if $(STAGING_DIR_HOST)/bin/lua $(STAGING_DIR_HOST)/bin/LuaSrcDiet \
--noopt-binequiv -o "$$$$src.o" "$$$$src"; \
then \
chmod $$$$(stat -c%a "$$$$src") "$$$$src.o"; \
mv "$$$$src.o" "$$$$src"; \
fi; \
done
endef
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment