[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: compiling scripts to bytecode with Automake?
From: |
anonymous532 |
Subject: |
RE: compiling scripts to bytecode with Automake? |
Date: |
Fri, 20 Jun 2014 13:02:19 +0000 (UTC) |
Sorry I have no idea how to properly reply to my initial message as I am not
subscribed to the mailing list. Anyhow..
Never thought I would write this, but extending Automake is really easy!
I'll write my solution here in case someone finds this with a search engine.
Below is what I came up with (simplified version), simply adding new Lua files
to nobase_dist_lua_DATA will automagically compile them using luac and your
preferred luac flags.
nobase_dist_lua_DATA = \
scripts/example_one.luac \
scripts/example_two.luac
LUA_CC = luac
LUA_CC_FLAGS = -s
LUA_OBJECTS = $(nobase_dist_lua_DATA:.lua=.luac)
all-local: lua-compile
clean-local: lua-clean
lua-compile: $(LUA_OBJECTS)
lua-clean:
rm scripts/*.luac
lua.luac:
$(LUA_CC) $(LUA_CC_FLAGS) $< -o $@