3 all: $(LIBRARIES) install metalua
7 LUA_RUN = ../$(LUA_VM_DIR)/$(RUN)
8 LUA_COMPILE = ../$(LUA_VM_DIR)/$(COMPILE)
15 # Library which compiles an AST into a bytecode string.
22 # Library which compiles source strings into AST
34 metalua.luac: mlc.luac
36 bytecode.luac: $(BYTECODE_LUA)
37 $(LUA_COMPILE) -o $@ $^
40 $(LUA_COMPILE) -o $@ $^
42 # Plain lua files compilation
43 %.luac: %.mlua bootstrap.lua mlp.luac bytecode.luac
44 $(LUA_RUN) bootstrap.lua $<
46 # FIXME what's this?! some old stuff from when metalua files hadn't their own
48 # Metalua files compilation through the bootstrap compiler
50 $(LUA_COMPILE) -o $@ bootstrap $<
52 # Compiler/interpreter
53 metalua: metalua.luac $(LIBRARIES)
54 $(LUA_RUN) metalua.luac --verbose --sharpbang '#!$(TARGET_BIN_PATH)/lua' --output metalua --file metalua.mlua
56 install: metalua $(LIBRARIES)
57 mkdir -p $(TARGET_BIN_PATH)
58 cp metalua $(TARGET_BIN_PATH)/
59 mkdir -p $(TARGET_LUA_PATH)
60 cp $(LIBRARIES) $(TARGET_LUA_PATH)/