forked from UMDLARS/one_night_in_sf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
132 lines (100 loc) · 4.28 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
INF=$(wildcard *.inf)
Z8=$(INF:.inf=.z8)
Z5=$(INF:.inf=.z5)
Z3=$(INF:.inf=.z3)
TEST=$(wildcard *.test)
OUT=$(TEST:.test=.out)
C64=$(addprefix c64_,$(TEST:.test=.d64))
# We use wildcards to catch whatever the current version is.
INFORM:=inform6unix/inform-6.*
LIB=inform6unix/punyinform/lib/*.h *.h
PYTHON:=$(shell which python3)
ifdef PYTHON
# We're all right here
WEBSERVER:=$(PYTHON) -m http.server
else
# We're probably python2 still.
PYTHON:=$(shell which python)
WEBSERVER:=$(PYTHON) -m SimpleHTTPServer 8000
endif
TIME:=$(shell which time) # Should be null if it's a shell builtin, which is fine
# This rule will make any *possible* test output files, which may build zfiles.
# It wil re-build any extant zfiles that have newer dependencies, whether or
# not there are new test files.
all: ${OUT} $(wildcard *.d64) $(wildcard *.z?) VT323/fonts/ttf/VT323-Regular.ttf
# The moment you run `make c64`, all your testable games will be built into C64
# disk image files. You can burn these to a 1541 floppy somehow, or run them
# in the Vice emulator. Any existing C64 images will be kept up-to-date as you
# build.
c64: ${C64}
inform6unix/src/*.c:
${LIB}:
inform6unix/Makefile:
git clone --recursive https://gitlab.com/DavidGriffith/inform6unix.git
dep: inform6unix/Makefile node_modules/.bin/zvm plotex/regtest.py parchment-src/build.js
git -C inform6unix pull
git -C inform6unix submodule update --init --recursive
git -C plotex pull
git -C parchment-src pull || true
build: dep ${INFORM}
inform6unix/inform%: inform6unix/Makefile inform6unix/src/*.c
rm -f ${INFORM}
cd inform6unix; $(MAKE) -j
# npm isn't great, but this is the only z-machine I've found that both:
# 1. Installs cleanly on both Debian/Ubuntu and termux under android
# 2. Works with the regtest.py tool
node_modules/.bin/zvm:
npm install ifvms --no-package-lock
plotex/regtest.py:
git clone https://github.com/erkyrath/plotex
# We use z5 for tests because that is what zvm implements.
%.out: %.test %.z5 plotex/regtest.py node_modules/.bin/zvm
$(TIME) $(PYTHON) plotex/regtest.py -v -t 5 -i node_modules/.bin/zvm $< > $@ || ! grep -Hn '^\*\*\*' $@
%.z3: %.inf ${LIB} ${INFORM}
${INFORM} -e -E1 -d2 -s +include_path=./inform6unix/punyinform/lib/,./ -v3 $<
%.z5: %.inf ${LIB} ${INFORM}
${INFORM} -e -E1 -d2 -s +include_path=./inform6unix/punyinform/lib/,./ -v5 $<
%.z8: %.inf ${LIB} ${INFORM}
${INFORM} -e -E1 -d2 -s +include_path=./inform6unix/punyinform/lib/,./ -v8 $<
clean:
rm -f *.z? *.out
rm -rf build
# Parchment doesn't build most places, so we've "vendored" a copy of the
# essential files here, and made a `dist` target to package up the required
# files for shipment to any static Web hosting.
# To rebuild the vendored files, run `make parchment` and then `git add` all
# the results. Note that the whole vendor tree is in .gitignore, so watch out
# for that.
parchment-src/build.js:
git clone --recursive https://github.com/curiousdannii/parchment parchment-src
parchment: parchment-src/build.js
cd parchment-src && npm install --no-package-lock
mkdir -p parchment/dist
cp -alf parchment-src/dist/web parchment/dist/
# Our DEC terminal replica font!
VT323/fonts/ttf/VT323-Regular.ttf:
git clone --recursive https://github.com/phoikoi/VT323.git
# Make a distribution tree
dist: $(addprefix build/parchment/dist/web/,jquery.min.js main.js zvm.js web.css) $(addprefix build/,retro.css vt220.webp index.html untitledHeistGame.z5 favicon.ico) build/VT323/fonts/ttf/VT323-Regular.ttf
tar czvf untitledHeistGame-$(shell date +%y%m%d).tar.gz build/
build/%: %
@mkdir -p $(@D)
cp -alf $< $@
web: dist
@echo "You can play your game at http://localhost:8000/ now."
cd build; $(WEBSERVER) || true
# This will build a C64 disk image with the oldest z-machine version you have.
# So if you have a foo.z3 and a foo.z8 file, the c64_foo.d64 image will use the z3.
c64_%.d64: %.z? ozmoo/exomizer/src/exomizer /usr/bin/ruby /usr/bin/acme
/usr/bin/ruby ozmoo/make.rb $<
ozmoo/make.rb:
git clone --recursive https://github.com/johanberntsson/ozmoo.git
ozmoo/exomizer/src/Makefile: ozmoo/make.rb
git clone https://bitbucket.org/magli143/exomizer.git ozmoo/exomizer
ozmoo/exomizer/src/exomizer: ozmoo/exomizer/src/Makefile
make -C ozmoo/exomizer/src
/bin/%:
/usr/bin/%:
/usr/lib/command-not-found $*
.PRECIOUS: %.z3 %.z5 %.z8 ${INFORM}
.PHONY: parchment