tools/elfutils: override SUBDIRS variable of Makefile
[openwrt/openwrt.git] / tools / elfutils / Makefile
1 # SPDX-License-Identifier: GPL-2.0-only
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=elfutils
6 PKG_VERSION:=0.191
7 PKG_RELEASE:=1
8
9 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
10 PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION)
11 PKG_HASH:=df76db71366d1d708365fc7a6c60ca48398f14367eb2b8954efc8897147ad871
12
13 PKG_LICENSE:=GPL-3.0-or-later
14 PKG_LICENSE_FILES:=COPYING COPYING-GPLV2 COPYING-LGPLV3
15 PKG_CPE_ID:=cpe:/a:elfutils_project:elfutils
16
17 PKG_FIXUP:=autoreconf
18 PKG_INSTALL:=1
19
20 PKG_SUBDIRS := \
21 libgnu \
22 config \
23 lib \
24 libelf \
25 libcpu \
26 backends \
27 libebl \
28 libdwelf \
29 libdwfl \
30 libdw
31
32 include $(INCLUDE_DIR)/host-build.mk
33
34 ifeq ($(HOST_OS),Darwin)
35 HOST_CFLAGS += -I/opt/homebrew/include
36 endif
37
38 HOST_CFLAGS += -Wno-error -fPIC
39
40 HOST_CONFIGURE_ARGS += \
41 --without-libintl-prefix \
42 --without-libiconv-prefix \
43 --disable-debuginfod \
44 --disable-libdebuginfod \
45 --disable-nls \
46 --disable-shared \
47 --enable-static \
48 --without-lzma \
49 --without-bzlib \
50 --without-zstd
51
52 ifeq ($(HOST_OS),Darwin)
53 HOST_CONFIGURE_ARGS += --disable-symbol-versioning
54 endif
55
56 Hooks/HostConfigure/Pre := Host/Gnulib $(Hooks/HostConfigure/Pre)
57 define Host/Gnulib
58 cd $(HOST_BUILD_DIR); $(STAGING_DIR_HOST)/bin/gnulib-tool --libtool --source-base=libgnu --import argp dirname fts obstack progname strchrnul tsearch;
59 ln -sf ../lib/eu-config.h $(HOST_BUILD_DIR)/libgnu/;
60 endef
61
62 define Host/Compile
63 $(call Host/Compile/Default,SUBDIRS='$$$$(wildcard $(PKG_SUBDIRS))')
64 endef
65
66 define Host/Install
67 $(call Host/Compile/Default,install SUBDIRS='$$$$(wildcard $(PKG_SUBDIRS))')
68 endef
69
70 define Host/Uninstall
71 -$(call Host/Compile/Default,uninstall)
72 endef
73
74 $(eval $(call HostBuild))