gettext-full: override SUBDIRS variable with Makefile
[openwrt/openwrt.git] / package / libs / gettext-full / Makefile
index 2319401baf5ba1f2ddbd74c0d3a21fd2ee9d5366..6e185a37ab71337be94a90625c5da720bbe542a6 100644 (file)
@@ -27,6 +27,35 @@ PKG_BUILD_DEPENDS:=gettext-full/host
 PKG_BUILD_PARALLEL:=0
 HOST_BUILD_PARALLEL:=0
 
+PKG_SUBDIRS:= \
+       $$$$(foreach dir, \
+               intl \
+               intl-csharp \
+               intl-java \
+               its \
+               gnulib-lib \
+               gnulib-local \
+               lib \
+               $$$$(SUBDIR_libasprintf) \
+               libgettextpo \
+               libgrep \
+               libtextstyle \
+               m4 \
+               misc \
+               po \
+               projects \
+               src \
+               styles \
+               gettext-runtime \
+               gettext-tools \
+       ,$$$$(wildcard $$$$(dir)) )
+
+PKG_MAKEFILES_FAKE:= \
+       gnulib-local/m4/Makefile \
+       libtextstyle/gnulib-local/Makefile \
+       libtextstyle/m4/Makefile \
+       m4/Makefile
+
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/host-build.mk
 
@@ -75,6 +104,16 @@ HOST_CONFIGURE_VARS += \
 
 HOST_CFLAGS += $(HOST_FPIC)
 
+define Host/Compile
+       $(foreach makefile,$(PKG_MAKEFILES_FAKE),printf '%s\n%s\n' 'all:' 'install:' > $(HOST_BUILD_DIR)/$(makefile); )
+       $(call Host/Compile/Default,SUBDIRS='$(PKG_SUBDIRS)')
+endef
+
+define Build/Compile
+       $(foreach makefile,$(PKG_MAKEFILES_FAKE),printf '%s\n%s\n' 'all:' 'install:' > $(PKG_BUILD_DIR)/$(makefile); )
+       $(call Build/Compile/Default,SUBDIRS='$(PKG_SUBDIRS)')
+endef
+
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/lib/libintl-full/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/libintl.h $(1)/usr/lib/libintl-full/include/
@@ -89,10 +128,14 @@ define Build/InstallDev
 endef
 
 define Host/Install
-       $(call Host/Install/Default)
+       $(call Host/Compile/Default,install SUBDIRS='$(PKG_SUBDIRS)')
        $(LN) msgfmt $(STAGING_DIR_HOSTPKG)/bin/gmsgfmt
 endef
 
+define Build/Install
+       $(call Build/Install/Default,install SUBDIRS='$(PKG_SUBDIRS)')
+endef
+
 define Package/libintl-full/install
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libintl.so.* $(1)/usr/lib/