pmt: NDK build fixes

This commit is contained in:
2024-12-14 11:53:48 +03:00
parent 84e0a02268
commit e117efd641
10 changed files with 240 additions and 974 deletions

View File

@@ -120,4 +120,4 @@ pmt <...>
### Notes
If you want to change something, take a look at the configuration. You can change him.
it is located in the `build/config` folder. His name is `env.mk`. I gave the information in the file. You can ask more.
it is located in the `build/config` folder. His name is `env.mk`. I gave the information in the file. You can ask more.

View File

@@ -1,6 +0,0 @@
# Run "make check" to ensure that the code passes some simple tests,
# usually (always?) not involving compilation.
all:
check:
./t-idcache

View File

@@ -67,11 +67,6 @@ LIBEXT2_QUOTA := $(LIB)/support
LIBEXT2_MISC := $(LIB)/misc
LIBEXT2_COM_ERR := $(LIB)/et
LIBEXT2_BLKID := $(LIB)/blkid
LIBGNULIB := $(PARTED)/libgnulib
LIBCHARSET := $(PARTED)/libcharset
LIBICRT := $(PARTED)/libiconv/icrt
LIBICONV := $(PARTED)/libiconv
LIBPARTED := $(PARTED)/libparted
INC_DIR := $(LOCAL_PATH)/../include/e2fsprogs
E2FSPROGS_INCLUDES := \
$(INC_DIR)/misc \
@@ -322,11 +317,245 @@ LOCAL_CFLAGS := \
include $(BUILD_STATIC_LIBRARY)
include $(LIBGNULIB)/Android.mk
include $(LIBCHARSET)/Android.mk
include $(LIBICRT)/Android.mk
include $(LIBICONV)/Android.mk
include $(LIBPARTED)/Android.mk
include $(CLEAR_VARS)
LOCAL_MODULE := libgnulib
LOCAL_SRC_FILES := \
$(LOCAL_PATH)/lib/argmatch.c \
$(LOCAL_PATH)/lib/basename-lgpl.c \
$(LOCAL_PATH)/lib/basename.c \
$(LOCAL_PATH)/lib/btowc.c \
$(LOCAL_PATH)/lib/c-ctype.c \
$(LOCAL_PATH)/lib/c-strcasecmp.c \
$(LOCAL_PATH)/lib/c-strncasecmp.c \
$(LOCAL_PATH)/lib/c32isprint.c \
$(LOCAL_PATH)/lib/canonicalize-lgpl.c \
$(LOCAL_PATH)/lib/cloexec.c \
$(LOCAL_PATH)/lib/close-stream.c \
$(LOCAL_PATH)/lib/closeout.c \
$(LOCAL_PATH)/lib/dirname-lgpl.c \
$(LOCAL_PATH)/lib/dirname.c \
$(LOCAL_PATH)/lib/error.c \
$(LOCAL_PATH)/lib/exitfail.c \
$(LOCAL_PATH)/lib/fcntl.c \
$(LOCAL_PATH)/lib/free.c \
$(LOCAL_PATH)/lib/getdtablesize.c \
$(LOCAL_PATH)/lib/hard-locale.c \
$(LOCAL_PATH)/lib/ialloc.c \
$(LOCAL_PATH)/lib/iswctype.c \
$(LOCAL_PATH)/lib/iswdigit.c \
$(LOCAL_PATH)/lib/iswpunct.c \
$(LOCAL_PATH)/lib/iswxdigit.c \
$(LOCAL_PATH)/lib/localcharset.c \
$(LOCAL_PATH)/lib/long-options.c \
$(LOCAL_PATH)/lib/malloca.c \
$(LOCAL_PATH)/lib/mbrtoc32.c \
$(LOCAL_PATH)/lib/mbrtowc.c \
$(LOCAL_PATH)/lib/mbszero.c \
$(LOCAL_PATH)/lib/nl_langinfo.c \
$(LOCAL_PATH)/lib/progname.c \
$(LOCAL_PATH)/lib/quotearg.c \
$(LOCAL_PATH)/lib/rawmemchr.c \
$(LOCAL_PATH)/lib/regex.c \
$(LOCAL_PATH)/lib/rpmatch.c \
$(LOCAL_PATH)/lib/safe-read.c \
$(LOCAL_PATH)/lib/setlocale-lock.c \
$(LOCAL_PATH)/lib/setlocale_null-unlocked.c \
$(LOCAL_PATH)/lib/setlocale_null.c \
$(LOCAL_PATH)/lib/stat-time.c \
$(LOCAL_PATH)/lib/stripslash.c \
$(LOCAL_PATH)/lib/tempname.c \
$(LOCAL_PATH)/lib/version-etc-fsf.c \
$(LOCAL_PATH)/lib/version-etc.c \
$(LOCAL_PATH)/lib/wctype.c \
$(LOCAL_PATH)/lib/unictype/ctype_print.c \
$(LOCAL_PATH)/lib/xalloc-die.c \
$(LOCAL_PATH)/lib/xmalloc.c \
$(LOCAL_PATH)/lib/xstrtol.c \
$(LOCAL_PATH)/lib/xstrtoll.c \
$(LOCAL_PATH)/lib/xstrtoul.c \
$(LOCAL_PATH)/lib/xstrtoull.c
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/../include/libgnulib \
$(LOCAL_PATH)/../include \
$(LOCAL_PATH)/../parted/lib/libgnulib \
$(LOCAL_PATH)/parted/libgnuliblib
LOCAL_CFLAGS := \
-Wall \
-Wextra \
-Wno-sign-compare \
-Wno-unused-const-variable \
-Wno-unused-parameter \
-Wno-nullability-completeness \
-Wno-macro-redefined \
-fPIC \
-include $(LOCAL_PATH)/../include/PartitionManager/Alternatives.h
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libcharset
LOCAL_SRC_FILES := \
$(LOCAL_PATH)/parted/libcharset/lib/localcharset.c \
$(LOCAL_PATH)/parted/libcharset/lib/relocatable-stub.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include/libcharset
LOCAL_CFLAGS := \
-Wall \
-Wextra \
-Wno-sign-compare \
-Wno-unused-const-variable \
-Wno-unused-parameter \
-fPIC \
-g \
-fvisibility=hidden
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libicrt
LOCAL_SRC_FILES := \
$(LOCAL_PATH)/parted/libiconv/icrt/allocator.c \
$(LOCAL_PATH)/parted/libiconv/icrt/areadlink.c \
$(LOCAL_PATH)/parted/libiconv/icrt/binary-io.c \
$(LOCAL_PATH)/parted/libiconv/icrt/careadlinkat.c \
$(LOCAL_PATH)/parted/libiconv/icrt/fd-hook.c \
$(LOCAL_PATH)/parted/libiconv/icrt/getprogname.c \
$(LOCAL_PATH)/parted/libiconv/icrt/unistd.c \
$(LOCAL_PATH)/parted/libiconv/icrt/xreadlink.c
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/parted/libiconv/lib \
$(LOCAL_PATH)/parted/libiconv/srclib
LOCAL_CFLAGS := \
-Wall \
-Wextra \
-Wno-sign-compare \
-Wno-unused-const-variable \
-Wno-unused-parameter \
-Wno-unused-function \
-Wno-unused-but-set-variable \
-Wno-missing-field-initializers \
-fPIC
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libiconv
LOCAL_SRC_FILES := \
$(LOCAL_PATH)/parted/libiconv/lib/iconv.c \
$(LOCAL_PATH)/parted/libiconv/lib/relocatable.c
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/../include/libiconv \
$(LOCAL_PATH)/parted/libiconv/lib \
$(LOCAL_PATH)/parted/libiconv/srclib
LOCAL_CFLAGS := \
-Wall \
-Wextra \
-Wno-sign-compare \
-Wno-unused-const-variable \
-Wno-unused-parameter \
-Wno-unused-function \
-Wno-unused-but-set-variable \
-Wno-missing-field-initializers \
-fPIC
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libparted
LOCAL_SRC_FILES := \
$(LOCAL_PATH)/parted/libparted/architecture.c \
$(LOCAL_PATH)/parted/libparted/debug.c \
$(LOCAL_PATH)/parted/libparted/device.c \
$(LOCAL_PATH)/parted/libparted/disk.c \
$(LOCAL_PATH)/parted/libparted/exception.c \
$(LOCAL_PATH)/parted/libparted/filesys.c \
$(LOCAL_PATH)/parted/libparted/libparted.c \
$(LOCAL_PATH)/parted/libparted/timer.c \
$(LOCAL_PATH)/parted/libparted/unit.c \
$(LOCAL_PATH)/parted/libparted/arch/linux.c \
$(LOCAL_PATH)/parted/libparted/cs/constraint.c \
$(LOCAL_PATH)/parted/libparted/cs/geom.c \
$(LOCAL_PATH)/parted/libparted/cs/natmath.c \
$(LOCAL_PATH)/parted/libparted/fs/amiga/a-interface.c \
$(LOCAL_PATH)/parted/libparted/fs/amiga/affs.c \
$(LOCAL_PATH)/parted/libparted/fs/amiga/amiga.c \
$(LOCAL_PATH)/parted/libparted/fs/amiga/apfs.c \
$(LOCAL_PATH)/parted/libparted/fs/amiga/asfs.c \
$(LOCAL_PATH)/parted/libparted/fs/btrfs/btrfs.c \
$(LOCAL_PATH)/parted/libparted/fs/ext2/interface.c \
$(LOCAL_PATH)/parted/libparted/fs/f2fs/f2fs.c \
$(LOCAL_PATH)/parted/libparted/fs/fat/bootsector.c \
$(LOCAL_PATH)/parted/libparted/fs/fat/fat.c \
$(LOCAL_PATH)/parted/libparted/fs/hfs/hfs.c \
$(LOCAL_PATH)/parted/libparted/fs/hfs/probe.c \
$(LOCAL_PATH)/parted/libparted/fs/jfs/jfs.c \
$(LOCAL_PATH)/parted/libparted/fs/linux_swap/linux_swap.c \
$(LOCAL_PATH)/parted/libparted/fs/nilfs2/nilfs2.c \
$(LOCAL_PATH)/parted/libparted/fs/ntfs/ntfs.c \
$(LOCAL_PATH)/parted/libparted/fs/r/filesys.c \
$(LOCAL_PATH)/parted/libparted/fs/r/fat/bootsector.c \
$(LOCAL_PATH)/parted/libparted/fs/r/fat/calc.c \
$(LOCAL_PATH)/parted/libparted/fs/r/fat/clstdup.c \
$(LOCAL_PATH)/parted/libparted/fs/r/fat/context.c \
$(LOCAL_PATH)/parted/libparted/fs/r/fat/count.c \
$(LOCAL_PATH)/parted/libparted/fs/r/fat/fat.c \
$(LOCAL_PATH)/parted/libparted/fs/r/fat/fatio.c \
$(LOCAL_PATH)/parted/libparted/fs/r/fat/resize.c \
$(LOCAL_PATH)/parted/libparted/fs/r/fat/table.c \
$(LOCAL_PATH)/parted/libparted/fs/r/fat/traverse.c \
$(LOCAL_PATH)/parted/libparted/fs/r/hfs/advfs.c \
$(LOCAL_PATH)/parted/libparted/fs/r/hfs/advfs_plus.c \
$(LOCAL_PATH)/parted/libparted/fs/r/hfs/cache.c \
$(LOCAL_PATH)/parted/libparted/fs/r/hfs/file.c \
$(LOCAL_PATH)/parted/libparted/fs/r/hfs/file_plus.c \
$(LOCAL_PATH)/parted/libparted/fs/r/hfs/hfs.c \
$(LOCAL_PATH)/parted/libparted/fs/r/hfs/journal.c \
$(LOCAL_PATH)/parted/libparted/fs/r/hfs/probe.c \
$(LOCAL_PATH)/parted/libparted/fs/r/hfs/reloc.c \
$(LOCAL_PATH)/parted/libparted/fs/r/hfs/reloc_plus.c \
$(LOCAL_PATH)/parted/libparted/fs/reiserfs/reiserfs.c \
$(LOCAL_PATH)/parted/libparted/fs/udf/udf.c \
$(LOCAL_PATH)/parted/libparted/fs/ufs/ufs.c \
$(LOCAL_PATH)/parted/libparted/fs/xfs/xfs.c \
$(LOCAL_PATH)/parted/libparted/labels/aix.c \
$(LOCAL_PATH)/parted/libparted/labels/atari.c \
$(LOCAL_PATH)/parted/libparted/labels/bsd.c \
$(LOCAL_PATH)/parted/libparted/labels/dos.c \
$(LOCAL_PATH)/parted/libparted/labels/dvh.c \
$(LOCAL_PATH)/parted/libparted/labels/efi_crc32.c \
$(LOCAL_PATH)/parted/libparted/labels/fdasd.c \
$(LOCAL_PATH)/parted/libparted/labels/gpt.c \
$(LOCAL_PATH)/parted/libparted/labels/loop.c \
$(LOCAL_PATH)/parted/libparted/labels/mac.c \
$(LOCAL_PATH)/parted/libparted/labels/pt-tools.c \
$(LOCAL_PATH)/parted/libparted/labels/rdb.c \
$(LOCAL_PATH)/parted/libparted/labels/sun.c \
$(LOCAL_PATH)/parted/libparted/labels/vtoc.c
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/../include \
$(LOCAL_PATH)/../include/libgnulib \
$(LOCAL_PATH)/parted \
$(LOCAL_PATH)/parted/libparted \
$(LOCAL_PATH)/parted/libparted/labels \
$(LOCAL_PATH)/parted/lib
LOCAL_CFLAGS := \
-Wall \
-Wextra \
-fPIC \
-Wno-pointer-sign \
-Wno-sign-compare \
-Wno-gnu-designator \
-Wno-unused-variable \
-Wno-unused-parameter \
-Wno-unused-command-line-argument \
-Wno-missing-field-initializers \
-Wno-single-bit-bitfield-constant-conversion
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)

