-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (51 loc) · 1.89 KB
/
Makefile
File metadata and controls
75 lines (51 loc) · 1.89 KB
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
include functs.mk
# Build parameters
export DOCKER ?= docker
export SUITE ?= brewmaster
export VARIANT ?= minbase
export STEAMREPO ?= http://repo.steampowered.com/steamos
export BASEIMAGE ?= $(SUITE)
export STEAMUSER_UID STEAMUSER_GID STEAMUSER_HOME
IMAGES= steambox_ati steambox_nvidia steambox steamos_buildmach
BUILDDIR=./build
all: steambox
steambox_ati: steambox
steambox_nvidia: steambox
steambox: baseimage
baseimage: $(BUILDDIR)/$(BASEIMAGE).built
$(IMAGES):
$(MAKE) -C $(@) build
distclean: clean
$(foreach img,$(IMAGES),$(MAKE) -C $(img) $(@);)
$(RM) -r $(BUILDDIR)
clean:
$(foreach img,$(IMAGES),$(MAKE) -C $(img) $(@);)
$(BUILDDIR)/$(BASEIMAGE).built: $(BUILDDIR)
@if ( $(call check-new-image,$(BASEIMAGE)) ) ; then \
echo "Building baseimage $(BASEIMAGE)..." ; \
$(MAKE) build-baseimage ; \
fi
$(DOCKER) inspect $(BASEIMAGE) > $(BUILDDIR)/$(BASEIMAGE).built
debug-buildmach: steamos_buildmach
$(DOCKER) run -ti --privileged --rm \
-v "$(abspath $(BUILDDIR)):/root/steamos" \
--entrypoint /bin/bash \
steamos_buildmach -i
delete-baseimage:
@$(call check-confirm,Are you sure you want to delete your SteamOS base image ($(BASEIMAGE))?)
@echo
$(call clean-container,$(BASEIMAGE))
$(call clean-image,$(BASEIMAGE))
$(RM) $(BUILDDIR)/$(BASEIMAGE).built
build-baseimage: $(BUILDDIR)/Dockerfile $(BUILDDIR)/rootfs.tar.xz
$(DOCKER) build -t $(BASEIMAGE) ./build
$(BUILDDIR)/Dockerfile $(BUILDDIR)/rootfs.tar.xz: steamos_buildmach $(BUILDDIR)
@$(call check-new-container-msg,steamos_buildmach, \
steamos_buildmach already exists. Please run \"make clean\" first.)
$(DOCKER) run -ti --privileged --rm \
--name steamos_buildmach \
-v "$(abspath $(BUILDDIR)):/root/steamos" steamos_buildmach \
"--variant=$(VARIANT)" "$(SUITE)" "$(STEAMREPO)"
$(BUILDDIR):
mkdir -p $(BUILDDIR)
.PHONY: all clean distclean baseimage build-baseimage delete-baseimage debug-buildmach $(IMAGES)