blob: 8f963872dec65dd3a99655ac565d17b7abf5c250 [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)/
Christopher N. Hesse1f94c932018-06-11 21:56:24 +020018 $(hide) cp $(ADDONSU_PREBUILTS_PATH)/unmount-system.sh $(ADDONSU_INSTALL_OUT)/
Gabriele M5b33c6c2017-01-22 22:50:02 +010019 $(hide) cp $(ADDONSU_PREBUILTS_PATH)/updater-script-install $(ADDONSU_INSTALL_OUT)/META-INF/com/google/android/updater-script
20 $(hide) (cd $(ADDONSU_INSTALL_OUT) && zip -qr $@ *)
21
22.PHONY: addonsu
23addonsu: $(ADDONSU_INSTALL_TARGET)
24 @echo "Done: $(ADDONSU_INSTALL_TARGET)"
25
26
27ADDONSU_REMOVE_OUT := $(PRODUCT_OUT)/addonsu-remove/
Michael Bestasd67ef782017-04-28 23:55:07 +030028ADDONSU_REMOVE_TARGET := $(PRODUCT_OUT)/addonsu-remove-$(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR)-$(TARGET_ARCH).zip
Gabriele M5b33c6c2017-01-22 22:50:02 +010029
30$(ADDONSU_REMOVE_TARGET): $(ALL_MODULES.updater.BUILT)
31 $(hide) rm -rf $@ $(ADDONSU_REMOVE_OUT)
32 $(hide) mkdir -p $(ADDONSU_REMOVE_OUT)/META-INF/com/google/android/
33 $(hide) cp $(ALL_MODULES.updater.BUILT) $(ADDONSU_REMOVE_OUT)/META-INF/com/google/android/update-binary
34 $(hide) cp $(ADDONSU_PREBUILTS_PATH)/mount-system.sh $(ADDONSU_REMOVE_OUT)/
Christopher N. Hesse1f94c932018-06-11 21:56:24 +020035 $(hide) cp $(ADDONSU_PREBUILTS_PATH)/unmount-system.sh $(ADDONSU_REMOVE_OUT)/
Gabriele M5b33c6c2017-01-22 22:50:02 +010036 $(hide) cp $(ADDONSU_PREBUILTS_PATH)/updater-script-remove $(ADDONSU_REMOVE_OUT)/META-INF/com/google/android/updater-script
37 $(hide) (cd $(ADDONSU_REMOVE_OUT) && zip -qr $@ *)
38
39.PHONY: addonsu-remove
40addonsu-remove: $(ADDONSU_REMOVE_TARGET)
41 @echo "Done: $(ADDONSU_REMOVE_TARGET)"