add Build/InstallDev template to install dev files in STAGING_DIR, introduce a NEEDS: package field to implement SELECT PACKAGE_foo in menuconfig.

SVN-Revision: 3824
This commit is contained in:
Nicolas Thill 2006-05-24 07:12:59 +00:00
parent 551aff096d
commit a56e4d12e9
2 changed files with 27 additions and 0 deletions

View file

@ -29,8 +29,13 @@ define Build/DefaultTargets
$(call Build/Compile) $(call Build/Compile)
touch $$@ touch $$@
$(PKG_BUILD_DIR)/.dev-installed: $(PKG_BUILD_DIR)/.built
$(call Build/InstallDev)
touch $$@
package-clean: FORCE package-clean: FORCE
$(call Build/Clean) $(call Build/Clean)
$(call Build/UninstallDev)
package-rebuild: FORCE package-rebuild: FORCE
@-rm $(PKG_BUILD_DIR)/.built @-rm $(PKG_BUILD_DIR)/.built
@ -44,6 +49,7 @@ define Package/Default
SECTION:=opt SECTION:=opt
CATEGORY:=Extra packages CATEGORY:=Extra packages
DEPENDS:= DEPENDS:=
NEEDS:=
MAINTAINER:=OpenWrt Developers Team <openwrt-devel@openwrt.org> MAINTAINER:=OpenWrt Developers Team <openwrt-devel@openwrt.org>
SOURCE:=$(patsubst $(TOPDIR)/%,%,${shell pwd}) SOURCE:=$(patsubst $(TOPDIR)/%,%,${shell pwd})
VERSION:=$(PKG_VERSION)-$(PKG_RELEASE) VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
@ -86,6 +92,7 @@ define BuildPackage
endif endif
IDEPEND_$(1):=$$(strip $$(DEPENDS)) IDEPEND_$(1):=$$(strip $$(DEPENDS))
INEED_$(1):=$$(strip $$(NEEDS))
DUMPINFO += \ DUMPINFO += \
echo "Package: $(1)"; echo "Package: $(1)";
@ -103,6 +110,7 @@ define BuildPackage
DUMPINFO += \ DUMPINFO += \
echo "Version: $(VERSION)"; \ echo "Version: $(VERSION)"; \
echo "Depends: $$(IDEPEND_$(1))"; \ echo "Depends: $$(IDEPEND_$(1))"; \
echo "Needs: $$(INEED_$(1))"; \
echo "Category: $(CATEGORY)"; \ echo "Category: $(CATEGORY)"; \
echo "Title: $(TITLE)"; \ echo "Title: $(TITLE)"; \
echo "Description: $(DESCRIPTION)" | sed -e 's,\\,\n,g'; echo "Description: $(DESCRIPTION)" | sed -e 's,\\,\n,g';
@ -147,6 +155,8 @@ define BuildPackage
$$(INFO_$(1)): $$(IPKG_$(1)) $$(INFO_$(1)): $$(IPKG_$(1))
$(IPKG) install $$(IPKG_$(1)) $(IPKG) install $$(IPKG_$(1))
compile-targets: $(PKG_BUILD_DIR)/.dev-installed
$(1)-clean: $(1)-clean:
rm -f $(PACKAGE_DIR)/$(1)_* rm -f $(PACKAGE_DIR)/$(1)_*
@ -183,10 +193,14 @@ define Build/Configure/Default
[ -x configure ] && \ [ -x configure ] && \
$(TARGET_CONFIGURE_OPTS) \ $(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS)" \ CFLAGS="$(TARGET_CFLAGS)" \
CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
./configure \ ./configure \
--target=$(GNU_TARGET_NAME) \ --target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \ --host=$(GNU_TARGET_NAME) \
--build=$(GNU_HOST_NAME) \ --build=$(GNU_HOST_NAME) \
--program-prefix="" \
--program-suffix="" \
--prefix=/usr \ --prefix=/usr \
--exec-prefix=/usr \ --exec-prefix=/usr \
--bindir=/usr/bin \ --bindir=/usr/bin \
@ -222,10 +236,16 @@ define Build/Compile
$(call Build/Compile/Default,) $(call Build/Compile/Default,)
endef endef
define Build/InstallDev
endef
define Build/Clean define Build/Clean
$(MAKE) clean $(MAKE) clean
endef endef
define Build/UninstallDev
endef
ifneq ($(DUMP),) ifneq ($(DUMP),)
dumpinfo: FORCE dumpinfo: FORCE
@$(DUMPINFO) @$(DUMPINFO)

View file

@ -28,6 +28,9 @@ sub print_category($) {
foreach my $depend (@{$pkg->{depends}}) { foreach my $depend (@{$pkg->{depends}}) {
print "\t\tdepends PACKAGE_$depend\n"; print "\t\tdepends PACKAGE_$depend\n";
} }
foreach my $need (@{$pkg->{needs}}) {
print "\t\tselect PACKAGE_$need\n";
}
print "\t\thelp\n"; print "\t\thelp\n";
print $pkg->{description}; print $pkg->{description};
print "\n"; print "\n";
@ -63,6 +66,10 @@ while ($line = <>) {
my @dep = split /,\s*/, $1; my @dep = split /,\s*/, $1;
$pkg->{depends} = \@dep; $pkg->{depends} = \@dep;
}; };
$line =~ /^Needs: \s*(.+)\s*$/ and do {
my @need = split /,\s*/, $1;
$pkg->{needs} = \@need;
};
$line =~ /^Category: \s*(.+)\s*$/ and do { $line =~ /^Category: \s*(.+)\s*$/ and do {
$pkg->{category} = $1; $pkg->{category} = $1;
defined $category{$1} or $category{$1} = {}; defined $category{$1} or $category{$1} = {};