Automatically compute and substitute current values for all
$(COMMITCOUNT) instances as this feature is deprecated and shouldn't be
used.
Based on commit 0c10c224be
:
Change COMMITCOUNT in rules.mk to:
```
COMMITCOUNT = $(if $(DUMP),0,$(shell sed -i "s/\$$(COMMITCOUNT)/$(call commitcount)/" $(CURDIR)/Makefile))
```
then update all affected packages by:
```
for i in $(git -C feeds/packages grep -l COMMITCOUNT | sed 's^.*/\([^/]*\)/Makefile^\1^';);
do
make package/$i/clean
done
```
Signed-off-by: Kuan-Yi Li <kyli@abysm.org>
57 lines
1.5 KiB
Makefile
57 lines
1.5 KiB
Makefile
# Copyright (C) 2022 Sergey V. Lobanov <sergey@lobanov.in>
|
|
#
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
PKG_NAME:=fakeuname
|
|
PKG_RELEASE:=1
|
|
PKG_LICENSE:=GPL-2.0-or-later
|
|
|
|
PKG_MAINTAINER:=Sergey V. Lobanov <sergey@lobanov.in>
|
|
|
|
PKG_HOST_ONLY:=1
|
|
|
|
define Package/fakeuname
|
|
SECTION:=utils
|
|
CATEGORY:=Utilities
|
|
TITLE:=Fake uname host tool for cross-compile purposes
|
|
BUILDONLY:=1
|
|
endef
|
|
|
|
define Package/fakeuname/description
|
|
Fakeuname is a host tool for cross-compile cross-platform builds
|
|
if configure or/and build scripts check uname output for target
|
|
build and use invalid build flags. This tool should not be used
|
|
in normal case if configure/build scripts allow to redefine
|
|
required values instead of using uname output
|
|
endef
|
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
|
include $(INCLUDE_DIR)/package.mk
|
|
include $(INCLUDE_DIR)/host-build.mk
|
|
|
|
define Host/Configure
|
|
endef
|
|
|
|
define Host/Compile
|
|
{ \
|
|
cat src/header.py.inc; \
|
|
echo machine = \"$(ARCH)\"; \
|
|
echo kernel_release = \"$(LINUX_UNAME_VERSION)\"; \
|
|
echo kernel_version = \"#0 $(shell date --date=@$(SOURCE_DATE_EPOCH))\"; \
|
|
cat src/footer.py.inc; \
|
|
} > $(HOST_BUILD_DIR)/$(PKG_NAME)
|
|
endef
|
|
|
|
define Host/Install
|
|
$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/lib/$(PKG_NAME)
|
|
$(INSTALL_BIN) $(HOST_BUILD_DIR)/$(PKG_NAME) $(STAGING_DIR_HOSTPKG)/lib/$(PKG_NAME)/uname
|
|
endef
|
|
|
|
define Host/Clean
|
|
rm -rf "$(STAGING_DIR_HOSTPKG)/lib/$(PKG_NAME)"
|
|
endef
|
|
|
|
$(eval $(call HostBuild))
|
|
$(eval $(call BuildPackage,fakeuname))
|