View File

@@ -1,382 +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 e2fsprogs (built-in mke2fs)
#####
# Include required files
include ../../build/config/env.mk
ifeq ($(INC_OLDENV),true)
include ../../build/config/oldenv.mk
endif
# Some variables, flags etc.
E := @ echo
INCLUDE := $(realpath ../../include/e2fsprogs)
E2FSPROGS_DEFAULT_CFLAGS = \
-std=c17 \
-Wall \
-Werror \
-Wno-pointer-arith \
-Wno-sign-compare \
-Wno-type-limits \
-Wno-typedef-redefinition \
-Wno-unused-parameter \
-Wno-unused-command-line-argument \
-Wno-nullability-completeness \
-Wno-macro-redefined \
-fPIC \
-pthread \
-include $(INCLUDE)/../PartitionManager/Alternatives.h
INCLUDE_DIRS := \
$(INCLUDE)/misc \
$(INCLUDE)/blkid \
$(INCLUDE)/e2p \
$(INCLUDE)/et \
$(INCLUDE)/ext2fs \
$(INCLUDE)/ss \
$(INCLUDE)/support \
$(INCLUDE)/uuid \
$(INCLUDE)/e2fsck \
$(INCLUDE)
INC_DIRS := $(foreach dir,$(INCLUDE_DIRS),$(shell echo -I$(dir)))
CFLAGS := $(E2FSPROGS_DEFAULT_CFLAGS) $(INC_DIRS)
ARFLAGS := rcs
OUT := $(realpath ../../out/e2fsprogs)
MKE2FS := $(CURDIR)/mke2fs
LIB := $(CURDIR)/lib
LIBEXT2FS := $(LIB)/ext2fs
LIBEXT2_UUID := $(LIB)/uuid
LIBEXT2_E2P := $(LIB)/e2p
LIBEXT2_QUOTA := $(LIB)/support
LIBEXT2_MISC := $(LIB)/misc
LIBEXT2_COM_ERR := $(LIB)/et
LIBEXT2_BLKID := $(LIB)/blkid
# Source list of mke2fs
MKE2FS_SRCS := \
$(MKE2FS)/default_profile.c \
$(MKE2FS)/mk_hugefiles.c \
$(MKE2FS)/mke2fs.c \
$(MKE2FS)/util.c
# Source list of libext2fs
LIBEXT2FS_SRCS := \
$(LIBEXT2FS)/alloc.c \
$(LIBEXT2FS)/alloc_sb.c \
$(LIBEXT2FS)/alloc_stats.c \
$(LIBEXT2FS)/alloc_tables.c \
$(LIBEXT2FS)/atexit.c \
$(LIBEXT2FS)/badblocks.c \
$(LIBEXT2FS)/bb_inode.c \
$(LIBEXT2FS)/bitmaps.c \
$(LIBEXT2FS)/bitops.c \
$(LIBEXT2FS)/blkmap64_ba.c \
$(LIBEXT2FS)/blkmap64_rb.c \
$(LIBEXT2FS)/blknum.c \
$(LIBEXT2FS)/block.c \
$(LIBEXT2FS)/bmap.c \
$(LIBEXT2FS)/check_desc.c \
$(LIBEXT2FS)/crc16.c \
$(LIBEXT2FS)/crc32c.c \
$(LIBEXT2FS)/csum.c \
$(LIBEXT2FS)/closefs.c \
$(LIBEXT2FS)/dblist.c \
$(LIBEXT2FS)/dblist_dir.c \
$(LIBEXT2FS)/digest_encode.c \
$(LIBEXT2FS)/dirblock.c \
$(LIBEXT2FS)/dirhash.c \
$(LIBEXT2FS)/dir_iterate.c \
$(LIBEXT2FS)/dupfs.c \
$(LIBEXT2FS)/expanddir.c \
$(LIBEXT2FS)/ext2_err.c \
$(LIBEXT2FS)/ext_attr.c \
$(LIBEXT2FS)/extent.c \
$(LIBEXT2FS)/fallocate.c \
$(LIBEXT2FS)/fileio.c \
$(LIBEXT2FS)/finddev.c \
$(LIBEXT2FS)/flushb.c \
$(LIBEXT2FS)/freefs.c \
$(LIBEXT2FS)/gen_bitmap.c \
$(LIBEXT2FS)/gen_bitmap64.c \
$(LIBEXT2FS)/get_num_dirs.c \
$(LIBEXT2FS)/get_pathname.c \
$(LIBEXT2FS)/getsize.c \
$(LIBEXT2FS)/getsectsize.c \
$(LIBEXT2FS)/hashmap.c \
$(LIBEXT2FS)/i_block.c \
$(LIBEXT2FS)/icount.c \
$(LIBEXT2FS)/imager.c \
$(LIBEXT2FS)/ind_block.c \
$(LIBEXT2FS)/initialize.c \
$(LIBEXT2FS)/inline.c \
$(LIBEXT2FS)/inline_data.c \
$(LIBEXT2FS)/inode.c \
$(LIBEXT2FS)/io_manager.c \
$(LIBEXT2FS)/ismounted.c \
$(LIBEXT2FS)/link.c \
$(LIBEXT2FS)/llseek.c \
$(LIBEXT2FS)/lookup.c \
$(LIBEXT2FS)/mmp.c \
$(LIBEXT2FS)/mkdir.c \
$(LIBEXT2FS)/mkjournal.c \
$(LIBEXT2FS)/namei.c \
$(LIBEXT2FS)/native.c \
$(LIBEXT2FS)/newdir.c \
$(LIBEXT2FS)/nls_utf8.c \
$(LIBEXT2FS)/openfs.c \
$(LIBEXT2FS)/progress.c \
$(LIBEXT2FS)/punch.c \
$(LIBEXT2FS)/qcow2.c \
$(LIBEXT2FS)/rbtree.c \
$(LIBEXT2FS)/read_bb.c \
$(LIBEXT2FS)/read_bb_file.c \
$(LIBEXT2FS)/res_gdt.c \
$(LIBEXT2FS)/rw_bitmaps.c \
$(LIBEXT2FS)/sha256.c \
$(LIBEXT2FS)/sha512.c \
$(LIBEXT2FS)/swapfs.c \
$(LIBEXT2FS)/symlink.c \
$(LIBEXT2FS)/undo_io.c \
$(LIBEXT2FS)/unix_io.c \
$(LIBEXT2FS)/sparse_io.c \
$(LIBEXT2FS)/unlink.c \
$(LIBEXT2FS)/valid_blk.c \
$(LIBEXT2FS)/version.c \
$(LIBEXT2FS)/test_io.c
# Source list of libext2_uuid
LIBEXT2_UUID_SRCS := \
$(LIBEXT2_UUID)/clear.c \
$(LIBEXT2_UUID)/compare.c \
$(LIBEXT2_UUID)/copy.c \
$(LIBEXT2_UUID)/gen_uuid.c \
$(LIBEXT2_UUID)/isnull.c \
$(LIBEXT2_UUID)/pack.c \
$(LIBEXT2_UUID)/parse.c \
$(LIBEXT2_UUID)/unpack.c \
$(LIBEXT2_UUID)/unparse.c \
$(LIBEXT2_UUID)/uuid_time.c
# Source list of libext2_blkid
LIBEXT2_BLKID_SRCS := \
$(LIBEXT2_BLKID)/cache.c \
$(LIBEXT2_BLKID)/dev.c \
$(LIBEXT2_BLKID)/devname.c \
$(LIBEXT2_BLKID)/devno.c \
$(LIBEXT2_BLKID)/getsize.c \
$(LIBEXT2_BLKID)/llseek.c \
$(LIBEXT2_BLKID)/probe.c \
$(LIBEXT2_BLKID)/read.c \
$(LIBEXT2_BLKID)/resolve.c \
$(LIBEXT2_BLKID)/save.c \
$(LIBEXT2_BLKID)/tag.c \
$(LIBEXT2_BLKID)/version.c
# Source list of libext2_e2p
LIBEXT2_E2P_SRCS := \
$(LIBEXT2_E2P)/crypto_mode.c \
$(LIBEXT2_E2P)/encoding.c \
$(LIBEXT2_E2P)/errcode.c \
$(LIBEXT2_E2P)/feature.c \
$(LIBEXT2_E2P)/fgetflags.c \
$(LIBEXT2_E2P)/fgetproject.c \
$(LIBEXT2_E2P)/fgetversion.c \
$(LIBEXT2_E2P)/fsetflags.c \
$(LIBEXT2_E2P)/fsetproject.c \
$(LIBEXT2_E2P)/fsetversion.c \
$(LIBEXT2_E2P)/getflags.c \
$(LIBEXT2_E2P)/getversion.c \
$(LIBEXT2_E2P)/hashstr.c \
$(LIBEXT2_E2P)/iod.c \
$(LIBEXT2_E2P)/ljs.c \
$(LIBEXT2_E2P)/ls.c \
$(LIBEXT2_E2P)/mntopts.c \
$(LIBEXT2_E2P)/ostype.c \
$(LIBEXT2_E2P)/parse_num.c \
$(LIBEXT2_E2P)/pe.c \
$(LIBEXT2_E2P)/percent.c \
$(LIBEXT2_E2P)/pf.c \
$(LIBEXT2_E2P)/ps.c \
$(LIBEXT2_E2P)/setflags.c \
$(LIBEXT2_E2P)/setversion.c \
$(LIBEXT2_E2P)/uuid.c
# Source list of libext2_quota
LIBEXT2_QUOTA_SRCS := \
$(LIBEXT2_QUOTA)/devname.c \
$(LIBEXT2_QUOTA)/dict.c \
$(LIBEXT2_QUOTA)/mkquota.c \
$(LIBEXT2_QUOTA)/parse_qtype.c \
$(LIBEXT2_QUOTA)/plausible.c \
$(LIBEXT2_QUOTA)/prof_err.c \
$(LIBEXT2_QUOTA)/profile.c \
$(LIBEXT2_QUOTA)/profile_helpers.c \
$(LIBEXT2_QUOTA)/quotaio.c \
$(LIBEXT2_QUOTA)/quotaio_tree.c \
$(LIBEXT2_QUOTA)/quotaio_v2.c
# Source od libext2_misc
LIBEXT2_MISC_SRCS := $(LIBEXT2_MISC)/create_inode.c
# Source list of libext2_com_err
LIBEXT2_COM_ERR_SRCS := \
$(LIBEXT2_COM_ERR)/com_err.c \
$(LIBEXT2_COM_ERR)/com_right.c \
$(LIBEXT2_COM_ERR)/error_message.c \
$(LIBEXT2_COM_ERR)/et_name.c \
$(LIBEXT2_COM_ERR)/init_et.c
# Object lists
MKE2FS_OBJS := $(MKE2FS_SRCS:.c=.o)
LIBEXT2FS_OBJS := $(LIBEXT2FS_SRCS:.c=.o)
LIBEXT2_UUID_OBJS := $(LIBEXT2_UUID_SRCS:.c=.o)
LIBEXT2_BLKID_OBJS := $(LIBEXT2_BLKID_SRCS:.c=.o)
LIBEXT2_E2P_OBJS := $(LIBEXT2_E2P_SRCS:.c=.o)
LIBEXT2_QUOTA_OBJS := $(LIBEXT2_QUOTA_SRCS:.c=.o)
LIBEXT2_MISC_OBJS := $(LIBEXT2_MISC_SRCS:.c=.o)
LIBEXT2_COM_ERR_OBJS := $(LIBEXT2_COM_ERR_SRCS:.c=.o)
# Compiler flags (CFLAGS)
LIBEXT2FS_CFLAGS := -Wno-unused-but-set-variable
LIBEXT2_E2P_CFLAGS := -Wno-error=attributes
LIBEXT2_MISC_CFLAGS := -Wno-error=format-extra-args
LIBEXT2_BLKID_CFLAGS := \
-Wno-error=attributes \
-Wno-error=pointer-sign \
-Wno-unused-but-set-variable \
-fno-strict-aliasing
# Full object list
OBJS_ALL := \
$(MKE2FS_OBJS) \
$(LIBEXT2FS_OBJS) \
$(LIBEXT2_BLKID_OBJS) \
$(LIBEXT2_UUID_OBJS) \
$(LIBEXT2_E2P_OBJS) \
$(LIBEXT2_QUOTA_OBJS) \
$(LIBEXT2_MISC_OBJS) \
$(LIBEXT2_COM_ERR_OBJS)
# Progress list
PROGRESS_LIST := \
$(LIBEXT2_BLKID_OBJS) \
libext2_blkid_ar \
$(LIBEXT2_UUID_OBJS) \
libext2_uuid_ar \
$(LIBEXT2_E2P_OBJS) \
libext2_e2p_ar \
$(LIBEXT2FS_OBJS) \
libext2fs_ar \
$(LIBEXT2_QUOTA_OBJS) \
libext2_quota_ar \
$(LIBEXT2_MISC_OBJS) \
libext2_misc_ar \
$(LIBEXT2_COM_ERR_OBJS) \
libext2_com_err_ar \
$(MKE2FS_OBJS) \
mke2fs_dummy_ld
.PHONY: all
all: $(PROGRESS_LIST)
# Cleaner
.PHONY: clean
clean:
@ rm -rf $(OBJS_ALL)
#######################################
# 'MAKE' TARGETS FOR BUILDING OBJECTS #
#######################################
$(MKE2FS)/%.o: $(MKE2FS)/%.c
$(E) " CC e2fsprogs/`basename $(MKE2FS)`/`basename $@`"
@ $(CC) -c $(CFLAGS) $(MKE2FS_CFLAGS) "$<" -o "$@" || exit 1
$(LIBEXT2FS)/%.o: $(LIBEXT2FS)/%.c
$(E) " CC e2fsprogs/lib/`basename $(LIBEXT2FS)`/`basename $@`"
@ $(CC) -c $(CFLAGS) $(LIBEXT2FS_CFLAGS) "$<" -o "$@" || exit 1
$(LIBEXT2_BLKID)/%.o: $(LIBEXT2_BLKID)/%.c
$(E) " CC e2fsprogs/lib/`basename $(LIBEXT2_BLKID)`/`basename $@`"
@ $(CC) -c $(CFLAGS) $(LIBEXT2_BLKID_CFLAGS) "$<" -o "$@" || exit 1
$(LIBEXT2_E2P)/%.o: $(LIBEXT2_E2P)/%.c
$(E) " CC e2fsprogs/lib/`basename $(LIBEXT2_E2P)`/`basename $@`"
@ $(CC) -c $(CFLAGS) "$<" -o "$@" || exit 1
$(LIBEXT2_UUID)/%.o: $(LIBEXT2_UUID)/%.c
$(E) " CC e2fsprogs/lib/`basename $(LIBEXT2_UUID)`/`basename $@`"
@ $(CC) -c $(CFLAGS) "$<" -o "$@" || exit 1
$(LIBEXT2_QUOTA)/%.o: $(LIBEXT2_QUOTA)/%.c
$(E) " CC e2fsprogs/lib/`basename $(LIBEXT2_QUOTA)`/`basename $@`"
@ $(CC) -c $(CFLAGS) "$<" -o "$@" || exit 1
$(LIBEXT2_MISC)/%.o: $(LIBEXT2_MISC)/%.c
$(E) " CC e2fsprogs/lib/`basename $(LIBEXT2_MISC)`/`basename $@`"
@ $(CC) -c $(CFLAGS) $(LIBEXT2_MISC_CFLAGS) "$<" -o "$@" || exit 1
$(LIBEXT2_COM_ERR)/%.o: $(LIBEXT2_COM_ERR)/%.c
$(E) " CC e2fsprogs/lib/`basename $(LIBEXT2_COM_ERR)`/`basename $@`"
@ $(CC) -c $(CFLAGS) "$<" -o "$@" || exit 1
#############################################
# 'MAKE' TARGETS FOR GENERATING STATIC LIBS #
#############################################
libext2fs_ar: $(LIBEXT2FS_OBJS)
$(E) " AR out/e2fsprogs/libext2fs.a"
@ $(AR) $(ARFLAGS) $(OUT)/libext2fs.a $^ || exit 1
$(E) " ----------- libext2_quota -----------"
libext2_blkid_ar: $(LIBEXT2_BLKID_OBJS)
$(E) " AR out/e2fsprogs/libext2_blkid.a"
@ $(AR) $(ARFLAGS) $(OUT)/libext2_blkid.a $^ || exit 1
$(E) " ----------- libext2_uuid ---------"
libext2_e2p_ar: $(LIBEXT2_E2P_OBJS)
$(E) " AR out/e2fsprogs/libext2_e2p.a"
@ $(AR) $(ARFLAGS) $(OUT)/libext2_e2p.a $^ || exit 1
$(E) " ----------- libext2fs -----------"
libext2_uuid_ar: $(LIBEXT2_UUID_OBJS)
$(E) " AR out/e2fsprogs/libext2_uuid.a"
@ $(AR) $(ARFLAGS) $(OUT)/libext2_uuid.a $^ || exit 1
$(E) " ----------- libext2_e2p -----------"
libext2_quota_ar: $(LIBEXT2_QUOTA_OBJS)
$(E) " AR out/e2fsprogs/libext2_quota.a"
@ $(AR) $(ARFLAGS) $(OUT)/libext2_quota.a $^ || exit 1
$(E) " ----------- libext2_misc -----------"
libext2_misc_ar: $(LIBEXT2_MISC_OBJS)
$(E) " AR out/e2fsprogs/libext2_misc.a"
@ $(AR) $(ARFLAGS) $(OUT)/libext2_misc.a $^ || exit 1
$(E) " ----------- libext2_com_err -----------"
libext2_com_err_ar: $(LIBEXT2_COM_ERR_OBJS)
$(E) " AR out/e2fsprogs/libext2_com_err.a"
@ $(AR) $(ARFLAGS) $(OUT)/libext2_com_err.a $^ || exit 1
$(E) " ----------- mke2fs -----------"
#############################################
# DUMMY 'MAKE' TARGET FOR DISPLAYING MKE2FS #
#############################################
mke2fs_dummy_ld:
$(E) " DMY mke2fs"

