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 bytecode.luac: $(BYTECODE_LUA)
35 $(LUA_COMPILE) -o $@ $^
38 $(LUA_COMPILE) -o $@ $^
40 # Plain lua files compilation
41 %.luac: %.mlua bootstrap.lua mlp.luac bytecode.luac
42 $(LUA_RUN) bootstrap.lua $<
44 # Metalua files compilation through the bootstrap compiler
46 $(LUA_COMPILE) -o $@ bootstrap $<
48 # Compiler/interpreter
49 metalua: metalua.luac $(LIBRARIES)
50 $(LUA_RUN) metalua.luac --verbose --sharpbang '#!/usr/bin/env lua' --output metalua --file metalua.mlua
52 install: metalua $(LIBRARIES)
53 mkdir -p $(TARGET_BIN_PATH)
54 cp metalua $(TARGET_BIN_PATH)/
55 mkdir -p $(TARGET_LUA_PATH)
56 cp $(LIBRARIES) $(TARGET_LUA_PATH)/