-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGNUmakefile
50 lines (37 loc) · 1.54 KB
/
GNUmakefile
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
RUNTIME := src/runtime/table.j src/runtime/parser.j src/runtime/list.j src/runtime/stringtable.j
RUNTIME += src/runtime/modified.j src/runtime/wrap-around.j src/runtime/print.j
RUNTIME += src/runtime/convert.j src/runtime/context.j src/runtime/types.j
RUNTIME += src/runtime/instruction.j src/runtime/interpreter.j src/runtime/init.j
RUNTIME += src/runtime/api.j
PROCESSED := $(patsubst src/runtime/%.j, out/%.j, $(RUNTIME))
.PHONY: clean process all build
.PHONY: patch128 patch133
all: patch133
# 1.26b to 1.28
patch128: COMMONJ=common-1.28.j
patch128: PATCH_LVL=128
patch128: clean build
patch133: COMMONJ=common-1.33.j
patch133: PATCH_LVL=133
patch133: build
nix: COMMONJ=common-1.33.j
nix: PATCH_LVL=133
nix: $(PROCESSED) src/Hot/Types.hs src/Hot/CommonJHash.hs
ghc -DPATCH_LVL=$(PATCH_LVL) -isrc src/Main.hs -o jhcr
build: CABAL_FLAGS+=--ghc-options=-DPATCH_LVL=$(PATCH_LVL)
build: $(PROCESSED) src/Hot/Types.hs src/Hot/CommonJHash.hs
cabal build $(CABAL_FLAGS) jhcr
jhcr.exe: build
rm -f $@
strip $$(cabal list-bin $(CABAL_FLAGS) jhcr)
upx -qq $$(cabal list-bin $(CABAL_FLAGS) jhcr) -o $@
src/runtime/convert.j src/Hot/Types.hs src/Hot/CommonJHash.hs src/runtime/types.j src/runtime/g-type-bin.j: $(COMMONJ)
cabal run $(CABAL_FLAGS) convert -- $(COMMONJ)
process: $(PROCESSED)
out/%.j: src/runtime/%.j src/runtime/alloc.j src/runtime/alloc-globals.j
@mkdir -p $(@D)
PATCH_LVL=$(PATCH_LVL) bash src/process.sh $< $@ JHCR_
clean:
rm -f $(PROCESSED)
rm -f src/runtime/convert.j src/runtime/types.j src/Hot/Types.hs src/Hot/CommonJHash.hs
rm -f jhcr.exe