From 848412e1cdf3f78256feb8604957d2e38f2d8ca3 Mon Sep 17 00:00:00 2001 From: YZBruh Date: Tue, 9 Apr 2024 23:24:53 +0300 Subject: [PATCH] pmt: apply version 1.7.0 changes --- Makefile | 56 ++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 76a7690..0b650d5 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,6 @@ -include mka/config.mk - # By YZBruh -# Copyright 2024 YZBruh - Partition Manager +# Copyright 2024 YZBruh - Partition Backupper # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,29 +14,34 @@ include mka/config.mk # See the License for the specific language governing permissions and # limitations under the License. -# speficy -VERSION := 1.5.0 -VERSION_CODE := 150 +include config/env.mk + +# speficy {version} +VERSION := 1.7.0 +VERSION_CODE := 170 SOURCE_DIR := binary TARGET := pmt LANG := en ARCH := $(shell uname -m) CUR_DIR := $(shell pwd) -# code list +# sources SRCS := $(SOURCE_DIR)/$(TARGET).c SRCS += $(SOURCE_DIR)/error.c SRCS += $(SOURCE_DIR)/checkers.c -SRCS += $(SOURCE_DIR)/lister.c +SRCS += $(SOURCE_DIR)/listpart.c SRCS += $(SOURCE_DIR)/flash.c SRCS += $(SOURCE_DIR)/backup.c +SRCS += $(SOURCE_DIR)/docs.c +# objects OBJS := $(SOURCE_DIR)/$(TARGET).o OBJS += $(SOURCE_DIR)/error.o OBJS += $(SOURCE_DIR)/checkers.o -OBJS += $(SOURCE_DIR)/lister.o +OBJS += $(SOURCE_DIR)/listpart.o OBJS += $(SOURCE_DIR)/flash.o OBJS += $(SOURCE_DIR)/backup.o +OBJS += $(SOURCE_DIR)/docs.o OUT_DIR := $(CUR_DIR)/out BINARY_DIR := $(OUT_DIR)/binary @@ -48,10 +51,8 @@ PACKAGE_DIR := $(OUT_DIR)/package all: @printf " --- Building Partition Manager --- \n"; \ printf "Version: $(VERSION)\n"; \ - printf "Version code: $(VERSION_CODE)\n"; \ - printf " \n"; \ - printf " ------------------------------------- \n"; \ - printf " \n"; \ + printf "Version code: $(VERSION_CODE)\n\n"; \ + printf " ------------------------------------- \n\n"; \ printf "Starting build... Please waith.\n"; \ sleep 2; \ printf "Make running with silent mode...\n"; \ @@ -93,13 +94,15 @@ help: @printf " --------- Partition Manager help ---------\n"; \ printf " \n"; \ printf " Commands;\n"; \ - printf " make ==> Build Partition Manager\n"; \ - printf " make clean ==> Clear files (Builded binaries are not deleted)\n"; \ - printf " make clean-all ==> Clear files (Builded binaries are deleted)\n"; \ - printf " make install-termux ==> If you are using termux, it installs the compiled pmt into termux. So it allows you to use it like a normal command.\n"; \ - printf " make help ==> Display help message\n"; \ + printf " make ==> Build Partition Manager\n"; \ + printf " make clean ==> Clear files (Builded binaries are not deleted)\n"; \ + printf " make clean-all ==> Clear files (Builded binaries are deleted)\n"; \ + printf " make install-termux ==> If you are using termux, it installs the compiled pmt into termux. So it allows you to use it like a normal command.\n"; \ + printf " make uninstall-termux ==> If you are using termux, it uninstalls the compiled pmt into termux. So it allows you to use it like a normal command.\n"; \ + printf " make help ==> Display help message\n"; \ printf " \n"; +# installer .PHONY: install-termux install-termux: @if [ -f /data/data/com.termux/files/usr/bin/termux-open ]; then \ @@ -109,8 +112,21 @@ install-termux: cp $(BINARY_DIR)/pmt /data/data/com.termux/files/usr/bin/pmt || exit 1; \ chmod 777 /data/data/com.termux/files/usr/bin/pmt || exit 1; \ printf " \n"; \ - printf "Success.\n"; \ - printf " \n"; \ + printf "Success.\n\n"; \ + else \ + printf "This function is only available on Termux Android devices using aarch64 (64-bit) and armv7l (32-bit)\n"; \ + fi + +# uninstaller +.PHONY: uninstall-termux +uninstall-termux: + @if [ -f /data/data/com.termux/files/usr/bin/termux-open ]; then \ + printf " ------------------------------------- \n"; \ + printf " pmt uninstaller \n"; \ + printf " ------------------------------------- \n"; \ + rm /data/data/com.termux/files/usr/bin/pmt || exit 1; \ + printf " \n"; \ + printf "Success.\n\n"; \ else \ printf "This function is only available on Termux Android devices using aarch64 (64-bit) and armv7l (32-bit)\n"; \ fi