-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (40 loc) · 1.19 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
PLATFORM ?= musl64
STRIP = strip
PKG ?= haskell-hole
COMPILER = ghc8105
ifeq ($(PLATFORM),aarch64-multiplatform-musl)
STRIP = aarch64-unknown-linux-musl-strip
else
ifeq ($(PLATFORM),muslpi)
STRIP = armv6l-unknown-linux-musleabihf-strip
COMPILER = ghc884
else
endif
endif
all: package
dist/$(PLATFORM):
mkdir -p $@
dist/$(PLATFORM)/%: dist/$(PLATFORM)
nix-build -A projectCross.$(PLATFORM).hsPkgs.$(PKG).components.exes.$(shell basename $@) --argstr compiler-nix-name $(COMPILER)
cp -f result/bin/$(shell basename $@) $@
chmod +w $@
nix-shell --run "$(STRIP) -s $@" --argstr compiler-nix-name $(COMPILER) --arg crossPlatforms "ps: with ps; [$(PLATFORM)]"
chmod -w $@
hole: dist/$(PLATFORM)/hole
holed: dist/$(PLATFORM)/holed
package: hole holed
cd dist/$(PLATFORM) && tar cjvf ../hole-linux-$(PLATFORM).tar.bz2 hole*
plan-sha256:
nix-build -A plan-nix.passthru.calculateMaterializedSha | bash
materialized:
rm -r nix/materialized
nix-build 2>&1 | grep -om1 '/nix/store/.*-updateMaterialized' | bash
clean:
rm -rf dist
help:
@echo make PLATFORM=muslpi
@echo make PLATFORM=musl64
@echo make PLATFORM=aarch64-multiplatform-musl
@echo make clean
@echo make plan-sha256
@echo make materialized