pmt: initial 2.9.1 update
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
[ ! "${THIS_IS}" = "main" ] \
|
||||
&& abort "The caller is not the main makefile. Something's wrong."
|
||||
|
||||
try_with="Try with force mode (FORCE_GEN=true)."
|
||||
|
||||
if [ "${NDK_PROG}" = "true" ]; then
|
||||
mfiles=("${SOURCE_DIR}/Android.mk" "${SOURCE_DIR}/Application.mk")
|
||||
else
|
||||
mfiles=("${OUT_DIR}/Makefile" "${SOURCE_DIR}/Makefile")
|
||||
fi
|
||||
|
||||
for mfile in ${mfiles[@]}; do
|
||||
|
||||
[ -f "${mfile}" ] && \
|
||||
if [ "${FORCE_GEN}" = "true" ]; then
|
||||
rm -f "${mfile}"
|
||||
else
|
||||
abort "$(output=$(dirname ${mfile}) && basename "${output}")/$(basename ${mfile}) exits."
|
||||
fi
|
||||
|
||||
done
|
||||
@@ -1,44 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
. build/bash/vars
|
||||
. build/bash/functions
|
||||
|
||||
[ ! "${THIS_IS}" = "main" ] \
|
||||
&& abort "The caller is not the main makefile. Something's wrong."
|
||||
|
||||
if [ "${NDK_PROG}" = "true" ]; then
|
||||
|
||||
[ "${UPDATE_MAKEFILES}" = "true" ] \
|
||||
|| print " - Removing Android.mk..." \
|
||||
&& print " - Removing Application.mk..."
|
||||
|
||||
rm -f ${SOURCE_DIR}/Application.mk \
|
||||
${SOURCE_DIR}/Android.mk
|
||||
|
||||
else
|
||||
|
||||
[ "${UPDATE_MAKEFILES}" = "true" ] \
|
||||
|| print " - Info: Main makefile won't be deleted." \
|
||||
&& print " - Removing output directory makefile..." \
|
||||
&& print " - Removing source directory makefile..."
|
||||
|
||||
rm -f ${SOURCE_DIR}/Makefile \
|
||||
${OUT_DIR}/Makefile
|
||||
|
||||
fi
|
||||
|
||||
[ "${UPDATE_MAKEFILES}" = "true" ] || print " - Success."
|
||||
@@ -1,37 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
function abort()
|
||||
{
|
||||
[ -n "${@}" ] \
|
||||
&& echo -e " - ${RED}${BOLD}Error:${BOLD_RESET}${RESET} ${@}"
|
||||
exit 1
|
||||
}
|
||||
|
||||
function read_file()
|
||||
{
|
||||
cat "${1}" >> "${2}" \
|
||||
|| abort "failed to read/write ${1}/${2}"
|
||||
}
|
||||
|
||||
function gen()
|
||||
{
|
||||
[ "${FORCE_GEN}" = "true" -a "${UPDATE_MAKEFILES}" = "true" ] \
|
||||
&& rm -f "${1}"
|
||||
touch "${1}" || abort "failed to generate: ${1}"
|
||||
}
|
||||
|
||||
function print() { echo -e "${@}"; }
|
||||
@@ -1,29 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
[ -z ${NDK_ROOT_DIR} ] \
|
||||
&& echo "Please set NDK_ROOT_DIR variable!" \
|
||||
&& exit 1
|
||||
|
||||
[ -z ${NDK_PROJECT_PATH} ] \
|
||||
&& echo "Please set NDK_PROJECT_PATH variable!" \
|
||||
&& exit 1
|
||||
|
||||
CXX_IS="${NDK_ROOT_DIR}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang++"
|
||||
CXX_VERS=$(${CXX_IS} --version | head -n 1)
|
||||
|
||||
mkdir -p ${NDK_PROJECT_PATH}/include/PartitionManager/generated
|
||||
echo -e "#define __NDK_CXX_VERSION__ \"${CXX_VERS}\"" > ${NDK_PROJECT_PATH}/include/PartitionManager/generated/clang-version.h
|
||||
@@ -1,66 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
. build/bash/vars
|
||||
. build/bash/functions
|
||||
|
||||
[ ! "${UPDATE_MAKEFILES}" = "true" ] \
|
||||
&& . build/bash/check-makefiles
|
||||
[ ! "${THIS_IS}" = "main" ] \
|
||||
&& abort "The caller is not the main makefile. Something's wrong."
|
||||
|
||||
if [ "${UPDATE_MAKEFILES}" = "true" ]; then
|
||||
GENR="Re-generating"
|
||||
else
|
||||
GENR="Generating"
|
||||
fi
|
||||
|
||||
if [ "${NDK_PROG}" = "true" ]; then
|
||||
|
||||
gen "${SOURCE_DIR}/Android.mk"
|
||||
gen "${SOURCE_DIR}/Application.mk"
|
||||
|
||||
else
|
||||
|
||||
gen "${CUR_DIR}/Makefile"
|
||||
gen "${OUT_DIR}/Makefile"
|
||||
gen "${SOURCE_DIR}/Makefile"
|
||||
|
||||
fi
|
||||
|
||||
if [ "${NDK_PROG}" = "true" ]; then
|
||||
|
||||
print " - ${GENR} Android.mk..."
|
||||
read_file "${OTHERS}/makefile.androidmk" "${SOURCE_DIR}/Android.mk"
|
||||
|
||||
print " - ${GENR} Application.mk"
|
||||
read_file "${OTHERS}/makefile.applicationmk" "${SOURCE_DIR}/Application.mk"
|
||||
|
||||
else
|
||||
|
||||
print " - Re-generating main makefile..."
|
||||
rm -f "${CUR_DIR}/Makefile"
|
||||
read_file "${OTHERS}/makefile.main" "${CUR_DIR}/Makefile"
|
||||
|
||||
print " - ${GENR} output directory makefile..."
|
||||
read_file "${OTHERS}/makefile.outdir" "${OUT_DIR}/Makefile"
|
||||
|
||||
print " - ${GENR} source directory makefile..."
|
||||
read_file "${OTHERS}/makefile.sourcedir" "${SOURCE_DIR}/Makefile"
|
||||
|
||||
fi
|
||||
|
||||
print " - Success."
|
||||
@@ -1,33 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
. build/bash/additional-vars
|
||||
|
||||
CUR_DIR=$(pwd)
|
||||
SOURCE_DIR=${CUR_DIR}/${SOURCE_DIRNAME}
|
||||
OUT_DIR=${CUR_DIR}/${OUT_DIRNAME}
|
||||
BUILD=${CUR_DIR}/build
|
||||
BASH_DIR=$(pwd)
|
||||
OTHERS=${BUILD}/others
|
||||
TOOLS=${BUILD}/tools
|
||||
|
||||
# font types, colors etc
|
||||
BOLD="\e[1m"
|
||||
BOLD_RESET="\e[0m"
|
||||
RESET="\033[0m"
|
||||
RED="\033[0;31m"
|
||||
GREEN="\033[0;32m"
|
||||
YELLOW="\033[0;33m"
|
||||
@@ -1 +0,0 @@
|
||||
INSTALL_SUCCESS := true
|
||||
@@ -1,66 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
include env.mk
|
||||
|
||||
#########################################
|
||||
# #
|
||||
# Apply Configuration #
|
||||
# #
|
||||
# Warning: please do not edit #
|
||||
# #
|
||||
#########################################
|
||||
|
||||
CXX = clang++
|
||||
AR = ar
|
||||
CXXFLAGS ?= \
|
||||
-O3 \
|
||||
-I../include \
|
||||
-std=c++20 \
|
||||
-Wall \
|
||||
-Wextra \
|
||||
-Werror \
|
||||
-Wno-vla-cxx-extension \
|
||||
-Wno-nullability-completeness \
|
||||
-Wno-writable-strings \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-unused-command-line-argument \
|
||||
-Wno-nullability-extension \
|
||||
-Wno-reorder-init-list \
|
||||
-Wno-gnu-zero-variadic-macro-arguments \
|
||||
$(PMT_EXTRA_CXXFLAGS)
|
||||
|
||||
# set compiler setting (clang and ar)
|
||||
ifneq ($(PMT_CXX),)
|
||||
CXX ?= $(PMT_CXX)
|
||||
endif
|
||||
|
||||
ifneq ($(PMT_AR),)
|
||||
AR ?= $(PMT_AR)
|
||||
endif
|
||||
|
||||
# compiler flags settings
|
||||
ifeq ($(PMT_ENABLE_DEBUG),true)
|
||||
CXXFLAGS += \
|
||||
-gdwarf-5 \
|
||||
-fsanitize=address
|
||||
endif
|
||||
|
||||
# write current env configuration to oldenv.mk
|
||||
all:
|
||||
@ echo "CXX := $(CXX)" > oldenv.mk
|
||||
@ echo "AR := $(AR)" >> oldenv.mk
|
||||
@ echo "CXXFLAGS := $(CXXFLAGS)" >> oldenv.mk
|
||||
@@ -1 +0,0 @@
|
||||
UNINSTALLED_SUCCESS :=
|
||||
@@ -18,21 +18,15 @@
|
||||
# #
|
||||
# Configuration Flags #
|
||||
# #
|
||||
# Warning: you can edit #
|
||||
# you can edit #
|
||||
# #
|
||||
#########################################
|
||||
|
||||
# speficy c++ compiler (cxx)
|
||||
PMT_CXX ?=
|
||||
|
||||
# speficy ar
|
||||
PMT_AR ?=
|
||||
|
||||
# addionital compiler flags
|
||||
PMT_EXTRA_CXXFLAGS ?=
|
||||
|
||||
# debugging mode (binary). it's enabling address sanitizer and source level debug information with dwarf version 5
|
||||
PMT_ENABLE_DEBUG ?=
|
||||
PMT_ENABLE_DEBUG ?= true
|
||||
|
||||
#########################################
|
||||
#########################################
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
Source: pmt
|
||||
Package: pmt
|
||||
Version: 2.8.0
|
||||
Architecture: arm
|
||||
Description: pmt is for reading, writing and formatting partitions of android devices
|
||||
Section: misc
|
||||
Priority: optional
|
||||
Maintainer: YZBruh <yagizzengin73@gmail.com>
|
||||
Standards-Version: 4.5.0
|
||||
@@ -1,9 +0,0 @@
|
||||
Source: pmt
|
||||
Package: pmt
|
||||
Version: 2.8.0
|
||||
Architecture: aarch64
|
||||
Description: pmt is for reading, writing and formatting partitions of android devices
|
||||
Section: misc
|
||||
Priority: optional
|
||||
Maintainer: YZBruh <yagizzengin73@gmail.com>
|
||||
Standards-Version: 4.5.0
|
||||
@@ -1,99 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
#####
|
||||
# sub-make for making deb package
|
||||
#####
|
||||
|
||||
THIS_IS := debutils
|
||||
|
||||
# include needed variables
|
||||
include ../../Makefile.inc
|
||||
|
||||
TEMP_DIR := $(DEBUTILS_DIR)/template
|
||||
|
||||
ifeq ($(FOR_THIS),64)
|
||||
DEB_ARCH_NAME := arm64-v8a
|
||||
else ifeq ($(FOR_THIS),32)
|
||||
DEB_ARCH_NAME := armeabi-v7a
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard /dev/block/by-name),)
|
||||
SUDO := su -c
|
||||
else ifeq ($(wildcard /system/build.prop),)
|
||||
SUDO := sudo
|
||||
else
|
||||
SUDO :=
|
||||
endif
|
||||
|
||||
PROGRESS_LIST := \
|
||||
startup \
|
||||
$(DEB_CHECKS) \
|
||||
check_binary \
|
||||
prepare \
|
||||
make_debian_pack
|
||||
|
||||
# make deb package
|
||||
all: $(PROGRESS_LIST)
|
||||
|
||||
startup:
|
||||
$(E) " --------- Making deb package --------- "
|
||||
@ rm -rf $(TEMP_DIR)
|
||||
$(E) " - Checking files and directories (only neededs)..."
|
||||
|
||||
prepare:
|
||||
$(E) " - Copying files..."
|
||||
@ cp -r $(DEBUTILS_DIR)/data $(TEMP_DIR) || exit 1
|
||||
@ rm -f $(DEBTERMUX_USR)/share/man/man8/dummy
|
||||
@ rm -f $(DEBTERMUX_USR)/bin/dummy
|
||||
@ mkdir $(TEMP_DIR)/DEBIAN
|
||||
|
||||
check_binary:
|
||||
@ if [ ! -f "$(BINARY_DIR)/$(TARGET)" ]; then \
|
||||
$(E_NS) " - $(TARGET) not builded! Please build and retry."; \
|
||||
exit 1; \
|
||||
fi
|
||||
$(E) " - Generating template directory..."
|
||||
@ mkdir $(TEMP_DIR)
|
||||
$(E) " - Generating debian package directory..."
|
||||
@ mkdir $(DEB_DIR)
|
||||
|
||||
make_debian_pack:
|
||||
@ abort() { \
|
||||
[ -d $(TEMP_DIR) ] \
|
||||
&& rm -rf $(TEMP_DIR); \
|
||||
[ -d $(DEB_DIR) ] \
|
||||
&& rm -rf $(DEB_DIR); \
|
||||
exit 1; \
|
||||
}; \
|
||||
if [ ! "$(FOR_THIS)" = "64" ] && [ ! "$(FOR_THIS)" = "32" ]; then \
|
||||
$(E_NS) " - Invalid arch number: $(FOR_THIS) [maybe null]" && abort; \
|
||||
fi; \
|
||||
$(E_NS) " - Selected arm-$(FOR_THIS) package control file."; \
|
||||
cp $(DEBUTILS_DIR)/DEBIAN/control_$(FOR_THIS) $(TEMP_DIR)/DEBIAN/control || abort; \
|
||||
cp $(DEBUTILS_DIR)/mandoc/$(TARGET).8.gz $(DEBTERMUX_USR)/share/man/man8 || abort; \
|
||||
cp $(BINARY_DIR)/$(TARGET) $(DEBTERMUX_USR)/bin || abort; \
|
||||
$(E_NS) " - Starting dpkg-deb..."; \
|
||||
sleep 2; \
|
||||
$(SUDO) chmod -R 755 *; \
|
||||
dpkg-deb -Z xz -b $(TEMP_DIR) $(DEB_DIR)/$(TARGET)-$(DEB_ARCH_NAME).deb || abort; \
|
||||
rm -rf $(TEMP_DIR); \
|
||||
$(E_NS) " - Done!"
|
||||
|
||||
$(DEBUTILS_DIR)/%:
|
||||
@ [ ! -e "$@" ] && $(E_NS) " - Check failed! Not found: $@" && exit 1
|
||||
|
||||
# end
|
||||
Binary file not shown.
147
build/main.mk
147
build/main.mk
@@ -1,147 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
UPDATE_MAKEFILES = false
|
||||
CLS_ADTS := rm -f $(BUILD)/bash/additional-vars
|
||||
|
||||
all: getvars
|
||||
$(MAKE_HIDE) $(SILENT) -C $(BUILD)/config $$(cat $(BUILD)/goals.txt) || exit 1
|
||||
@ rm -f $(BUILD)/goals.txt
|
||||
$(MAKE_HIDE) $(SILENT) -C $(SOURCE_DIRNAME) INC_OLDENV=true || exit 1
|
||||
|
||||
getvars:
|
||||
@ touch $(BUILD)/goals.txt
|
||||
@ $(foreach var,$(sort $(.VARIABLES)),\
|
||||
$(if $(filter command line,$(origin $(var))), \
|
||||
echo "$(var)=$($(var))" >> goals.txt;))
|
||||
|
||||
.PHONY: rebuild
|
||||
rebuild:
|
||||
$(MAKE_HIDE) $(SILENT) clean
|
||||
$(E)
|
||||
$(MAKE_HIDE) $(SILENT)
|
||||
|
||||
# cleaner functions
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(E) "Cleaning directories..."
|
||||
@ if [ -d $(BINARY_DIR) ]; then \
|
||||
$(E_NS) "==> $(OUT_DIRNAME)/`basename $(BINARY_DIR)`"; \
|
||||
fi
|
||||
@ if [ -d $(PACKAGE_DIR) ]; then \
|
||||
$(E_NS) "==> $(OUT_DIRNAME)/`basename $(PACKAGE_DIR)`"; \
|
||||
fi
|
||||
@ if [ -d $(DEB_DIR) ]; then \
|
||||
$(E_NS) "==> $(OUT_DIRNAME)/`basename $(DEB_DIR)`"; \
|
||||
fi
|
||||
@ rm -rf $(IN_OUT_DIR)
|
||||
@ rm -rf $(DEB_DIR)
|
||||
@ sleep 2
|
||||
$(MAKE_HIDE) $(SILENT) -C $(SOURCE_DIRNAME) clean INC_OLDENV=false || exit 1
|
||||
@ sleep 1
|
||||
$(E) "Success."
|
||||
|
||||
# helper function
|
||||
.PHONY: help
|
||||
help:
|
||||
$(E) " ------- Partition Manager help ------- " \
|
||||
&& $(E_NS)
|
||||
$(E) " Commands:"
|
||||
$(E) " $(MAKE) ==> Build Partition Manager."
|
||||
$(E) " $(MAKE) deb ==> Generate debian package for termux."
|
||||
$(E) " $(MAKE) clean ==> Clear builded binary."
|
||||
$(E) " $(MAKE) rebuild ==> Re-build Partition Manager (clean and make)."
|
||||
$(E) " $(MAKE) install ==> It installs $(TARGET) into termux."
|
||||
$(E) " $(MAKE) uninstall ==> It uninstalls $(TARGET) into termux."
|
||||
$(E) " $(MAKE) reinstall ==> It uninstall and reinstalls $(TARGET)."
|
||||
$(E) " $(MAKE) gen-makefiles ==> Generate makefiles for build."
|
||||
$(E) " $(MAKE) gen-ndk-makefiles ==> Generate NDK makefiles for build."
|
||||
$(E) " $(MAKE) clean-makefiles ==> Cleanup makefiles."
|
||||
$(E) " $(MAKE) clean-ndk-makefiles ==> Cleanup NDK makefiles."
|
||||
$(E) " $(MAKE) update-makefiles ==> Re-generate makefiles."
|
||||
$(E) " $(MAKE) update-ndk-makefiles ==> Re-generate NDK makefiles."
|
||||
$(E) " $(MAKE) help ==> Display this help message." && $(E_NS)
|
||||
|
||||
# deb maker
|
||||
.PHONY: deb
|
||||
deb:
|
||||
$(MAKE_HIDE) $(SILENT) -C $(DEBUTILS_DIR) -f deb.mk FOR_THIS=$(FOR_THIS) || exit 1
|
||||
@ $(P) ""
|
||||
|
||||
# install pmt in to termux
|
||||
.PHONY: install
|
||||
install:
|
||||
$(eval PROG := $@)
|
||||
$(MAKE_HIDE) $(SILENT) -C $(OUT_DIRNAME) install PROG=$(PROG) || exit 1
|
||||
|
||||
# uninstall pmt in to termux
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
$(eval PROG := $@)
|
||||
$(MAKE_HIDE) $(SILENT) -C $(OUT_DIRNAME) uninstall PROG=$(PROG) || exit 1
|
||||
|
||||
.PHONY: reinstall
|
||||
reinstall:
|
||||
$(MAKE_HIDE) $(SILENT) uninstall
|
||||
$(MAKE_HIDE) $(SILENT) install
|
||||
|
||||
# clean ndk makefiles
|
||||
.PHONY: gen-ndk-makefiles
|
||||
gen-ndk-makefiles:
|
||||
$(eval NDK_PROG = true)
|
||||
$(call save-gen-vars)
|
||||
$(call gen-ndk-mfiles)
|
||||
@ $(CLS_ADTS)
|
||||
|
||||
.PHONY: gen-makefiles
|
||||
gen-makefiles:
|
||||
$(call save-gen-vars)
|
||||
$(call gen-mfiles)
|
||||
@ $(CLS_ADTS)
|
||||
|
||||
.PHONY: update-ndk-makefiles
|
||||
update-ndk-makefiles:
|
||||
$(E) " ------ Updating NDK makefiles ------ "
|
||||
$(eval NDK_PROG = true)
|
||||
$(eval UPDATE_MAKEFILES = true)
|
||||
$(call save-gen-vars)
|
||||
$(call clean-ndk-mfiles)
|
||||
$(call gen-ndk-mfiles)
|
||||
@ $(CLS_ADTS)
|
||||
|
||||
.PHONY: update-makefiles
|
||||
update-makefiles:
|
||||
$(E) " ------ Updating makefiles ------ "
|
||||
$(eval UPDATE_MAKEFILES = true)
|
||||
$(call save-gen-vars)
|
||||
$(call clean-ndk-mfiles)
|
||||
$(call gen-mfiles)
|
||||
@ $(CLS_ADTS)
|
||||
|
||||
.PHONY: clean-ndk-makefiles
|
||||
clean-ndk-makefiles:
|
||||
$(eval NDK_PROG = true)
|
||||
$(call save-gen-vars)
|
||||
$(call clean-ndk-mfiles)
|
||||
@ $(CLS_ADTS)
|
||||
|
||||
.PHONY: clean-makefiles
|
||||
clean-makefiles:
|
||||
$(call save-gen-vars)
|
||||
$(call clean-mfiles)
|
||||
@ $(CLS_ADTS)
|
||||
|
||||
# end
|
||||
154
build/mandoc/mandoc
Executable file
154
build/mandoc/mandoc
Executable file
@@ -0,0 +1,154 @@
|
||||
.\" By YZBruh
|
||||
|
||||
.\" Copyright 2024 Partition Manager
|
||||
.\"
|
||||
.\" Licensed under the Apache License, Version 2.0 (the "License");
|
||||
.\" you may not use this file except in compliance with the License.
|
||||
.\" You may obtain a copy of the License at
|
||||
.\"
|
||||
.\" http://www.apache.org/licenses/LICENSE-2.0
|
||||
.\"
|
||||
.\" Unless required by applicable law or agreed to in writing, software
|
||||
.\" distributed under the License is distributed on an "AS IS" BASIS,
|
||||
.\" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
.\" See the License for the specific language governing permissions and
|
||||
.\" limitations under the License.
|
||||
.\"
|
||||
.TH "PMT" "8" "September 2024" "PMT 2.9.0" "Partition Manager"
|
||||
.SH NAME
|
||||
.B pmt
|
||||
\- Android Partition Manager Tool
|
||||
.SH SYNOSIS
|
||||
.B pmt
|
||||
[
|
||||
.I {OPTIONS}
|
||||
.B backup
|
||||
.I PARTITION {OUTPUT} {OPTIONS}...
|
||||
]
|
||||
[
|
||||
.I {OPTIONS}
|
||||
.B flash
|
||||
.I PARTITION FILE {OPTIONS}...
|
||||
]
|
||||
[
|
||||
.I {OPTIONS}
|
||||
.B format
|
||||
.I PARTITION FILE_SYSTEM{ext/2/3/4} {OPTIONS}...
|
||||
]
|
||||
[
|
||||
.I {OPTIONS}
|
||||
.B partition-size
|
||||
.I PARTITION {OPTIONS}...
|
||||
]
|
||||
[
|
||||
.B \-l
|
||||
|
|
||||
.B \-\-logical
|
||||
]
|
||||
[
|
||||
.B \-P
|
||||
|
|
||||
.B \-\-search\-path
|
||||
.I search\-path
|
||||
]
|
||||
[
|
||||
.B \-p
|
||||
|
|
||||
.B \-\-list
|
||||
]
|
||||
[
|
||||
.B \-s
|
||||
|
|
||||
.B \-\-silent
|
||||
]
|
||||
[
|
||||
.B \-V
|
||||
|
|
||||
.B \-\-verbose
|
||||
]
|
||||
[
|
||||
.B \-f
|
||||
|
|
||||
.B \-\-force
|
||||
]
|
||||
[
|
||||
.B \-S
|
||||
|
|
||||
.B \-\-set\-language
|
||||
]
|
||||
[
|
||||
.B \-v
|
||||
|
|
||||
.B \-\-version
|
||||
]
|
||||
[
|
||||
.B \-\-help
|
||||
]
|
||||
.SH DESCRIPTION
|
||||
.B pmt
|
||||
is a tool made to read android parts, make flash and format. Written with C++ language. It was first created as only a hobby but subsequently serialized
|
||||
.PP
|
||||
.SH OPTIONS
|
||||
.sp
|
||||
\fB\-l\fP, \fB\-\-logical\fP
|
||||
.RS 4
|
||||
It is meant to determine whether the target partition is logical.
|
||||
.RE
|
||||
.sp
|
||||
\fB\-c\fP, \fB\-\-context\fP
|
||||
.RS 4
|
||||
It is meant to specify a custom /dev context. Only classic partitions (default: /dev/block/by-name)
|
||||
.RE
|
||||
.sp
|
||||
\fB\-p\fP, \fB\-\-list\fP
|
||||
.RS 4
|
||||
List partitions.
|
||||
.RE
|
||||
.sp
|
||||
\fB\-s\fP, \fB\-\-silent\fP
|
||||
.RS 4
|
||||
Information and warning messages are silenced in normal work.
|
||||
.RE
|
||||
.sp
|
||||
\fB\-V\fP, \fB\-\-verbose
|
||||
.RS 4
|
||||
Verbose mode. Print detailed informations etc.
|
||||
.RE
|
||||
.sp
|
||||
\fB\-f\fP, \fB\-\-force\fP
|
||||
.RS 4
|
||||
Force mode. Some things are ignored.
|
||||
.RE
|
||||
.sp
|
||||
\fB\-S\fP, \fB\-\-set\-language\fP
|
||||
.RS 4
|
||||
Set current language.
|
||||
.RE
|
||||
.sp
|
||||
\fB\-v\fP, \fB\-\-version\fP
|
||||
.RS 4
|
||||
See version info.
|
||||
.RE
|
||||
.sp
|
||||
\fB\-\-help\fP
|
||||
.RS 4
|
||||
See help message.
|
||||
.SH EXAMPLES
|
||||
.B pmt
|
||||
backup boot_a -c /dev/block/platform/bootdevice/by-name
|
||||
.sp
|
||||
.B pmt
|
||||
flash boot_a /sdcard/twrp/boot.img -c /dev/block/platform/bootdevice/by-name
|
||||
.sp
|
||||
.B pmt
|
||||
format system_a ext4 --logical
|
||||
.sp
|
||||
.B pmt
|
||||
-c /dev/block/platform/bootdevice/by-name --list
|
||||
.SH AUTHOR
|
||||
This version of
|
||||
.B pmt
|
||||
has been written by YZBruh <github.com/YZBruh>
|
||||
.SH BUGS
|
||||
Report bugs to <t.me/ShawkTeam | Topics | pmt>
|
||||
.PP
|
||||
@@ -1,64 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
########
|
||||
# 2.8.0
|
||||
########
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(LOCAL_PATH)/../build/config/env.mk
|
||||
|
||||
PMT_CXXFLAGS = \
|
||||
-O3 \
|
||||
-std=c++14 \
|
||||
-Wall \
|
||||
-Wextra \
|
||||
-Werror \
|
||||
-Wno-vla-cxx-extension \
|
||||
-Wno-nullability-completeness \
|
||||
-Wno-writable-strings \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-unused-command-line-argument \
|
||||
-Wno-nullability-extension \
|
||||
-Wno-reorder-init-list \
|
||||
-Wno-gnu-zero-variadic-macro-arguments \
|
||||
-D__NDK_BUILD \
|
||||
$(PMT_EXTRA_CXXFLAGS)
|
||||
|
||||
ifneq ($(PMT_ENABLE_DEBUG),)
|
||||
PMT_CXXFLAGS += -gdwarf-5 -fsanitize=address
|
||||
endif
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := pmt
|
||||
LOCAL_SRC_FILES := \
|
||||
Debug.cpp \
|
||||
Root.cpp \
|
||||
PartitionManager.cpp \
|
||||
PartitionTool.cpp \
|
||||
ListPartitions.cpp \
|
||||
Version.cpp \
|
||||
GetState.cpp \
|
||||
Tools.cpp \
|
||||
LanguageTools.cpp \
|
||||
Languages.cpp \
|
||||
Help.cpp
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include
|
||||
LOCAL_CFLAGS := $(PMT_CXXFLAGS)
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
||||
@@ -1,30 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
########
|
||||
# 2.8.0
|
||||
########
|
||||
|
||||
# architecture
|
||||
APP_ABI := \
|
||||
arm64-v8a \
|
||||
armeabi-v7a
|
||||
|
||||
APP_PLATFORM := android-21
|
||||
APP_OPTIM := release
|
||||
APP_STL := c++_static
|
||||
|
||||
# end
|
||||
@@ -1,26 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
THIS_IS = main
|
||||
NDK_PROG ?= false
|
||||
FORCE_GEN ?= false
|
||||
|
||||
# include needed variables
|
||||
include Makefile.inc
|
||||
include $(TOOLS)/gen-makefiles.mk
|
||||
include $(TOOLS)/clean-makefiles.mk
|
||||
|
||||
include $(BUILD)/main.mk
|
||||
@@ -1,152 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
#####
|
||||
# sub-make for installing-uninstalling
|
||||
#####
|
||||
|
||||
THIS_IS := out
|
||||
|
||||
# include needed variables
|
||||
include ../Makefile.inc
|
||||
-include $(BUILD)/config/INS_STAT.mk
|
||||
-include $(BUILD)/config/UNINS_STAT.mk
|
||||
|
||||
INSTALL_PROGRESS_LIST := \
|
||||
really_termux \
|
||||
welcome \
|
||||
check_ins_stat \
|
||||
deb_installer \
|
||||
really_builded \
|
||||
install_binary
|
||||
|
||||
UNINSTALL_PROGRESS_LIST := \
|
||||
really_termux \
|
||||
welcome \
|
||||
check_unins_stat \
|
||||
uninstall_$(TARGET)
|
||||
|
||||
# create an empty target
|
||||
all:
|
||||
$(P) ""
|
||||
|
||||
# installer
|
||||
.PHONY: install
|
||||
install: $(INSTALL_PROGRESS_LIST)
|
||||
|
||||
# uninstaller
|
||||
.PHONY: uninstall
|
||||
uninstall: $(UNINSTALL_PROGRESS_LIST)
|
||||
|
||||
install_binary:
|
||||
$(E) " - Installing binary..."
|
||||
if cp $(BINARY_DIR)/$(TARGET) /data/data/com.termux/files/usr/bin/$(TARGET); then \
|
||||
$(E_NS) " - Setting up permissions..."; \
|
||||
else \
|
||||
$(E_NS) "INSTALL_SUCCESS := false" > $(BUILD)/config/INS_STAT.mk; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
if chmod 777 $(TERMUX_BIN)/$(TARGET); then \
|
||||
$(E_NS) " - Saving current status..."; \
|
||||
$(E_NS) "INSTALL_SUCCESS := true" > $(BUILD)/config/INS_STAT.mk; \
|
||||
else \
|
||||
$(E_NS) "INSTALL_SUCCESS := false" > $(BUILD)/config/INS_STAT.mk; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
$(P) " - Success.\n\n"; \
|
||||
$(E_NS) "INSTALL_SUCCESS := true" > $(BUILD)/config/INS_STAT.mk; \
|
||||
$(E_NS) "UNINSTALLED_SUCCESS := " > $(BUILD)/config/UNINS_STAT.mk
|
||||
@ exit 0
|
||||
|
||||
uninstall_$(TARGET):
|
||||
if [ -f $(TERMUX_USR)/share/man/man8/$(TARGET).8.gz ]; then \
|
||||
$(E_NS) " - It was found to be established by $(TARGET)'s deb pack. It's removed with apt..."; \
|
||||
apt remove -y $(TARGET) || exit 1; \
|
||||
$(P) " - Success.\n\n"; \
|
||||
$(E_NS) "UNINSTALLED_SUCCESS := true" > $(BUILD)/config/UNINS_STAT.mk; \
|
||||
$(E_NS) "INSTALL_SUCCESS := " > $(BUILD)/config/INS_STAT.mk; \
|
||||
else \
|
||||
$(E_NS) " - It was found that pmt was manually established (with this makefile or copying). Manually removed..."; \
|
||||
if rm $(TERMUX_BIN)/$(TARGET); then \
|
||||
$(P) " - Success.\n\n"; \
|
||||
$(E_NS) "UNINSTALLED_SUCCESS := true" > $(BUILD)/config/UNINS_STAT.mk; \
|
||||
$(E_NS) "INSTALL_SUCCESS := " > $(BUILD)/config/INS_STAT.mk; \
|
||||
else \
|
||||
$(E_NS) "UNINSTALLED_SUCCESS := false" > $(BUILD)/config/UNINS_STAT.mk; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
deb_installer:
|
||||
if [ -f $(DEB_DIR)/*.deb ]; then \
|
||||
$(E_NS) " - The created deb pack was found. It's setup..."; \
|
||||
cd $(DEB_DIR) || exit 1; \
|
||||
apt install ./*.deb || exit 1; \
|
||||
if [ ! "$?" = "0" ]; then \
|
||||
cd $(CUR_DIR); \
|
||||
$(P) " - Success.\n\n"; \
|
||||
$(E_NS) "INSTALL_SUCCESS := true" > $(BUILD)/config/INS_STAT.mk; \
|
||||
$(E_NS) "UNINSTALLED_SUCCESS := " > $(BUILD)/config/UNINS_STAT.mk; \
|
||||
cd ..; \
|
||||
exit 0; \
|
||||
else \
|
||||
cd $(CUR_DIR); \
|
||||
$(P) " - $(RED)$(BOLD)Error:$(BOLD_RESET)$(RESET) installing failed!\n"; \
|
||||
$(E_NS) "INSTALL_SUCCESS := false" > $(BUILD)/config/INS_STAT.mk; \
|
||||
cd ..; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
check_ins_stat:
|
||||
@ if [ ! "$(INSTALL_SUCCESS)" = "true" ] && [ ! "$(INSTALL_SUCCESS)" = "" ]; then \
|
||||
$(P) " - $(YELLOW)$(BOLD)Warning:$(BOLD_RESET)$(RESET) a previously-stayed failed installation process found\n"; \
|
||||
fi
|
||||
|
||||
check_unins_stat:
|
||||
@ if [ ! "$(UNINSTALL_SUCCESS)" = "true" ] && [ ! "$(UNINSTALL_SUCCESS)" = "" ]; then \
|
||||
$(P) " - $(YELLOW)$(BOLD)Warning:$(BOLD_RESET)$(RESET) a previously-stayed failed uninstallation process found\n"; \
|
||||
fi
|
||||
|
||||
welcome:
|
||||
$(E) " ----------- $(TARGET) $(PROG)er ----------- "
|
||||
@ if [ "$(PROG)" = "uninstall" ]; then \
|
||||
if [ ! -f $(TERMUX_BIN)/$(TARGET) ]; then \
|
||||
$(E_NS) " - $(TARGET) already $(PROG)ed"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi
|
||||
@ if [ "$(PROG)" = "install" ]; then \
|
||||
if [ -f $(TERMUX_BIN)/$(TARGET) ]; then \
|
||||
$(E_NS) " - $(TARGET) already $(PROG)ed"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
really_termux:
|
||||
@ if [ ! -f $(TERMUX_BIN)/termux-open ]; then \
|
||||
$(P) "$(RED)$(BOLD)Error:$(BOLD_RESET)$(RESET) This function is only available on Termux.\n"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
really_builded:
|
||||
if [ ! -f $(BINARY_DIR)/$(TARGET) ]; then \
|
||||
$(P) " - $(RED)$(BOLD)Error:$(BOLD_RESET)$(RESET) Package not builded! Please build package and try again \n"; \
|
||||
$(E_NS) "INSTALL_SUCCESS := false" > $(BUILD)/config/INS_STAT.mk; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
# end
|
||||
@@ -1,182 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
#####
|
||||
# sub-make for building package
|
||||
#####
|
||||
|
||||
THIS_IS = src
|
||||
|
||||
include ../Makefile.inc
|
||||
|
||||
ifeq ($(INC_OLDENV),true)
|
||||
include $(BUILD)/config/oldenv.mk
|
||||
endif
|
||||
|
||||
INCLUDE_DIR := $(realpath ../include)
|
||||
PMT_INCDIR := $(INCLUDE_DIR)/pmt
|
||||
|
||||
# the presence of all source files that are on this list will be checked
|
||||
SRCS_REQ := \
|
||||
place-holder/Debug.cpp \
|
||||
place-holder/Help.cpp \
|
||||
place-holder/GetState.cpp \
|
||||
place-holder/LanguageTools.cpp \
|
||||
place-holder/Languages.cpp \
|
||||
place-holder/PartitionTool.cpp \
|
||||
place-holder/PartitionManager.cpp \
|
||||
place-holder/Root.cpp \
|
||||
place-holder/Tools.cpp \
|
||||
place-holder/Version.cpp
|
||||
|
||||
# objects to be used when executable file is created
|
||||
OBJS_EXEC := \
|
||||
$(SOURCE_DIR)/PartitionManager.o \
|
||||
$(SOURCE_DIR)/Help.o \
|
||||
$(SOURCE_DIR)/Version.o \
|
||||
$(SOURCE_DIR)/GetState.o \
|
||||
$(SOURCE_DIR)/Tools.o \
|
||||
$(SOURCE_DIR)/Languages.o \
|
||||
$(SOURCE_DIR)/LanguageTools.o
|
||||
|
||||
HEADERS_REQ := \
|
||||
$(PMT_INCDIR)/PartitionManager/Deprecates.h \
|
||||
$(PMT_INCDIR)/PartitionManager/HelpFn.h \
|
||||
$(PMT_INCDIR)/PartitionManager/PartitionManager.h \
|
||||
$(PMT_INCDIR)/PartitionManager/StringKeys.h \
|
||||
$(PMT_INCDIR)/PartitionManager/VersionFnVars.h
|
||||
|
||||
PROGRESS_LIST := \
|
||||
welcome \
|
||||
wait \
|
||||
$(SRCS_REQ) \
|
||||
$(HEADERS_REQ) \
|
||||
pr_obj \
|
||||
$(OBJS) \
|
||||
make_outdirs \
|
||||
pr_sts \
|
||||
$(STATIC_LIBS) \
|
||||
make_executable \
|
||||
wait \
|
||||
end_progress
|
||||
|
||||
# all target for building
|
||||
all: $(PROGRESS_LIST)
|
||||
|
||||
welcome:
|
||||
@ rm -f $(BUILD)/config/oldenv.mk
|
||||
@ echo " ---- Partition Manager Builder ---- " \
|
||||
&& $(E_NS)
|
||||
$(E) " - Version: $(VERSION)"
|
||||
$(E) " - Version code: $(VERSION_CODE)" \
|
||||
&& $(E_NS)
|
||||
$(E) " -------------------------------- " \
|
||||
&& $(E_NS)
|
||||
$(E) " - Checking required source files..."
|
||||
|
||||
pr_obj:
|
||||
$(E) " - Building objects..."
|
||||
|
||||
pr_sts:
|
||||
$(E) " - Making static libraries..."
|
||||
|
||||
wait:
|
||||
@ sleep 2
|
||||
|
||||
make_outdirs:
|
||||
@ rm -rf $(IN_OUT_DIR)
|
||||
@ mkdir -p $(BINARY_DIR)
|
||||
@ mkdir -p $(PACKAGE_DIR)
|
||||
@ mkdir -p $(STATICLIB_DIR)
|
||||
|
||||
place-holder/%.cpp:
|
||||
$(E) " CHK $(SOURCE_DIRNAME)/`basename $@`"
|
||||
@ if [ ! -f "$(SOURCE_DIR)/`basename $@`" ]; then \
|
||||
$(E_NS) " ==> Couldn't found required source file: $(SOURCE_DIRNAME)/`basename $@`"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
$(PMT_INCDIR)/%.h:
|
||||
$(E) " CHK include/PartitionManager/`basename $@`"
|
||||
@ if [ ! -f "$(INCLUDE_DIR)/PartitionManager/`basename $@`" ]; then \
|
||||
$(E_NS) " ==> Couldn't found required header file: include/PartitionManager/`basename $@`"; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
$(SOURCE_DIR)/%.o: $(SOURCE_DIR)/%.cpp
|
||||
$(E) " CXX $(SOURCE_DIRNAME)/`basename $@`"
|
||||
@ $(CXX) -x c++ $(CXXFLAGS) -c "$<" || exit 1
|
||||
|
||||
pmt_root:
|
||||
$(E) " AR lib$@.a"
|
||||
@ $(AR) rcs "lib$@.a" "$(SOURCE_DIR)/Root.o"
|
||||
|
||||
pmt_debug:
|
||||
$(E) " AR lib$@.a"
|
||||
@ $(AR) rcs "lib$@.a" "$(SOURCE_DIR)/Debug.o"
|
||||
|
||||
pmt_listpartitions:
|
||||
$(E) " AR lib$@.a"
|
||||
@ $(AR) rcs "lib$@.a" "$(SOURCE_DIR)/ListPartitions.o"
|
||||
|
||||
pmt_partitiontool:
|
||||
$(E) " AR lib$@.a"
|
||||
@ $(AR) rcs "lib$@.a" "$(SOURCE_DIR)/PartitionTool.o"
|
||||
|
||||
make_executable:
|
||||
$(E) " - Making executable file..."
|
||||
$(E) " LD $(TARGET)"
|
||||
@ $(CXX) $(CXXFLAGS) -L$(SOURCE_DIR) $(foreach st,$(STATIC_LIBS),$(shell echo -n -l$(st) )) -o $(TARGET) $(OBJS_EXEC) || exit 1
|
||||
|
||||
end_progress:
|
||||
@ abort_build() { \
|
||||
[ -d "$(PACKAGE_DIR)" ] \
|
||||
&& rm -rf "$(PACKAGE_DIR)"; \
|
||||
[ -d "$(BINARY_DIR)" ] \
|
||||
&& rm -rf "$(BINARY_DIR)"; \
|
||||
[ -d "$(STATICLIB_DIR)" ] \
|
||||
&& rm -rf "$(STATICLIB_DIR)"; \
|
||||
exit 1; \
|
||||
}; \
|
||||
mv $(TARGET) $(BINARY_DIR) || abort_build; \
|
||||
mv *.a $(STATICLIB_DIR) || abort_build; \
|
||||
$(E_NS) " - Generating package..."; \
|
||||
cp $(BINARY_DIR)/$(TARGET) $(PACKAGE_DIR) || abort_build; \
|
||||
$(E_NS) " XZ $(OUT_DIRNAME)/package/$(TARGET)-`date +%Y%m%d`.xz"
|
||||
xz $(PACKAGE_DIR)/$(TARGET) || abort_build; \
|
||||
sleep 1; \
|
||||
mv $(PACKAGE_DIR)/$(TARGET).xz $(PACKAGE_DIR)/$(TARGET)-`date +%Y%m%d`.xz || abort_build
|
||||
$(E) " - Success" && $(E_NS)
|
||||
@ sleep 1
|
||||
$(E) " ----------------------------------- "
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(eval STATICLIBS = $(wildcard $(SOURCE_DIR)/*.a))
|
||||
$(eval OBJS = $(wildcard $(SOURCE_DIR)/*.o))
|
||||
$(info Cleaning files...)
|
||||
$(foreach obj, \
|
||||
$(OBJS), \
|
||||
$(call m_stat_nn,$(SOURCE_DIRNAME)/$(shell basename $(obj))) \
|
||||
$(call erase,$(obj)) \
|
||||
)
|
||||
$(foreach lib, \
|
||||
$(STATICLIBS), \
|
||||
$(call m_stat_nn,$(SOURCE_DIRNAME)/$(shell basename $(lib))) \
|
||||
$(call erase,$(lib)) \
|
||||
)
|
||||
|
||||
# end
|
||||
@@ -1,31 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
##################
|
||||
# See "erase" funtion for build/util/utils.mk
|
||||
##################
|
||||
|
||||
include $(TOOLS)/save-gen-vars.mk
|
||||
|
||||
define clean-ndk-mfiles
|
||||
@ [ "$(UPDATE_MAKEFILES)" = "true" ] || printf " ------ Cleaning NDK Makefiles ------ \n"
|
||||
@ cat $(BASH_DIR)/clean-makefiles | $(BIN)/bash
|
||||
endef
|
||||
|
||||
define clean-mfiles
|
||||
@ [ "$(UPDATE_MAKEFILES)" = "true" ] || printf " ------ Cleaning Makefiles ------ \n"
|
||||
@ cat $(BASH_DIR)/clean-makefiles | $(BIN)/bash
|
||||
endef
|
||||
@@ -1,31 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
##################
|
||||
# See "save-gen-vars" funtion for build/tools/save-gen-vars.mk
|
||||
##################
|
||||
|
||||
include $(TOOLS)/save-gen-vars.mk
|
||||
|
||||
define gen-ndk-mfiles
|
||||
@ [ "$(UPDATE_MAKEFILES)" = "true" ] || printf " ------ Generating NDK Makefiles ------ \n"
|
||||
@ cat $(BASH_DIR)/gen-makefiles | $(BIN)/bash
|
||||
endef
|
||||
|
||||
define gen-mfiles
|
||||
@ [ "$(UPDATE_MAKEFILES)" = "true" ] || printf " ------ Generating Makefiles ------ \n"
|
||||
@ cat $(BASH_DIR)/gen-makefiles | $(BIN)/bash
|
||||
endef
|
||||
@@ -1,26 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
define save-gen-vars
|
||||
@ rm -f $(BASH_DIR)/additional-vars
|
||||
$(call touch,$(BASH_DIR)/additional-vars)
|
||||
@ echo "NDK_PROG=$(NDK_PROG)" >> $(BASH_DIR)/additional-vars
|
||||
@ echo "FORCE_GEN=$(FORCE_GEN)" >> $(BASH_DIR)/additional-vars
|
||||
@ echo "THIS_IS=$(THIS_IS)" >> $(BASH_DIR)/additional-vars
|
||||
@ echo "UPDATE_MAKEFILES=$(UPDATE_MAKEFILES)" >> $(BASH_DIR)/additional-vars
|
||||
@ echo "SOURCE_DIRNAME=$(SOURCE_DIRNAME)" >> $(BASH_DIR)/additional-vars
|
||||
@ echo "OUT_DIRNAME=$(OUT_DIRNAME)" >> $(BASH_DIR)/additional-vars
|
||||
endef
|
||||
@@ -1,24 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
ifneq ($(THIS_IS),main)
|
||||
$(error The caller is not the main makefile. Something's wrong)
|
||||
endif
|
||||
|
||||
UPDATE_MAKEFILES = true
|
||||
|
||||
include $(TOOLS)/clean-makefiles.mk
|
||||
include $(TOOLS)/gen-makefiles.mk
|
||||
@@ -1,58 +0,0 @@
|
||||
# By YZBruh
|
||||
|
||||
# Copyright 2024 Partition Manager
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# generate any text based empty file. Usage: $(call touch,<PATH>)
|
||||
define touch
|
||||
@ [ ! "$(FORCE_GEN)" = "true" ] || rm -f "$1"
|
||||
@ touch "$1" || exit 1
|
||||
endef
|
||||
|
||||
# copy files. Usage: $(call copy,<SOURCE>,<COPY_PATH>)
|
||||
define copy
|
||||
cp "$1" "$2" || exit 1
|
||||
endef
|
||||
|
||||
# copy dirs. Usage: $(call copydir,<SOURCE>,<COPY_PATH>)
|
||||
define copydir
|
||||
cp -r "$1" "$2" || exit 1
|
||||
endef
|
||||
|
||||
# file/dir are deleted. usage: $(call erase,<file/directory>)
|
||||
define erase
|
||||
rm -rf "$1"
|
||||
endef
|
||||
|
||||
# make directories. usage: $(call mdir,<PATH>,<PRINTSTATUS=y/NULL>)
|
||||
define mdir
|
||||
[ -z $2 ] || printf " - Generating `basename $1` dir...\n"; \
|
||||
mkdir -p "$1" || exit 1;
|
||||
endef
|
||||
|
||||
# make status. usage: $(call m_stat,"<MESSAGE>",<NEW_LINE_STATE: RANDOM>)
|
||||
define m_stat
|
||||
printf " $1 $2"
|
||||
endef
|
||||
|
||||
# make status (not newline and using make functions). usage: $(call m_stat_nn,"<MESSAGE>")
|
||||
define m_stat_nn
|
||||
$(info ==> $(1))
|
||||
endef
|
||||
|
||||
# Get file content and if speficed write target, write speficed file. Usage: $(call cat,<SOURCE>,<WRITE_PATH>)
|
||||
define cat
|
||||
[ -z "$2" ] && cat "$1" || exit 1
|
||||
[ -n "$2" ] && cat "$1" >> "$2" || exit 1
|
||||
endef
|
||||
@@ -1,5 +1,5 @@
|
||||
export PMT_VERSION="2.8.0"
|
||||
export PMT_VERSION_CODE=280
|
||||
export PMT_VERSION="2.9.0"
|
||||
export PMT_VERSION_CODE=290
|
||||
export NDK_VERSION="r27"
|
||||
export NDK_IS="android-ndk"
|
||||
export NDK_LINK="https://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-linux.zip"
|
||||
@@ -1,11 +1,10 @@
|
||||
echo -e "\`${CC_VERSION}\`
|
||||
|
||||
Version/Version Code: \`${PMT_VERSION}\`/\`${PMT_VERSION_CODE}\`
|
||||
Supported architectures: \`arm64-v8a\` (64-bit) and \`armeabi-v7a\` (32-bit)
|
||||
Version and code: \`${PMT_VERSION}\`/\`${PMT_VERSION_CODE}\`
|
||||
Supported architectures: \`arm64-v8a\` (64-bit), \`armeabi-v7a\` (32-bit)
|
||||
|
||||
Notes:
|
||||
Builded with Android NDK ${NDK_VERSION}
|
||||
Packages are compressed with xz.
|
||||
Builded debian packages for termux. [Click](https://github.com/ShawkTeam/pmt/blob/${PMT_VERSION}/SETUP-DEBS.md) for guide.
|
||||
Report bugs and suggestions.
|
||||
[Click](https://github.com/ShawkTeam/pmt/blob/${PMT_VERSION}/CHANGELOG.md) for viewing version ${PMT_VERSION} changelog."
|
||||
- Builded with Android NDK \`${NDK_VERSION}\`
|
||||
- Packages are compressed with \`xz\`.
|
||||
- Report bugs and suggestions.
|
||||
- [Click](https://github.com/ShawkTeam/pmt/blob/${PMT_VERSION}/CHANGELOG.md) for viewing version \`${PMT_VERSION}\` changelog."
|
||||
|
||||
Reference in New Issue
Block a user