View File

@@ -1,219 +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 parted (built-in parted)
#####
# Include required files
include ../../build/config/env.mk
ifeq ($(INC_OLDENV),true)
include ../../build/config/oldenv.mk
endif
# Some flags etc
E := @ echo
INCLUDE_DIRS := \
$(CURDIR)/../../include \
$(CURDIR)/../../include/libgnulib \
$(CURDIR)/parted \
$(CURDIR)/libparted \
$(CURDIR)/libparted/labels \
$(CURDIR)/lib
CFLAGS := \
-Wall \
-Wextra \
-fPIC \
-Wno-pointer-sign \
-Wno-sign-compare \
-Wno-gnu-designator \
-Wno-unused-variable \
-Wno-unused-parameter \
-Wno-unused-command-line-argument \
-Wno-missing-field-initializers \
-Wno-single-bit-bitfield-constant-conversion \
$(foreach dir,$(INCLUDE_DIRS),$(shell echo -I$(dir)))
AR_FLAGS := rcs
OUT := $(realpath ../../out/parted)
LIBPARTED := libparted
PARTED := parted
PATH := $(shell echo $$PREFIX)/bin
LIBPARTED_SRCS := \
$(LIBPARTED)/architecture.c \
$(LIBPARTED)/debug.c \
$(LIBPARTED)/device.c \
$(LIBPARTED)/disk.c \
$(LIBPARTED)/exception.c \
$(LIBPARTED)/filesys.c \
$(LIBPARTED)/libparted.c \
$(LIBPARTED)/timer.c \
$(LIBPARTED)/unit.c \
$(LIBPARTED)/arch/linux.c \
$(LIBPARTED)/cs/constraint.c \
$(LIBPARTED)/cs/geom.c \
$(LIBPARTED)/cs/natmath.c \
$(LIBPARTED)/fs/amiga/a-interface.c \
$(LIBPARTED)/fs/amiga/affs.c \
$(LIBPARTED)/fs/amiga/amiga.c \
$(LIBPARTED)/fs/amiga/apfs.c \
$(LIBPARTED)/fs/amiga/asfs.c \
$(LIBPARTED)/fs/btrfs/btrfs.c \
$(LIBPARTED)/fs/ext2/interface.c \
$(LIBPARTED)/fs/f2fs/f2fs.c \
$(LIBPARTED)/fs/fat/bootsector.c \
$(LIBPARTED)/fs/fat/fat.c \
$(LIBPARTED)/fs/hfs/hfs.c \
$(LIBPARTED)/fs/hfs/probe.c \
$(LIBPARTED)/fs/jfs/jfs.c \
$(LIBPARTED)/fs/linux_swap/linux_swap.c \
$(LIBPARTED)/fs/nilfs2/nilfs2.c \
$(LIBPARTED)/fs/ntfs/ntfs.c \
$(LIBPARTED)/fs/r/filesys.c \
$(LIBPARTED)/fs/r/fat/bootsector.c \
$(LIBPARTED)/fs/r/fat/calc.c \
$(LIBPARTED)/fs/r/fat/clstdup.c \
$(LIBPARTED)/fs/r/fat/context.c \
$(LIBPARTED)/fs/r/fat/count.c \
$(LIBPARTED)/fs/r/fat/fat.c \
$(LIBPARTED)/fs/r/fat/fatio.c \
$(LIBPARTED)/fs/r/fat/resize.c \
$(LIBPARTED)/fs/r/fat/table.c \
$(LIBPARTED)/fs/r/fat/traverse.c \
$(LIBPARTED)/fs/r/hfs/advfs.c \
$(LIBPARTED)/fs/r/hfs/advfs_plus.c \
$(LIBPARTED)/fs/r/hfs/cache.c \
$(LIBPARTED)/fs/r/hfs/file.c \
$(LIBPARTED)/fs/r/hfs/file_plus.c \
$(LIBPARTED)/fs/r/hfs/hfs.c \
$(LIBPARTED)/fs/r/hfs/journal.c \
$(LIBPARTED)/fs/r/hfs/probe.c \
$(LIBPARTED)/fs/r/hfs/reloc.c \
$(LIBPARTED)/fs/r/hfs/reloc_plus.c \
$(LIBPARTED)/fs/reiserfs/reiserfs.c \
$(LIBPARTED)/fs/udf/udf.c \
$(LIBPARTED)/fs/ufs/ufs.c \
$(LIBPARTED)/fs/xfs/xfs.c \
$(LIBPARTED)/labels/aix.c \
$(LIBPARTED)/labels/atari.c \
$(LIBPARTED)/labels/bsd.c \
$(LIBPARTED)/labels/dos.c \
$(LIBPARTED)/labels/dvh.c \
$(LIBPARTED)/labels/efi_crc32.c \
$(LIBPARTED)/labels/fdasd.c \
$(LIBPARTED)/labels/gpt.c \
$(LIBPARTED)/labels/loop.c \
$(LIBPARTED)/labels/mac.c \
$(LIBPARTED)/labels/pt-tools.c \
$(LIBPARTED)/labels/rdb.c \
$(LIBPARTED)/labels/sun.c \
$(LIBPARTED)/labels/vtoc.c
PARTED_SRCS := \
$(PARTED)/command.c \
$(PARTED)/jsonwrt.c \
$(PARTED)/parted.c \
$(PARTED)/strlist.c \
$(PARTED)/table.c \
$(PARTED)/ui.c \
$(PARTED)/version.c
LIBPARTED_OBJS := $(LIBPARTED_SRCS:.c=.o)
PARTED_OBJS := $(PARTED_SRCS:.c=.o)
OBJS_ALL := \
$(LIBPARTED_OBJS) \
$(PARTED_OBJS)
PROGRESS_LIST := \
make_outdir \
build_libgnulib \
build_libcharset \
build_libiconv_and_libicrt \
print_libparted \
$(LIBPARTED_OBJS) \
libparted_ar \
print_parted \
$(PARTED_OBJS) \
dummy_parted
.PHONY: all
all: $(PROGRESS_LIST)
.PHONY: clean
clean:
@ rm -rf $(OBJS_ALL) $(OUT) *.a
@ $(MAKE) -C $(CURDIR)/libgnulib -s clean
@ $(MAKE) -C $(CURDIR)/libiconv -s clean
@ $(MAKE) -C $(CURDIR)/libcharset -s clean
.PHONY: install
install:
@ abort() { \
echo "$1"; \
exit 1; \
}; \
[ -f $(PATH)/parted-test ] && \
abort "Already installed."; \
cp $(OUT)/parted $(PATH)/parted-test || \
abort "Copying failed!"; \
chmod 777 $(PATH)/parted-test || \
abort "Cannot set permissions!"
.PHONY: uninstall
uninstall:
@ if [ ! -f $(PATH)/parted-test ]; then echo "Already uninstalled"; exit 1; fi
@ rm -f $(PATH)/parted-test &>/dev/null
.PHONY:
reinstall:
@ $(MAKE) -s uninstall
@ $(MAKE) -s install
$(LIBPARTED)/%.o: $(LIBPARTED)/%.c
$(E) " CC $@"
@ $(CC) -c $(CFLAGS) -o $@ $^ || exit 1
$(PARTED)/%.o: $(PARTED)/%.c
$(E) " CC $@"
@ $(CC) -c $(CFLAGS) -o $@ $^ || exit 1
libparted_ar: $(LIBPARTED_OBJS)
$(E) " AR out/parted/libparted.a"
@ $(AR) $(AR_FLAGS) $(OUT)/libparted.a $(LIBPARTED_OBJS)
build_libgnulib:
@ $(MAKE) -C $(CURDIR)/libgnulib -s
build_libcharset:
$(E) " ----------- libcharset ----------- "
@ $(MAKE) -C $(CURDIR)/libcharset -s
build_libiconv_and_libicrt:
$(E) " ----------- libicrt ----------- "
@ $(MAKE) -C $(CURDIR)/libiconv -s
make_outdir:
@ if [ ! -d $(OUT) ]; then mkdir -p $(OUT); fi
print_libparted:
$(E) " ----------- libparted ----------- "
print_parted:
$(E) " ----------- parted ----------- "
dummy_parted:
$(E) " DMY parted"

