2007-11-14 23:11:07 +00:00
|
|
|
# Makefile for OpenWrt
|
2007-01-10 21:52:28 +00:00
|
|
|
#
|
2015-06-01 06:15:39 +00:00
|
|
|
# Copyright (C) 2007-2015 OpenWrt.org
|
2007-01-10 21:52:28 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
2007-11-14 23:11:07 +00:00
|
|
|
TOPDIR:=${CURDIR}
|
|
|
|
LC_ALL:=C
|
|
|
|
LANG:=C
|
|
|
|
export TOPDIR LC_ALL LANG
|
2012-04-26 17:53:56 +00:00
|
|
|
export OPENWRT_VERBOSE=s
|
2007-01-10 21:52:28 +00:00
|
|
|
all: help
|
|
|
|
|
2023-05-25 06:31:17 +00:00
|
|
|
export ORIG_PATH:=$(if $(ORIG_PATH),$(ORIG_PATH),$(PATH))
|
2017-02-20 13:24:54 +00:00
|
|
|
export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
|
2007-01-10 21:52:28 +00:00
|
|
|
|
2007-11-14 23:11:07 +00:00
|
|
|
ifneq ($(OPENWRT_BUILD),1)
|
|
|
|
override OPENWRT_BUILD=1
|
|
|
|
export OPENWRT_BUILD
|
2007-01-10 21:52:28 +00:00
|
|
|
endif
|
|
|
|
|
2007-11-14 23:11:07 +00:00
|
|
|
include rules.mk
|
|
|
|
include $(INCLUDE_DIR)/debug.mk
|
|
|
|
include $(INCLUDE_DIR)/depends.mk
|
2018-03-06 08:38:29 +00:00
|
|
|
include $(INCLUDE_DIR)/rootfs.mk
|
2007-01-10 21:52:28 +00:00
|
|
|
|
2010-03-08 17:00:46 +00:00
|
|
|
include $(INCLUDE_DIR)/version.mk
|
|
|
|
export REVISION
|
2022-04-09 23:55:21 +00:00
|
|
|
export SOURCE_DATE_EPOCH
|
2010-03-08 17:00:46 +00:00
|
|
|
|
2007-01-10 21:52:28 +00:00
|
|
|
define Helptext
|
|
|
|
Available Commands:
|
|
|
|
help: This help text
|
|
|
|
info: Show a list of available target profiles
|
|
|
|
clean: Remove images and temporary build files
|
|
|
|
image: Build an image (see below for more information).
|
2021-08-19 06:42:50 +00:00
|
|
|
manifest: Show all package that will be installed into the image
|
2021-08-19 06:48:08 +00:00
|
|
|
package_whatdepends: Show which packages have a dependency on this
|
2021-08-18 15:19:15 +00:00
|
|
|
package_depends: Show installation dependency of the package
|
2007-01-10 21:52:28 +00:00
|
|
|
|
2021-08-19 06:39:42 +00:00
|
|
|
image:
|
2007-01-10 21:52:28 +00:00
|
|
|
By default 'make image' will create an image with the default
|
|
|
|
target profile and package set. You can use the following parameters
|
|
|
|
to change that:
|
2012-01-24 09:47:20 +00:00
|
|
|
|
2007-01-10 21:52:28 +00:00
|
|
|
make image PROFILE="<profilename>" # override the default target profile
|
|
|
|
make image PACKAGES="<pkg1> [<pkg2> [<pkg3> ...]]" # include extra packages
|
|
|
|
make image FILES="<path>" # include extra files from <path>
|
2010-10-26 14:15:52 +00:00
|
|
|
make image BIN_DIR="<path>" # alternative output directory for the images
|
2016-01-03 14:44:56 +00:00
|
|
|
make image EXTRA_IMAGE_NAME="<string>" # Add this to the output image filename (sanitized)
|
2019-05-09 01:45:07 +00:00
|
|
|
make image DISABLED_SERVICES="<svc1> [<svc2> [<svc3> ..]]" # Which services in /etc/init.d/ should be disabled
|
2020-11-02 22:15:05 +00:00
|
|
|
make image ADD_LOCAL_KEY=1 # store locally generated signing key in built images
|
2023-03-12 15:56:41 +00:00
|
|
|
make image ROOTFS_PARTSIZE="<size>" # override the default rootfs partition size in MegaBytes
|
2018-07-20 08:32:12 +00:00
|
|
|
|
2021-08-19 06:42:50 +00:00
|
|
|
manifest:
|
2018-07-20 08:32:12 +00:00
|
|
|
List "all" packages which get installed into the image.
|
|
|
|
You can use the following parameters:
|
|
|
|
|
|
|
|
make manifest PROFILE="<profilename>" # override the default target profile
|
|
|
|
make manifest PACKAGES="<pkg1> [<pkg2> [<pkg3> ...]]" # include extra packages
|
2021-03-16 01:59:26 +00:00
|
|
|
make manifest STRIP_ABI=1 # remove ABI version from printed package names
|
2018-07-20 08:32:12 +00:00
|
|
|
|
2021-08-19 06:48:08 +00:00
|
|
|
|
|
|
|
package_whatdepends:
|
|
|
|
List "all" packages that have a dependency on this package
|
|
|
|
You can use the following parameters:
|
|
|
|
|
|
|
|
make package_whatdepends PACKAGE="<pkg>"
|
|
|
|
|
2021-08-18 15:19:15 +00:00
|
|
|
package_depends:
|
|
|
|
List "all" packages dependency of the package
|
|
|
|
You can use the following parameters:
|
|
|
|
|
|
|
|
make package_depends PACKAGE="<pkg>"
|
|
|
|
|
2007-01-10 21:52:28 +00:00
|
|
|
endef
|
|
|
|
$(eval $(call shexport,Helptext))
|
|
|
|
|
|
|
|
help: FORCE
|
|
|
|
echo "$$$(call shvar,Helptext)"
|
|
|
|
|
2007-11-14 23:11:07 +00:00
|
|
|
|
|
|
|
# override variables from rules.mk
|
2024-10-24 18:45:01 +00:00
|
|
|
BUILD_KEY_APK_SEC=$(TOPDIR)/keys/local-private-key.pem
|
|
|
|
BUILD_KEY_APK_PUB=$(TOPDIR)/keys/local-public-key.pem
|
2024-10-24 18:32:42 +00:00
|
|
|
export PACKAGE_DIR:=$(TOPDIR)/packages
|
2015-09-14 16:57:03 +00:00
|
|
|
LISTS_DIR:=$(subst $(space),/,$(patsubst %,..,$(subst /,$(space),$(TARGET_DIR))))$(DL_DIR)
|
2024-10-24 18:32:42 +00:00
|
|
|
export PACKAGE_DIR_ALL:=$(TOPDIR)/packages
|
2024-05-14 10:36:59 +00:00
|
|
|
|
2020-11-02 22:15:05 +00:00
|
|
|
export OPKG_KEYS:=$(TOPDIR)/keys
|
2018-03-06 08:38:29 +00:00
|
|
|
OPKG:=$(call opkg,$(TARGET_DIR)) \
|
2010-09-12 22:04:09 +00:00
|
|
|
-f $(TOPDIR)/repositories.conf \
|
2020-11-02 22:15:05 +00:00
|
|
|
--verify-program $(SCRIPT_DIR)/opkg-key \
|
2015-06-01 06:15:39 +00:00
|
|
|
--cache $(DL_DIR) \
|
2018-03-06 08:38:29 +00:00
|
|
|
--lists-dir $(LISTS_DIR)
|
2007-11-14 23:11:07 +00:00
|
|
|
|
2024-10-24 18:45:01 +00:00
|
|
|
export APK_KEYS:=$(TOPDIR)/keys
|
2024-05-14 10:36:59 +00:00
|
|
|
APK:=$(call apk,$(TARGET_DIR)) \
|
2024-10-24 18:36:43 +00:00
|
|
|
--repositories-file $(TOPDIR)/repositories \
|
|
|
|
$(if $(CONFIG_SIGNATURE_CHECK),,--allow-untrusted) \
|
|
|
|
--cache-dir $(DL_DIR)
|
2024-05-14 10:36:59 +00:00
|
|
|
|
|
|
|
|
2007-11-14 23:11:07 +00:00
|
|
|
include $(INCLUDE_DIR)/target.mk
|
2016-05-13 14:32:23 +00:00
|
|
|
-include .profiles.mk
|
|
|
|
|
|
|
|
USER_PROFILE ?= $(firstword $(PROFILE_NAMES))
|
|
|
|
PROFILE_LIST = $(foreach p,$(PROFILE_NAMES), \
|
2019-03-11 04:32:29 +00:00
|
|
|
echo '$(patsubst DEVICE_%,%,$(p)):'; $(if $($(p)_NAME),echo ' $(subst ','"'"',$($(p)_NAME))'; ) \
|
|
|
|
echo ' Packages: $($(p)_PACKAGES)'; echo ' hasImageMetadata: $($(p)_HAS_IMAGE_METADATA)'; \
|
2019-08-13 21:38:17 +00:00
|
|
|
$(if $($(p)_SUPPORTED_DEVICES),echo ' SupportedDevices: $($(p)_SUPPORTED_DEVICES)';) )
|
|
|
|
|
2016-05-13 14:32:23 +00:00
|
|
|
|
|
|
|
.profiles.mk: .targetinfo
|
2024-04-08 06:05:29 +00:00
|
|
|
@$(SCRIPT_DIR)/target-metadata.pl profile_mk $< '$(BOARD)/$(SUBTARGET)' > $@
|
2007-11-14 23:11:07 +00:00
|
|
|
|
2015-09-10 11:06:42 +00:00
|
|
|
staging_dir/host/.prereq-build: include/prereq-build.mk
|
2024-02-12 19:02:48 +00:00
|
|
|
mkdir -p tmp
|
2020-06-10 02:24:29 +00:00
|
|
|
@$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f $(TOPDIR)/include/prereq-build.mk prereq IB=1 2>/dev/null || { \
|
2015-09-10 11:06:42 +00:00
|
|
|
echo "Prerequisite check failed. Use FORCE=1 to override."; \
|
|
|
|
false; \
|
|
|
|
}
|
|
|
|
ifneq ($(realpath $(TOPDIR)/include/prepare.mk),)
|
|
|
|
@$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f $(TOPDIR)/include/prepare.mk prepare 2>/dev/null || { \
|
|
|
|
echo "Preparation failed."; \
|
|
|
|
false; \
|
|
|
|
}
|
|
|
|
endif
|
|
|
|
touch $@
|
|
|
|
|
2010-04-27 22:16:40 +00:00
|
|
|
_call_info: FORCE
|
2019-03-08 00:06:26 +00:00
|
|
|
echo 'Current Target: "$(TARGETID)"'
|
2021-09-24 04:46:15 +00:00
|
|
|
echo 'Current Architecture: "$(ARCH)"'
|
2019-03-08 00:09:23 +00:00
|
|
|
echo 'Current Revision: "$(REVISION)"'
|
2007-11-14 23:11:07 +00:00
|
|
|
echo 'Default Packages: $(DEFAULT_PACKAGES)'
|
2007-01-10 21:52:28 +00:00
|
|
|
echo 'Available Profiles:'
|
|
|
|
echo; $(PROFILE_LIST)
|
|
|
|
|
2024-11-13 06:04:31 +00:00
|
|
|
ifneq ($(CONFIG_USE_APK),)
|
|
|
|
DEFAULT_PACKAGES += apk-mbedtls
|
|
|
|
else
|
|
|
|
DEFAULT_PACKAGES += opkg
|
|
|
|
endif
|
2023-07-11 14:06:21 +00:00
|
|
|
BUILD_PACKAGES:=$(sort $(DEFAULT_PACKAGES) $($(USER_PROFILE)_PACKAGES) kernel)
|
2007-01-20 12:35:00 +00:00
|
|
|
# "-pkgname" in the package list means remove "pkgname" from the package list
|
2007-01-21 12:56:55 +00:00
|
|
|
BUILD_PACKAGES:=$(filter-out $(filter -%,$(BUILD_PACKAGES)) $(patsubst -%,%,$(filter -%,$(BUILD_PACKAGES))),$(BUILD_PACKAGES))
|
2023-07-11 14:06:21 +00:00
|
|
|
BUILD_PACKAGES:=$(USER_PACKAGES) $(BUILD_PACKAGES)
|
|
|
|
BUILD_PACKAGES:=$(filter-out $(filter -%,$(BUILD_PACKAGES)) $(patsubst -%,%,$(filter -%,$(BUILD_PACKAGES))),$(BUILD_PACKAGES))
|
2010-09-08 00:36:35 +00:00
|
|
|
PACKAGES:=
|
2007-01-10 21:52:28 +00:00
|
|
|
|
2015-09-10 11:06:42 +00:00
|
|
|
_call_image: staging_dir/host/.prereq-build
|
2010-04-27 22:16:40 +00:00
|
|
|
echo 'Building images for $(BOARD)$(if $($(USER_PROFILE)_NAME), - $($(USER_PROFILE)_NAME))'
|
2007-01-10 21:52:28 +00:00
|
|
|
echo 'Packages: $(BUILD_PACKAGES)'
|
|
|
|
echo
|
2018-03-06 08:38:29 +00:00
|
|
|
rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
|
2015-06-01 06:15:39 +00:00
|
|
|
mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(DL_DIR)
|
2017-06-13 19:59:14 +00:00
|
|
|
$(MAKE) package_reload
|
2007-01-10 21:52:28 +00:00
|
|
|
$(MAKE) package_install
|
2018-03-06 08:38:29 +00:00
|
|
|
$(MAKE) -s prepare_rootfs
|
2016-08-01 16:26:05 +00:00
|
|
|
$(MAKE) -s build_image
|
2020-03-12 22:55:41 +00:00
|
|
|
$(MAKE) -s json_overview_image_info
|
2016-08-01 16:26:05 +00:00
|
|
|
$(MAKE) -s checksum
|
2012-01-24 09:47:20 +00:00
|
|
|
|
2018-07-20 08:32:12 +00:00
|
|
|
_call_manifest: FORCE
|
|
|
|
rm -rf $(TARGET_DIR)
|
|
|
|
mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(DL_DIR)
|
2018-08-05 03:17:29 +00:00
|
|
|
$(MAKE) package_reload >/dev/null
|
|
|
|
$(MAKE) package_install >/dev/null
|
2024-05-19 12:58:11 +00:00
|
|
|
ifeq ($(CONFIG_USE_APK),)
|
|
|
|
$(OPKG) list-installed $(if $(STRIP_ABI),--strip-abi)
|
|
|
|
else
|
2024-05-14 10:36:59 +00:00
|
|
|
$(APK) list --quiet --manifest --no-network
|
2024-05-19 12:58:11 +00:00
|
|
|
endif
|
2018-07-20 08:32:12 +00:00
|
|
|
|
2010-09-12 22:04:09 +00:00
|
|
|
package_index: FORCE
|
2017-06-16 22:54:46 +00:00
|
|
|
@echo >&2
|
|
|
|
@echo Building package index... >&2
|
2015-06-01 06:15:39 +00:00
|
|
|
@mkdir -p $(TMP_DIR) $(TARGET_DIR)/tmp
|
2024-05-14 10:36:59 +00:00
|
|
|
ifeq ($(CONFIG_USE_APK),)
|
2011-09-09 17:25:20 +00:00
|
|
|
(cd $(PACKAGE_DIR); $(SCRIPT_DIR)/ipkg-make-index.sh . > Packages && \
|
2020-11-02 22:15:05 +00:00
|
|
|
gzip -9nc Packages > Packages.gz; \
|
|
|
|
$(if $(CONFIG_SIGNATURE_CHECK), \
|
2020-11-22 14:23:27 +00:00
|
|
|
$(STAGING_DIR_HOST)/bin/usign -S -m Packages -s $(BUILD_KEY)) \
|
2008-07-29 03:36:11 +00:00
|
|
|
) >/dev/null 2>/dev/null
|
2017-06-16 22:54:46 +00:00
|
|
|
$(OPKG) update >&2 || true
|
2024-05-14 10:36:59 +00:00
|
|
|
else
|
2024-10-24 18:36:43 +00:00
|
|
|
(cd $(PACKAGE_DIR); $(APK) mkndx \
|
2024-10-24 18:45:01 +00:00
|
|
|
$(if $(CONFIG_SIGNATURE_CHECK), --keys-dir $(APK_KEYS) --sign $(BUILD_KEY_APK_SEC)) \
|
2024-10-24 18:36:43 +00:00
|
|
|
--allow-untrusted --output packages.adb *.apk) >/dev/null 2>/dev/null || true
|
2024-05-14 10:36:59 +00:00
|
|
|
endif
|
2007-01-10 21:52:28 +00:00
|
|
|
|
2017-06-13 19:59:14 +00:00
|
|
|
package_reload:
|
2024-05-14 10:36:59 +00:00
|
|
|
ifeq ($(CONFIG_USE_APK),)
|
2020-10-17 20:06:03 +00:00
|
|
|
if [ -d "$(PACKAGE_DIR)" ] && ( \
|
|
|
|
[ ! -f "$(PACKAGE_DIR)/Packages" ] || \
|
|
|
|
[ ! -f "$(PACKAGE_DIR)/Packages.gz" ] || \
|
|
|
|
[ "`find $(PACKAGE_DIR) -cnewer $(PACKAGE_DIR)/Packages.gz`" ] ); then \
|
2017-06-16 22:54:46 +00:00
|
|
|
echo "Package list missing or not up-to-date, generating it." >&2 ;\
|
2017-06-13 19:59:14 +00:00
|
|
|
$(MAKE) package_index; \
|
|
|
|
else \
|
|
|
|
mkdir -p $(TARGET_DIR)/tmp; \
|
2017-06-16 22:54:46 +00:00
|
|
|
$(OPKG) update >&2 || true; \
|
2017-06-13 19:59:14 +00:00
|
|
|
fi
|
2024-05-14 10:36:59 +00:00
|
|
|
else
|
2024-11-08 09:37:16 +00:00
|
|
|
$(APK) add --initdb
|
2024-05-14 10:36:59 +00:00
|
|
|
if [ -d "$(PACKAGE_DIR)" ] && ( \
|
|
|
|
[ ! -f "$(PACKAGE_DIR)/packages.adb" ] || \
|
|
|
|
[ "`find $(PACKAGE_DIR) -cnewer $(PACKAGE_DIR)/packages.adb`" ] ); then \
|
|
|
|
echo "Package list missing or not up-to-date, generating it." >&2 ;\
|
|
|
|
$(MAKE) package_index; \
|
|
|
|
else \
|
|
|
|
mkdir -p $(TARGET_DIR)/tmp; \
|
|
|
|
fi
|
|
|
|
endif
|
2017-06-13 19:59:14 +00:00
|
|
|
|
|
|
|
package_list: FORCE
|
|
|
|
@$(MAKE) -s package_reload
|
2024-05-19 12:58:11 +00:00
|
|
|
ifeq ($(CONFIG_USE_APK),)
|
|
|
|
@$(OPKG) list --size 2>/dev/null
|
|
|
|
else
|
2024-05-14 10:36:59 +00:00
|
|
|
@$(APK) list --size 2>/dev/null
|
2024-05-19 12:58:11 +00:00
|
|
|
endif
|
2017-06-13 19:59:14 +00:00
|
|
|
|
2007-01-10 21:52:28 +00:00
|
|
|
package_install: FORCE
|
|
|
|
@echo
|
|
|
|
@echo Installing packages...
|
2024-05-14 10:36:59 +00:00
|
|
|
ifeq ($(CONFIG_USE_APK),)
|
2024-11-06 15:34:32 +00:00
|
|
|
$(OPKG) install $(wildcard $(PACKAGE_DIR)/libc_*.ipk)
|
|
|
|
$(OPKG) install $(wildcard $(PACKAGE_DIR)/kernel_*.ipk)
|
2010-09-06 02:15:46 +00:00
|
|
|
$(OPKG) install $(BUILD_PACKAGES)
|
2024-05-14 10:36:59 +00:00
|
|
|
else
|
|
|
|
$(APK) add --no-scripts $(BUILD_PACKAGES)
|
|
|
|
endif
|
2007-01-10 21:52:28 +00:00
|
|
|
|
2018-03-06 08:38:29 +00:00
|
|
|
prepare_rootfs: FORCE
|
2007-01-10 21:52:28 +00:00
|
|
|
@echo
|
2018-03-06 08:38:29 +00:00
|
|
|
@echo Finalizing root filesystem...
|
2007-01-10 21:52:28 +00:00
|
|
|
|
2018-03-06 08:38:29 +00:00
|
|
|
$(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG)
|
2024-05-14 10:36:59 +00:00
|
|
|
ifeq ($(CONFIG_USE_APK),)
|
2020-11-02 22:15:05 +00:00
|
|
|
$(if $(CONFIG_SIGNATURE_CHECK), \
|
|
|
|
$(if $(ADD_LOCAL_KEY), \
|
|
|
|
OPKG_KEYS=$(TARGET_DIR)/etc/opkg/keys/ \
|
|
|
|
$(SCRIPT_DIR)/opkg-key add $(BUILD_KEY).pub \
|
|
|
|
) \
|
|
|
|
)
|
2024-10-24 18:45:01 +00:00
|
|
|
else
|
|
|
|
$(if $(CONFIG_SIGNATURE_CHECK), \
|
|
|
|
$(if $(ADD_LOCAL_KEY), \
|
|
|
|
mkdir -p $(TARGET_DIR)/etc/opkg/keys/; \
|
|
|
|
cp $(BUILD_KEY_APK_PUB) $(TARGET_DIR)/etc/apk/keys/; \
|
|
|
|
) \
|
|
|
|
)
|
2024-05-14 10:36:59 +00:00
|
|
|
endif
|
2019-05-09 01:45:07 +00:00
|
|
|
$(call prepare_rootfs,$(TARGET_DIR),$(USER_FILES),$(DISABLED_SERVICES))
|
2007-01-10 21:52:28 +00:00
|
|
|
|
|
|
|
build_image: FORCE
|
|
|
|
@echo
|
|
|
|
@echo Building images...
|
2020-06-09 04:15:05 +00:00
|
|
|
rm -rf $(BUILD_DIR)/json_info_files/
|
2023-05-03 11:29:42 +00:00
|
|
|
if [ -d "target/linux/feeds/$(BOARD)" ]; then \
|
|
|
|
$(NO_TRACE_MAKE) -C target/linux/feeds/$(BOARD)/image install TARGET_BUILD=1 IB=1 EXTRA_IMAGE_NAME="$(EXTRA_IMAGE_NAME)" \
|
|
|
|
$(if $(USER_PROFILE),PROFILE="$(USER_PROFILE)"); \
|
|
|
|
else \
|
|
|
|
$(NO_TRACE_MAKE) -C target/linux/$(BOARD)/image install TARGET_BUILD=1 IB=1 EXTRA_IMAGE_NAME="$(EXTRA_IMAGE_NAME)" \
|
|
|
|
$(if $(USER_PROFILE),PROFILE="$(USER_PROFILE)"); \
|
|
|
|
fi
|
2012-01-24 09:47:20 +00:00
|
|
|
|
2020-03-12 22:55:41 +00:00
|
|
|
$(BIN_DIR)/profiles.json: FORCE
|
|
|
|
$(if $(CONFIG_JSON_OVERVIEW_IMAGE_INFO), \
|
|
|
|
WORK_DIR=$(BUILD_DIR)/json_info_files \
|
|
|
|
$(SCRIPT_DIR)/json_overview_image_info.py $@ \
|
|
|
|
)
|
|
|
|
|
|
|
|
json_overview_image_info: $(BIN_DIR)/profiles.json
|
|
|
|
|
2016-07-26 13:05:35 +00:00
|
|
|
checksum: FORCE
|
|
|
|
@echo
|
|
|
|
@echo Calculating checksums...
|
|
|
|
@$(call sha256sums,$(BIN_DIR))
|
|
|
|
|
2007-01-10 21:52:28 +00:00
|
|
|
clean:
|
2015-06-01 06:15:39 +00:00
|
|
|
rm -rf $(TMP_DIR) $(DL_DIR) $(TARGET_DIR) $(BIN_DIR)
|
2007-01-10 21:52:28 +00:00
|
|
|
|
2007-11-14 23:11:07 +00:00
|
|
|
|
2010-04-27 22:16:40 +00:00
|
|
|
info:
|
|
|
|
(unset PROFILE FILES PACKAGES MAKEFLAGS; $(MAKE) -s _call_info)
|
|
|
|
|
2016-07-21 11:41:20 +00:00
|
|
|
PROFILE_FILTER = $(filter DEVICE_$(PROFILE) $(PROFILE),$(PROFILE_NAMES))
|
|
|
|
|
2018-07-20 08:32:12 +00:00
|
|
|
_check_profile: FORCE
|
2015-01-10 18:19:59 +00:00
|
|
|
ifneq ($(PROFILE),)
|
2016-07-21 11:41:20 +00:00
|
|
|
ifeq ($(PROFILE_FILTER),)
|
2015-01-10 18:19:59 +00:00
|
|
|
@echo 'Profile "$(PROFILE)" does not exist!'
|
|
|
|
@echo 'Use "make info" to get a list of available profile names.'
|
|
|
|
@exit 1
|
|
|
|
endif
|
|
|
|
endif
|
2018-07-20 08:32:12 +00:00
|
|
|
|
2020-11-02 22:15:05 +00:00
|
|
|
_check_keys: FORCE
|
|
|
|
ifneq ($(CONFIG_SIGNATURE_CHECK),)
|
2024-10-24 18:45:01 +00:00
|
|
|
ifeq ($(CONFIG_USE_APK),)
|
2020-11-02 22:15:05 +00:00
|
|
|
@if [ ! -s $(BUILD_KEY) -o ! -s $(BUILD_KEY).pub ]; then \
|
|
|
|
echo Generate local signing keys... >&2; \
|
|
|
|
$(STAGING_DIR_HOST)/bin/usign -G \
|
|
|
|
-s $(BUILD_KEY) -p $(BUILD_KEY).pub -c "Local build key"; \
|
|
|
|
$(SCRIPT_DIR)/opkg-key add $(BUILD_KEY).pub; \
|
|
|
|
fi
|
|
|
|
if [ ! -s $(BUILD_KEY).ucert ]; then \
|
|
|
|
echo Generate local certificate... >&2; \
|
|
|
|
$(STAGING_DIR_HOST)/bin/ucert -I \
|
|
|
|
-c $(BUILD_KEY).ucert \
|
|
|
|
-p $(BUILD_KEY).pub \
|
|
|
|
-s $(BUILD_KEY); \
|
|
|
|
fi
|
2024-05-19 12:58:11 +00:00
|
|
|
else
|
2024-10-24 18:45:01 +00:00
|
|
|
@if [ ! -s $(BUILD_KEY_APK_SEC) -o ! -s $(BUILD_KEY_APK_PUB) ]; then \
|
|
|
|
echo Generate local signing keys... >&2; \
|
|
|
|
$(STAGING_DIR_HOST)/bin/openssl ecparam -name prime256v1 -genkey -noout -out $(BUILD_KEY_APK_SEC); \
|
|
|
|
sed -i '1s/^/untrusted comment: Local build key\n/' $(BUILD_KEY_APK_SEC); \
|
|
|
|
$(STAGING_DIR_HOST)/bin/openssl ec -in $(BUILD_KEY_APK_SEC) -pubout > $(BUILD_KEY_APK_PUB); \
|
|
|
|
sed -i '1s/^/untrusted comment: Local build key\n/' $(BUILD_KEY_APK_PUB); \
|
|
|
|
fi
|
|
|
|
endif
|
2024-05-14 10:36:59 +00:00
|
|
|
endif
|
2020-11-02 22:15:05 +00:00
|
|
|
|
2018-07-20 08:32:12 +00:00
|
|
|
image:
|
|
|
|
$(MAKE) -s _check_profile
|
2020-11-02 22:15:05 +00:00
|
|
|
$(MAKE) -s _check_keys
|
2010-04-27 22:16:40 +00:00
|
|
|
(unset PROFILE FILES PACKAGES MAKEFLAGS; \
|
2016-08-01 16:26:05 +00:00
|
|
|
$(MAKE) -s _call_image \
|
2016-07-21 11:41:20 +00:00
|
|
|
$(if $(PROFILE),USER_PROFILE="$(PROFILE_FILTER)") \
|
2010-04-27 22:16:40 +00:00
|
|
|
$(if $(FILES),USER_FILES="$(FILES)") \
|
2010-10-26 14:15:52 +00:00
|
|
|
$(if $(PACKAGES),USER_PACKAGES="$(PACKAGES)") \
|
2019-05-09 01:45:07 +00:00
|
|
|
$(if $(BIN_DIR),BIN_DIR="$(BIN_DIR)") \
|
2023-03-12 15:56:41 +00:00
|
|
|
$(if $(DISABLED_SERVICES),DISABLED_SERVICES="$(DISABLED_SERVICES)") \
|
|
|
|
$(if $(ROOTFS_PARTSIZE),CONFIG_TARGET_ROOTFS_PARTSIZE="$(ROOTFS_PARTSIZE)"))
|
2010-04-27 22:16:40 +00:00
|
|
|
|
2018-07-20 08:32:12 +00:00
|
|
|
manifest: FORCE
|
|
|
|
$(MAKE) -s _check_profile
|
2020-11-02 22:15:05 +00:00
|
|
|
$(MAKE) -s _check_keys
|
2018-07-20 08:32:12 +00:00
|
|
|
(unset PROFILE FILES PACKAGES MAKEFLAGS; \
|
|
|
|
$(MAKE) -s _call_manifest \
|
|
|
|
$(if $(PROFILE),USER_PROFILE="$(PROFILE_FILTER)") \
|
|
|
|
$(if $(PACKAGES),USER_PACKAGES="$(PACKAGES)"))
|
|
|
|
|
2021-08-19 06:48:08 +00:00
|
|
|
package_whatdepends: FORCE
|
2020-08-21 01:44:51 +00:00
|
|
|
ifeq ($(PACKAGE),)
|
|
|
|
@echo 'Variable `PACKAGE` is not set but required by `whatdepends`'
|
|
|
|
@exit 1
|
|
|
|
endif
|
|
|
|
@$(MAKE) -s package_reload
|
2024-05-14 10:36:59 +00:00
|
|
|
ifeq ($(CONFIG_USE_APK),)
|
|
|
|
@$(OPKG) list --depends $(PACKAGE)
|
|
|
|
else
|
|
|
|
@$(APK) list --depends $(PACKAGE)
|
|
|
|
endif
|
2020-08-21 01:44:51 +00:00
|
|
|
|
2021-08-18 15:19:15 +00:00
|
|
|
package_depends: FORCE
|
|
|
|
ifeq ($(PACKAGE),)
|
|
|
|
@echo 'Variable `PACKAGE` is not set but required by `package_depends`'
|
|
|
|
@exit 1
|
|
|
|
endif
|
|
|
|
@$(MAKE) -s package_reload
|
2024-05-14 10:36:59 +00:00
|
|
|
ifeq ($(CONFIG_USE_APK),)
|
2021-08-18 15:19:15 +00:00
|
|
|
@$(OPKG) depends -A $(PACKAGE)
|
2024-05-14 10:36:59 +00:00
|
|
|
else
|
|
|
|
@$(OPKG) whatdepends -A $(PACKAGE)
|
|
|
|
endif
|
2021-08-18 15:19:15 +00:00
|
|
|
|
2021-08-19 06:48:08 +00:00
|
|
|
.SILENT: help info image manifest package_whatdepends package_depends
|