forked from android-generic/glodroid_aospext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile_meson.mk
39 lines (34 loc) · 1.57 KB
/
makefile_meson.mk
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
#!/usr/bin/make
MESON_DEFS:=[PLACE_FOR_MESON_DEFS]
CONFIGURE_TARGET:=./logs/3.configure.log
BUILD_TARGET:=./logs/4.build.log
INSTALL_TARGET:=./logs/5.install.log
configure: ## Configure the project
configure: export BASE_DIR = $(OUT_BASE_DIR)
configure: $(CONFIGURE_TARGET)
$(CONFIGURE_TARGET): $(PATCH_TARGET)
@echo Configuring...
@echo "[constants]" > $(OUT_BASE_DIR)/gen/meson_aosp_cross.out
@echo "base_dir='$(OUT_BASE_DIR)'" >> $(OUT_BASE_DIR)/gen/meson_aosp_cross.out
@echo "llvm_dir='$(LLVM_DIR)'" >> $(OUT_BASE_DIR)/gen/meson_aosp_cross.out
@cat $(OUT_BASE_DIR)/gen/meson_aosp_cross >> $(OUT_BASE_DIR)/gen/meson_aosp_cross.out
@(cd $(OUT_SRC_DIR) && meson setup $(OUT_BUILD_DIR) --cross-file $(OUT_BASE_DIR)/gen/meson_aosp_cross.out $(MESON_DEFS)) &> [email protected] || (cat [email protected] && exit 1)
@mv [email protected] $@ -f
build: ## Build the project
build: export BASE_DIR = $(OUT_BASE_DIR)
build: $(BUILD_TARGET)
$(BUILD_TARGET): $(CONFIGURE_TARGET)
@echo Building...
@mkdir -p $(OUT_BUILD_DIR)
@ninja -C $(OUT_BUILD_DIR) &> [email protected] || (cat [email protected] && exit 1)
@mv [email protected] $@ -f
install: ## Install the project (will execute copy, patch, configure and build prior to install)
install: $(INSTALL_TARGET)
$(INSTALL_TARGET): $(BUILD_TARGET)
@echo Installing...
@mkdir -p $(OUT_INSTALL_DIR)
@DESTDIR=$(OUT_INSTALL_DIR) ninja -C $(OUT_BUILD_DIR) install &> [email protected] || (cat [email protected] && exit 1)
@mv [email protected] $@ -f
gen_aospless: ## Generate tree for building without AOSP or NDK
L_AOSP_ROOT=$(AOSP_ROOT) L_AOSP_OUT_DIR=$(AOSP_OUT_DIR) python3 $(OUT_BASE_DIR)/gen_aospless_dir.py
tar -czf aospless.tar.gz aospless