View File

@@ -1,40 +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.
########
# 3.0.2
########
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libcharset
LOCAL_SRC_FILES := \
$(LOCAL_PATH)/lib/localcharset.c \
$(LOCAL_PATH)/lib/relocatable-stub.c
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../include/libcharset
LOCAL_CFLAGS := \
-Wall \
-Wextra \
-Wno-sign-compare \
-Wno-unused-const-variable \
-Wno-unused-parameter \
-fPIC \
-g \
-fvisibility=hidden
include $(BUILD_STATIC_LIBRARY)

View File

@@ -1,68 +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 libcharset (built-in lib)
#####
include ../../../build/config/env.mk
ifeq ($(INC_OLDENV),true)
include ../../../build/config/oldenv.mk
endif
E := @ echo
INCLUDE_DIR := $(CURDIR)/../../../include/libcharset
CFLAGS := \
-Wall \
-Wextra \
-Wno-sign-compare \
-Wno-unused-const-variable \
-Wno-unused-parameter \
-fPIC \
-g \
-fvisibility=hidden \
-I$(INCLUDE_DIR)
AR_FLAGS := rcs
OUT := $(realpath ../../../out/parted)
LIB := $(CURDIR)/lib
LIBCHARSET_SRCS := \
$(LIB)/localcharset.c \
$(LIB)/relocatable-stub.c
LIBCHARSET_OBJS := $(LIBCHARSET_SRCS:.c=.o)
PROGRESS_LIST := \
outctrl \
$(LIBCHARSET_OBJS) \
libcharset_ar
.PHONY: all
all: $(PROGRESS_LIST)
.PHONY: clean
clean:
@ rm -f $(LIBCHARSET_OBJS) $(OUT)/libcharset.a
outctrl:
@ if [ ! -d $(OUT) ]; then mkdir -p $(OUT); fi
$(LIB)/%.o: $(LIB)/%.c
$(E) " CC libcharset/lib/`basename $@`"
@ $(CC) -c $(CFLAGS) -o $@ $^ || exit 1
libcharset_ar: $(LIBCHARSET_OBJS)
$(E) " AR out/parted/libcharset.a"
@ $(AR) $(AR_FLAGS) $(OUT)/libcharset.a $(LIBCHARSET_OBJS)

