-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (46 loc) · 1.22 KB
/
Copy pathMakefile
File metadata and controls
58 lines (46 loc) · 1.22 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
this_makefile := $(abspath $(lastword $(MAKEFILE_LIST)))
export ARCH ?= x86_64
export SRCTREE := $(abspath $(dir $(this_makefile)))
export BUILD := build
export OUT := $(BUILD)/$(ARCH)
export DIST := dist
export SYSROOT := $(abspath $(OUT)/sysroot)
export PKGS := $(OUT)/packages
PHONY :=
__default: all
ifeq ($(ARCH),host)
diskImageExt :=
else ifeq ($(ARCH),x86_64)
diskImageExt := iso
else ifeq ($(ARCH),aarch64)
diskImageExt := img
else
$(error Disk image file extension not configured for ARCH: $(ARCH))
endif
diskImageBasename := aether-$(ARCH).$(diskImageExt)
PHONY += FORCE
FORCE: ;
PHONY += all
all: $(DIST)/$(diskImageBasename)
ifneq ($(ARCH),host)
$(BUILD)/host/%: FORCE
@echo " RECURSE MAKE HOST $@"
@$(MAKE) $@ ARCH=host
endif
include $(SRCTREE)/package.mk
include $(SRCTREE)/image/image.mk
include $(SRCTREE)/mk/compile_commands.json.mk
include $(SRCTREE)/mk/qemu.mk
include $(SRCTREE)/mk/rust-project.json.mk
%/: # A pattern rule to create directories
@mkdir -p $@
clean:
@echo " CLEAN $(BUILD)"
@rm -rf $(BUILD)
@echo " CLEAN $(DIST)"
@rm -rf $(DIST)
@echo " CLEAN compile_commands.json"
@rm -rf compile_commands.json
@echo " CLEAN rust-project.json"
@rm -rf rust-project.json
.PHONY: $(PHONY)