-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (26 loc) · 989 Bytes
/
Copy pathMakefile
File metadata and controls
35 lines (26 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
CPPFLAGS := -I/usr/include/lua5.4
CXXFLAGS := --std=c++20 -Wall -Werror
all: prerequisites dir srlua add
clean:
@rm -rf b/* $(BT) srlua add
prerequisites:
@which objcopy > /dev/null || echo "objcopy not installed (required to build ulutest)" || false
dir:
@mkdir -p b
srlua: b/srlua.o b/runtime.o b/resources_linux.o
@g++ -z noexecstack -o $@ $(CPPFLAGS) $(CXXFLAGS) $^
b/srlua.o: src/srlua.cpp src/signature.h
@g++ -c $< -o $@ $(CPPFLAGS) $(CXXFLAGS)
b/resources_linux.o: src/resources_linux.cpp src/signature.h
@g++ -c $< -o $@ $(CPPFLAGS) $(CXXFLAGS)
b/runtime.o: b/runtime
@objcopy -I binary -O elf64-x86-64\
--redefine-sym _binary_b_runtime_start=runtime_start\
--redefine-sym _binary_b_runtime_end=runtime_end $< $@
@nm $@ > $(@:.o=.symbols)
b/runtime: src/runtime.cpp src/signature.h
@g++ $< -o b/runtime $(CPPFLAGS) $(CXXFLAGS) -llua5.4
# ======================================================================
add: add.lua srlua
@./srlua $< $@
@chmod +x $@