View File

@@ -1,97 +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.
########
# 3.0.2
########
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libgnulib
LOCAL_SRC_FILES := \
$(LOCAL_PATH)/lib/argmatch.c \
$(LOCAL_PATH)/lib/basename-lgpl.c \
$(LOCAL_PATH)/lib/basename.c \
$(LOCAL_PATH)/lib/btowc.c \
$(LOCAL_PATH)/lib/c-ctype.c \
$(LOCAL_PATH)/lib/c-strcasecmp.c \
$(LOCAL_PATH)/lib/c-strncasecmp.c \
$(LOCAL_PATH)/lib/c32isprint.c \
$(LOCAL_PATH)/lib/canonicalize-lgpl.c \
$(LOCAL_PATH)/lib/cloexec.c \
$(LOCAL_PATH)/lib/close-stream.c \
$(LOCAL_PATH)/lib/closeout.c \
$(LOCAL_PATH)/lib/dirname-lgpl.c \
$(LOCAL_PATH)/lib/dirname.c \
$(LOCAL_PATH)/lib/error.c \
$(LOCAL_PATH)/lib/exitfail.c \
$(LOCAL_PATH)/lib/fcntl.c \
$(LOCAL_PATH)/lib/free.c \
$(LOCAL_PATH)/lib/getdtablesize.c \
$(LOCAL_PATH)/lib/hard-locale.c \
$(LOCAL_PATH)/lib/ialloc.c \
$(LOCAL_PATH)/lib/iswctype.c \
$(LOCAL_PATH)/lib/iswdigit.c \
$(LOCAL_PATH)/lib/iswpunct.c \
$(LOCAL_PATH)/lib/iswxdigit.c \
$(LOCAL_PATH)/lib/localcharset.c \
$(LOCAL_PATH)/lib/long-options.c \
$(LOCAL_PATH)/lib/malloca.c \
$(LOCAL_PATH)/lib/mbrtoc32.c \
$(LOCAL_PATH)/lib/mbrtowc.c \
$(LOCAL_PATH)/lib/mbszero.c \
$(LOCAL_PATH)/lib/nl_langinfo.c \
$(LOCAL_PATH)/lib/progname.c \
$(LOCAL_PATH)/lib/quotearg.c \
$(LOCAL_PATH)/lib/rawmemchr.c \
$(LOCAL_PATH)/lib/regex.c \
$(LOCAL_PATH)/lib/rpmatch.c \
$(LOCAL_PATH)/lib/safe-read.c \
$(LOCAL_PATH)/lib/setlocale-lock.c \
$(LOCAL_PATH)/lib/setlocale_null-unlocked.c \
$(LOCAL_PATH)/lib/setlocale_null.c \
$(LOCAL_PATH)/lib/stat-time.c \
$(LOCAL_PATH)/lib/stripslash.c \
$(LOCAL_PATH)/lib/tempname.c \
$(LOCAL_PATH)/lib/version-etc-fsf.c \
$(LOCAL_PATH)/lib/version-etc.c \
$(LOCAL_PATH)/lib/wctype.c \
$(LOCAL_PATH)/lib/unictype/ctype_print.c \
$(LOCAL_PATH)/lib/xalloc-die.c \
$(LOCAL_PATH)/lib/xmalloc.c \
$(LOCAL_PATH)/lib/xstrtol.c \
$(LOCAL_PATH)/lib/xstrtoll.c \
$(LOCAL_PATH)/lib/xstrtoul.c \
$(LOCAL_PATH)/lib/xstrtoull.c
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/../../../include/libgnulib \
$(LOCAL_PATH)/../../../include \
$(LOCAL_PATH)/../lib \
$(LOCAL_PATH)/lib
LOCAL_CFLAGS := \
-Wall \
-Wextra \
-Wno-sign-compare \
-Wno-unused-const-variable \
-Wno-unused-parameter \
-Wno-nullability-completeness \
-Wno-macro-redefined \
-fPIC \
-include $(LOCAL_PATH)/../../include/PartitionManager/Alternatives.h
include $(BUILD_STATIC_LIBRARY)

