Skip to content

Commit

Permalink
use ARCH instead of BUILD for Makefile
Browse files Browse the repository at this point in the history
Signed-off-by: Wang Chen <wangchen20@iscas.ac.cn>
  • Loading branch information
unicornx committed Mar 10, 2023
1 parent fc5f94b commit e291982
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,53 @@
# SHOULD NOT be submitted to upstream!!!

# some default values
BUILD ?= riscv64
ARCH ?= riscv64
CLANG ?= /aosp/common/wangchen/llvm-build/Release+Asserts
T ?= chrome_public_apk

# make clean [BUILD=<xxx>] [T=<xxx>]
# <xxx> e.g.
# buildtools/third_party/libc++:libc++
# chrome_public_apk
# make clean [ARCH=<xxx>] [T=<xxx>]
# Value of ARCH:
# - riscv64
# - arm64
# - ...
# Value of T:
# e.g.
# - buildtools/third_party/libc++:libc++
# - chrome_public_apk
.PHONY: clean
clean:
@echo Start cleaning target: "$(T)"
autoninja -C out/$(BUILD) -t clean $(T)
autoninja -C out/$(ARCH) -t clean $(T)
@echo Done!

# make ninja [BUILD=<xxx>] [T=<xxx>] [V=1]
# make ninja [ARCH=<xxx>] [T=<xxx>] [V=1]
# build target and create log file
# To get more verbose log, add argument "V=1"
.PHONY: ninja
ninja:
@echo Start building target: "$(T)"
-cp ./log ./log.bak
ifeq ($(V),1)
autoninja -d keeprsp -v -C out/$(BUILD) $(T) 2>&1 | tee ./log
autoninja -d keeprsp -v -C out/$(ARCH) $(T) 2>&1 | tee ./log
else
autoninja -d keeprsp -C out/$(BUILD) $(T) 2>&1 | tee ./log
autoninja -d keeprsp -C out/$(ARCH) $(T) 2>&1 | tee ./log
endif
@echo Done!

# make disclean [BUILD=<xxx>]
# make disclean [ARCH=<xxx>]
.PHONY: distclean
distclean:
rm -rf out/$(BUILD)
rm -rf out/$(ARCH)

# make gn [BUILD=<xxx>] [CLANG=<xxx>]
# make gn [ARCH=<xxx>] [CLANG=<xxx>]
# FIXME:
# "clang_use_chrome_plugins=false" may not be required when we are using
# clang for Chrome built by ourselves.
.PHONY: gn
gn:
gn gen out/$(BUILD) --args="\
gn gen out/$(ARCH) --args="\
target_os=\"android\" \
target_cpu=\"riscv64\" \
target_cpu=\"$(ARCH)\" \
skip_secondary_abi_for_cq=true \
android_static_analysis=\"off\" \
clang_base_path=\"$(CLANG)\" \
Expand Down

0 comments on commit e291982

Please sign in to comment.