2016-03-22 22:44:17 +01:00
|
|
|
# We need to rebootstrap soong if SOONG_OUT_DIR or the reverse path from
|
|
|
|
# SOONG_OUT_DIR to TOP changes
|
|
|
|
SOONG_NEEDS_REBOOTSTRAP :=
|
|
|
|
ifneq ($(wildcard $(SOONG_BOOTSTRAP)),)
|
|
|
|
ifneq ($(SOONG_OUT_DIR),$(strip $(shell source $(SOONG_BOOTSTRAP); echo $$BUILDDIR)))
|
|
|
|
SOONG_NEEDS_REBOOTSTRAP := FORCE
|
|
|
|
$(warning soong_out_dir changed)
|
|
|
|
endif
|
2016-05-03 00:31:17 +02:00
|
|
|
ifneq ($(strip $(shell build/soong/scripts/reverse_path.py $(SOONG_OUT_DIR))),$(strip $(shell source $(SOONG_BOOTSTRAP); echo $$SRCDIR_FROM_BUILDDIR)))
|
2016-03-22 22:44:17 +01:00
|
|
|
SOONG_NEEDS_REBOOTSTRAP := FORCE
|
|
|
|
$(warning reverse path changed)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Bootstrap soong.
|
|
|
|
$(SOONG_BOOTSTRAP): bootstrap.bash $(SOONG_NEEDS_REBOOTSTRAP)
|
2015-11-09 23:53:36 +01:00
|
|
|
$(hide) mkdir -p $(dir $@)
|
2016-03-22 22:44:17 +01:00
|
|
|
$(hide) BUILDDIR=$(SOONG_OUT_DIR) ./bootstrap.bash
|
2015-11-09 23:53:36 +01:00
|
|
|
|
2015-12-11 22:50:00 +01:00
|
|
|
# Tell soong that it is embedded in make
|
|
|
|
$(SOONG_IN_MAKE):
|
|
|
|
$(hide) mkdir -p $(dir $@)
|
|
|
|
$(hide) touch $@
|
|
|
|
|
2016-03-11 00:03:41 +01:00
|
|
|
# Run Soong, this implicitly create an Android.mk listing all soong outputs as
|
|
|
|
# prebuilts.
|
|
|
|
.PHONY: run_soong
|
2016-03-22 22:44:17 +01:00
|
|
|
run_soong: $(SOONG_BOOTSTRAP) $(SOONG_VARIABLES) $(SOONG_IN_MAKE) FORCE
|
2016-08-15 22:38:21 +02:00
|
|
|
$(hide) SKIP_NINJA=true $(SOONG)
|