View File

@@ -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.
########
# 3.0.2
########
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := libiconv
LOCAL_SRC_FILES := \
$(LOCAL_PATH)/lib/iconv.c \
$(LOCAL_PATH)/lib/relocatable.c
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/../../../../include/libiconv \
$(LOCAL_PATH)/lib \
$(LOCAL_PATH)/srclib
LOCAL_CFLAGS := \
-Wall \
-Wextra \
-Wno-sign-compare \
-Wno-unused-const-variable \
-Wno-unused-parameter \
-Wno-unused-function \
-Wno-unused-but-set-variable \
-Wno-missing-field-initializers \
-fPIC
include $(BUILD_STATIC_LIBRARY)

View File

@@ -1,107 +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 libiconv and libicrt (built-in libs)
#####
# Include required files
include ../../../build/config/env.mk
ifeq ($(INC_OLDENV),true)
include ../../../build/config/oldenv.mk
endif
E := @ echo
INCLUDE_DIRS := \
$(CURDIR)/../../../include/libiconv \
$(CURDIR)/lib \
$(CURDIR)/srclib
CFLAGS := \
-Wall \
-Wextra \
-Wno-sign-compare \
-Wno-unused-const-variable \
-Wno-unused-parameter \
-Wno-unused-function \
-Wno-unused-but-set-variable \
-Wno-missing-field-initializers \
-fPIC \
$(foreach dir,$(INCLUDE_DIRS),$(shell echo "-I$(dir)"))
AR_FLAGS := rcs
OUT := $(realpath ../../../out/parted)
LIB := $(CURDIR)/lib
SRC := $(CURDIR)/src
SRCLIB := $(CURDIR)/srclib
LIBICRT := $(CURDIR)/icrt
LIBICRT_SRCS := \
$(LIBICRT)/allocator.c \
$(LIBICRT)/areadlink.c \
$(LIBICRT)/binary-io.c \
$(LIBICRT)/careadlinkat.c \
$(LIBICRT)/fd-hook.c \
$(LIBICRT)/getprogname.c \
$(LIBICRT)/unistd.c \
$(LIBICRT)/xreadlink.c
LIBICRT_OBJS := $(LIBICRT_SRCS:.c=.o)
LIBICONV_SRCS := \
$(LIB)/iconv.c \
$(LIB)/relocatable.c
LIBICONV_OBJS := $(LIBICONV_SRCS:.c=.o)
PROGRESS_LIST := \
outctrl \
$(LIBICRT_OBJS) \
libicrt_ar \
print_iconv \
$(LIBICONV_OBJS) \
libiconv_ar
.PHONY: all
all: $(PROGRESS_LIST)
.PHONY: clean
clean:
@ rm -rf $(LIBICONV_OBJS) $(LIBICRT_OBJS) $(OUT)/libicrt.a $(OUT)/libiconv.a
outctrl:
@ if [ ! -d $(OUT) ]; then mkdir -p $(OUT); fi
$(LIBICRT)/%.o: $(LIBICRT)/%.c
$(E) " CC libiconv/icrt/`basename $@`"
@ $(CC) -c $(CFLAGS) -o $@ $^ || exit 1
$(LIB)/%.o: $(LIB)/%.c
$(E) " CC libiconv/lib/`basename $@`"
@ $(CC) -c $(CFLAGS) -o $@ $^ || exit 1
$(SRC)/%.o: $(SRC)/%.c
$(E) " CC libiconv/src/`basename $@`"
@ $(CC) -c $(CFLAGS) -o $@ $^ || exit 1
libicrt_ar: $(LIBICRT_OBJS)
$(E) " AR out/parted/libicrt.a"
@ $(AR) $(AR_FLAGS) $(OUT)/libicrt.a $(LIBICRT_OBJS)
libiconv_ar: $(LIBICONV_OBJS)
$(E) " AR out/parted/libiconv.a"
@ $(AR) $(AR_FLAGS) $(OUT)/libiconv.a $(LIBICONV_OBJS)
print_iconv:
$(E) " ----------- libiconv ----------- "