blob: 9b367c1148451f9b1b276bbdb5a2aebe2a2ee0c4 [file] [log] [blame]
Dan Pasanen91f76202017-07-06 08:21:30 -05001ADDONSU_PREBUILTS_PATH := vendor/lineage/addonsu/
Gabriele M5b33c6c2017-01-22 22:50:02 +01002
3ADDONSU_INSTALL_OUT := $(PRODUCT_OUT)/addonsu-install/
Michael Bestasd67ef782017-04-28 23:55:07 +03004ADDONSU_INSTALL_TARGET := $(PRODUCT_OUT)/addonsu-$(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_ARCH).zip
Gabriele M5b33c6c2017-01-22 22:50:02 +01005
6$(ADDONSU_INSTALL_TARGET): $(ALL_MODULES.updater.BUILT) \
7 $(ALL_MODULES.su.BUILT) $(ALL_MODULES.su.PATH)/superuser.rc
8 $(hide) rm -rf $@ $(ADDONSU_INSTALL_OUT)
9 $(hide) mkdir -p $(ADDONSU_INSTALL_OUT)/META-INF/com/google/android/
10 $(hide) mkdir -p $(ADDONSU_INSTALL_OUT)/system/xbin
11 $(hide) mkdir -p $(ADDONSU_INSTALL_OUT)/system/addon.d
12 $(hide) mkdir -p $(ADDONSU_INSTALL_OUT)/system/etc/init
13 $(hide) cp $(ALL_MODULES.su.BUILT) $(ADDONSU_INSTALL_OUT)/system/xbin/
14 $(hide) cp $(ALL_MODULES.su.PATH)/superuser.rc $(ADDONSU_INSTALL_OUT)/system/etc/init/
15 $(hide) cp $(ALL_MODULES.updater.BUILT) $(ADDONSU_INSTALL_OUT)/META-INF/com/google/android/update-binary
16 $(hide) cp $(ADDONSU_PREBUILTS_PATH)/51-addonsu.sh $(ADDONSU_INSTALL_OUT)/system/addon.d/
17 $(hide) cp $(ADDONSU_PREBUILTS_PATH)/mount-system.sh $(ADDONSU_INSTALL_OUT)/
18 $(hide) cp $(ADDONSU_PREBUILTS_PATH)/updater-script-install $(ADDONSU_INSTALL_OUT)/META-INF/com/google/android/updater-script
19 $(hide) (cd $(ADDONSU_INSTALL_OUT) && zip -qr $@ *)
20
21.PHONY: addonsu
22addonsu: $(ADDONSU_INSTALL_TARGET)
23 @echo "Done: $(ADDONSU_INSTALL_TARGET)"
24
25
26ADDONSU_REMOVE_OUT := $(PRODUCT_OUT)/addonsu-remove/
Michael Bestasd67ef782017-04-28 23:55:07 +030027ADDONSU_REMOVE_TARGET := $(PRODUCT_OUT)/addonsu-remove-$(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_ARCH).zip
Gabriele M5b33c6c2017-01-22 22:50:02 +010028
29$(ADDONSU_REMOVE_TARGET): $(ALL_MODULES.updater.BUILT)
30 $(hide) rm -rf $@ $(ADDONSU_REMOVE_OUT)
31 $(hide) mkdir -p $(ADDONSU_REMOVE_OUT)/META-INF/com/google/android/
32 $(hide) cp $(ALL_MODULES.updater.BUILT) $(ADDONSU_REMOVE_OUT)/META-INF/com/google/android/update-binary
33 $(hide) cp $(ADDONSU_PREBUILTS_PATH)/mount-system.sh $(ADDONSU_REMOVE_OUT)/
34 $(hide) cp $(ADDONSU_PREBUILTS_PATH)/updater-script-remove $(ADDONSU_REMOVE_OUT)/META-INF/com/google/android/updater-script
35 $(hide) (cd $(ADDONSU_REMOVE_OUT) && zip -qr $@ *)
36
37.PHONY: addonsu-remove
38addonsu-remove: $(ADDONSU_REMOVE_TARGET)
39 @echo "Done: $(ADDONSU_REMOVE_TARGET)"