forked from jjuran/metamage_1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
175 lines (129 loc) · 4.46 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# Makefile for <https://github.com/jjuran/metamage_1>
REPOS =
REPOS += ams-68k-bin
REPOS += freemount
REPOS += git
REPOS += macward-compat
D68K = var/build/dbg/bin/d68k/d68k
XV68K = var/build/dbg/bin/xv68k/xv68k
PACK68K = utils/pack.pl
METAMAGE_1 = `git remote -v | grep '^origin.*\(fetch\)' | awk '{print $$2}'`
PLEASE_RUN = 'Please run `(cd .. && git clone' $(METAMAGE_1)')`.'
default:
@echo 'For help, run `make help`.'
help:
@echo 'To clone a documented companion repository, run `make $$repo.git`.'
@echo 'To build a command-line tool, run `./build.pl $$toolname`.'
@echo 'To build a Mac app, run `bin/build-app $$appname`.'
@echo "If build.pl can't find a new config file, run \`make catalog\` and retry."
rm-catalog:
rm -f var/cache/compile-driver/catalog
catalog: rm-catalog
./build.pl
../%:
@echo $(REPOS) | grep $* > /dev/null || (echo Unknown repo $*; exit 1)
@test -d ../$*/.git || bin/clone-repo $*
var/links:
mkdir -p var/links
var/links/%: var/links
@echo $(REPOS) | grep $* > /dev/null || (echo Unknown repo $*; exit 1)
@test -d ../$*/.git || (echo; echo $(PLEASE_RUN) | sed s/metamage_1/$*/; echo; exit 128)
@test -e var/links/$* || (ln -s ../../../$* var/links/ && rm -f var/cache/compile-driver/catalog)
%.git: ../% var/links/%
@true
app-build-tools:
./build.pl -i vx
AMS_REPOS := freemount.git ams-68k-bin.git
AMS_TOOLS := exhibit graft raster vx xv68k freemountd
AMS_UTILS_ROOT := var/install/lib/metamage
var/install:
@echo
@echo "Please run \`./configure\`. Or, if you lack root access, run"
@echo
@echo " INSTALL_PREFIX=\$$HOME ./configure"
@echo
@echo "instead."
@echo
@exit 1
ams-linux-tools: $(AMS_REPOS) var/install
./build.pl -i $(AMS_TOOLS) display-linux interact-linux kdmode reader
ams-vx-Z:
@echo 'vx -Z "$$@"' > bin/"vx -Z"
@chmod +x bin/"vx -Z"
ams-linux: ams-linux-tools ams-vx-Z
@test -x bin/display || ln -s ../var/out/display-linux bin/display
@test -x bin/interact || ln -s ../var/out/interact-linux bin/interact
@test -x bin/spiel-mouse || ln -s ../v/bin/spiel-mouse.vx bin/spiel-mouse
@echo
@echo "Build phase complete. Run \`make ams-linux-inst\` to continue."
@echo
ams-linux-inst: var/install
install -d $(AMS_UTILS_ROOT)
install -t $(AMS_UTILS_ROOT) var/out/kdmode var/out/reader
@echo
@echo "Utilities installed. Run \`make ams-linux-demo\` to continue."
@echo
ams-linux-suid:
chown root:root $(AMS_UTILS_ROOT)/kdmode
chmod +s $(AMS_UTILS_ROOT)/kdmode
ams-linux-check:
@test -e /dev/fb0 || echo
@test -e /dev/fb0 || echo "No /dev/fb0? Sorry, this isn't going to work."
@test -e /dev/fb0 || echo
@test -e /dev/fb0 || exit 1
@test -w /dev/fb0 || echo
@test -w /dev/fb0 || echo "/dev/fb0 exists, but isn't writable."
@test -w /dev/fb0 || echo "Join the 'video' group and try again."
@test -w /dev/fb0 || echo
@test -w /dev/fb0 || exit 1
ams-linux-demo: ams-linux-check
PATH="$$PWD/bin:$$PWD/var/out:$$PATH" ./scripts/ams
ams-osx: $(AMS_REPOS) macward-compat.git
bin/build-app Genie
mkdir -p ~/var/run/fs
open var/build/dbg/bin/Genie/MacRelix.app
./build.pl -i $(AMS_TOOLS) uunix interact
PATH="$$PWD/var/out:$$PATH" ./scripts/ams
d68k:
./build.pl d68k
d68k-hello: d68k
$(PACK68K) v68k/demos/hello.p68k | $(D68K)
d68k-fizzbuzz: d68k
$(PACK68K) v68k/demos/fizzbuzz.p68k | $(D68K)
freemountd-tcp: freemount.git
./build.pl -i freemountd listen
var/freemount/hello.txt:
mkdir -p var/freemount/
echo Hello world > var/freemount/hello.txt
freemountd-tcp-test: freemountd-tcp var/freemount/hello.txt
var/out/listen 127.0.0.1:4564 var/out/freemountd --root var/freemount
freemount-tcp: freemount.git
./build.pl -i fls fcat fget utcp
fls-test: freemount-tcp
PATH="$$PWD/var/out:$$PATH" var/out/fls mnt://127.0.0.1
fcat-test: freemount-tcp
PATH="$$PWD/var/out:$$PATH" var/out/fcat mnt://127.0.0.1/hello.txt
xv68k:
./build.pl xv68k
xv68k-rts: xv68k
echo 4E75 | $(PACK68K) | $(XV68K)
xv68k-hello: xv68k
$(PACK68K) v68k/demos/hello.p68k | $(XV68K)
xv68k-ill: xv68k
echo 4AFC 4E75 | $(PACK68K) | $(XV68K)
xv68k-ill-priv: xv68k
echo 4E72 4E75 | $(PACK68K) | $(XV68K)
xv68k-ill-F: xv68k
echo FFFF 4E75 | $(PACK68K) | $(XV68K)
xv68k-segv: xv68k
echo 2010 4E75 | $(PACK68K) | $(XV68K)
xv68k-segv-pc: xv68k
perl -e 'print pack "n*", 0x4EF8, 0x0000, 0x4E75' | $(XV68K)
echo 4EF8 0000 4E75 | $(PACK68K) | $(XV68K)
xv68k-bus: xv68k
echo 202F 0001 4E75 | $(PACK68K) | $(XV68K)
xv68k-bus-pc: xv68k
echo 6001 4E71 4E75 | $(PACK68K) | $(XV68K)
xv68k-div0: xv68k
echo 80C1 4E75 | $(PACK68K) | $(XV68K)
.SECONDARY: