-
Notifications
You must be signed in to change notification settings - Fork 98
/
Copy pathMakefile
121 lines (111 loc) · 3.43 KB
/
Makefile
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
OS := $(shell uname)
CPU := $(shell uname -m)
DTZ := $(shell date "+%Z")
ifeq ($(CPU),x86_64)
ABI := AMD64
else
CPU := aarch64
ABI := ARM64
endif
all: .hostenv gui tui
gui: .hostenv obj/$(CPU)/$(ABI)/$(OS)/main_gui
tui: .hostenv obj/$(CPU)/$(ABI)/$(OS)/main_tui
install: clean .hostenv gui tui inst
.hostenv:
ifeq ($(OS), Windows)
@echo "USER=%USERNAME%" > .hostenv
@echo "HOME=%HOMEPATH%" >> .hostenv
@echo "PWD=%CD%" >> .hostenv
else
@echo "USER=$(USER)" > .hostenv
@echo "HOME=$(HOME)" >> .hostenv
@echo "PWD=$(PWD)" >> .hostenv
endif
@echo $(CPU) > arch
@echo $(OS) > platform
@echo $(ABI) > abi
@echo "ROOT=$(PWD)" >> .hostenv
@echo "HE_VER=2" >> .hostenv
@echo "OS=$(OS)" >> .hostenv
@echo "CPU=$(CPU)" >> .hostenv
@echo "ABI=$(ABI)" >> .hostenv
@echo "TZ=$(DTZ)" >> .hostenv
snapshot:
rm -f snapshot.zip
zip -9q snapshot.zip \
obj/x86_64/AMD64/Darwin \
obj/x86_64/AMD64/Linux \
obj/aarch64/ARM64/Linux \
obj/aarch64/ARM64/Darwin \
obj/vp64/VP64/sys/boot_image \
`find obj -name "main_gui.exe"` \
`find obj -name "main_tui.exe"`
inst:
@./stop.sh
@./obj/$(CPU)/$(ABI)/$(OS)/main_tui -e -l 000-001 -l 008-000 obj/vp64/VP64/sys/boot_image &
@./obj/$(CPU)/$(ABI)/$(OS)/main_tui -e -l 001-002 -l 000-001 obj/vp64/VP64/sys/boot_image &
@./obj/$(CPU)/$(ABI)/$(OS)/main_tui -e -l 002-003 -l 001-002 obj/vp64/VP64/sys/boot_image &
@./obj/$(CPU)/$(ABI)/$(OS)/main_tui -e -l 003-004 -l 002-003 obj/vp64/VP64/sys/boot_image &
@./obj/$(CPU)/$(ABI)/$(OS)/main_tui -e -l 004-005 -l 003-004 obj/vp64/VP64/sys/boot_image &
@./obj/$(CPU)/$(ABI)/$(OS)/main_tui -e -l 005-006 -l 004-004 obj/vp64/VP64/sys/boot_image &
@./obj/$(CPU)/$(ABI)/$(OS)/main_tui -e -l 006-007 -l 005-006 obj/vp64/VP64/sys/boot_image &
@./obj/$(CPU)/$(ABI)/$(OS)/main_tui -e -l 007-008 -l 006-007 obj/vp64/VP64/sys/boot_image &
@./obj/$(CPU)/$(ABI)/$(OS)/main_tui -e -l 008-000 -l 007-008 obj/vp64/VP64/sys/boot_image -run apps/terminal/install.lisp
obj/$(CPU)/$(ABI)/$(OS)/main_gui: obj/$(CPU)/$(ABI)/$(OS)/main_gui.o obj/$(CPU)/$(ABI)/$(OS)/vp64.o
ifeq ($(OS),Darwin)
c++ -o $@ $@.o \
obj/$(CPU)/$(ABI)/$(OS)/vp64.o \
-F/Library/Frameworks \
-Wl,-framework,SDL2 -Wl
codesign -f -s - --entitlements main_tui.entitlements \
obj/$(CPU)/$(ABI)/$(OS)/main_gui
endif
ifeq ($(OS),Linux)
c++ -o $@ $@.o \
obj/$(CPU)/$(ABI)/$(OS)/vp64.o \
$(shell sdl2-config --libs)
endif
obj/$(CPU)/$(ABI)/$(OS)/main_tui: obj/$(CPU)/$(ABI)/$(OS)/main_tui.o obj/$(CPU)/$(ABI)/$(OS)/vp64.o
ifeq ($(OS),Darwin)
c++ -o $@ $@.o \
obj/$(CPU)/$(ABI)/$(OS)/vp64.o
codesign -f -s - --entitlements main_tui.entitlements \
obj/$(CPU)/$(ABI)/$(OS)/main_tui
endif
ifeq ($(OS),Linux)
c++ -o $@ $@.o \
obj/$(CPU)/$(ABI)/$(OS)/vp64.o
endif
obj/$(CPU)/$(ABI)/$(OS)/main_gui.o: main.cpp Makefile
ifeq ($(OS),Darwin)
c++ -O3 -c -D_GUI=GUI -nostdlib -fno-exceptions \
-I/Library/Frameworks/SDL2.framework/Headers/ \
-o $@ $<
endif
ifeq ($(OS),Linux)
c++ -O3 -c -D_GUI=GUI -nostdlib -fno-exceptions \
-I/usr/include/SDL2/ \
-o $@ $<
endif
obj/$(CPU)/$(ABI)/$(OS)/main_tui.o: main.cpp Makefile
ifeq ($(OS),Darwin)
c++ -O3 -c -nostdlib -fno-exceptions \
-o $@ $<
endif
ifeq ($(OS),Linux)
c++ -O3 -c -nostdlib -fno-exceptions \
-o $@ $<
endif
obj/$(CPU)/$(ABI)/$(OS)/vp64.o: vp64.cpp Makefile
ifeq ($(OS),Darwin)
c++ -O3 -c -nostdlib -fno-exceptions \
-o $@ $<
endif
ifeq ($(OS),Linux)
c++ -O3 -c -nostdlib -fno-exceptions \
-o $@ $<
endif
clean:
rm -f .hostenv
rm -rf obj/
unzip -nq snapshot.zip