Skip to content
Snippets Groups Projects
Commit 86ef92ea authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

make: strip *.lua as intended since dcd89700

This saves a few kilobytes in the executable.
Also, the name XXD seemed no longer suitable,
as it does lua-specific cleaning.
parent 8437a7d4
Branches
Tags
1 merge request!57make: strip *.lua as intended since dcd89700
......@@ -23,7 +23,7 @@ ETCDIR ?= $(PREFIX)/etc/kresd
CC ?= cc
RM := rm -f
LN := ln -s
XXD := ./scripts/embed.sh
XXD_LUA := ./scripts/embed-lua.sh
INSTALL := install
# Flags
......
......@@ -12,7 +12,7 @@ kresd_DIST := daemon/lua/kres.lua daemon/lua/trust_anchors.lua
# Embedded resources
%.inc: %.lua
@$(call quiet,XXD,$<) $< > $@
@$(call quiet,XXD_LUA,$<) $< > $@
ifeq ($(AMALG), yes)
kresd.amalg.c: daemon/lua/sandbox.inc daemon/lua/config.inc
else
......
#!/bin/sh
set -e
# clean unnecessary stuff from the lua file
alias strip="sed -e 's/^[\t ]*//g; s/ */ /g; /^--/d; /^$/d'"
if command -v xxd > /dev/null 2>&1; then
strip < "$1" | xxd -i -
else
strip < "$1" | hexdump -v -e '/1 "0x%02X, " " "'
fi
exit $?
#!/bin/sh
set -e
alias strip="sed -e 's/^[ ]*//g; s/[ ][ ]*/ /g; /^--/d; /^$/d'"
if command -v xxd > /dev/null 2>&1; then
xxd -i - < $1 | strip
else
hexdump -v -e '/1 "0x%02X, " " "' < $1 | strip
fi
exit $?
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment