lua-rs232: fix compilation with GCC13
[feed/packages.git] / utils / fakeuname / Makefile
1 # Copyright (C) 2022 Sergey V. Lobanov <sergey@lobanov.in>
2 #
3 # SPDX-License-Identifier: GPL-2.0-or-later
4
5 include $(TOPDIR)/rules.mk
6
7 PKG_NAME:=fakeuname
8 PKG_RELEASE:=1
9 PKG_LICENSE:=GPL-2.0-or-later
10
11 PKG_MAINTAINER:=Sergey V. Lobanov <sergey@lobanov.in>
12
13 PKG_HOST_ONLY:=1
14
15 define Package/fakeuname
16 SECTION:=utils
17 CATEGORY:=Utilities
18 TITLE:=Fake uname host tool for cross-compile purposes
19 BUILDONLY:=1
20 endef
21
22 define Package/fakeuname/description
23 Fakeuname is a host tool for cross-compile cross-platform builds
24 if configure or/and build scripts check uname output for target
25 build and use invalid build flags. This tool should not be used
26 in normal case if configure/build scripts allow to redefine
27 required values instead of using uname output
28 endef
29
30 include $(INCLUDE_DIR)/kernel.mk
31 include $(INCLUDE_DIR)/package.mk
32 include $(INCLUDE_DIR)/host-build.mk
33
34 define Host/Configure
35 endef
36
37 define Host/Compile
38 { \
39 cat src/header.py.inc; \
40 echo machine = \"$(ARCH)\"; \
41 echo kernel_release = \"$(LINUX_UNAME_VERSION)\"; \
42 echo kernel_version = \"#0 $(shell date --date=@$(SOURCE_DATE_EPOCH))\"; \
43 cat src/footer.py.inc; \
44 } > $(HOST_BUILD_DIR)/$(PKG_NAME)
45 endef
46
47 define Host/Install
48 $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/lib/$(PKG_NAME)
49 $(INSTALL_BIN) $(HOST_BUILD_DIR)/$(PKG_NAME) $(STAGING_DIR_HOSTPKG)/lib/$(PKG_NAME)/uname
50 endef
51
52 define Host/Clean
53 rm -rf "$(STAGING_DIR_HOSTPKG)/lib/$(PKG_NAME)"
54 endef
55
56 $(eval $(call HostBuild))
57 $(eval $(call BuildPackage,fakeuname))