Commit 0f55fe91 authored by Bernhard Reutner-Fischer's avatar Bernhard Reutner-Fischer
Browse files

- extend AUTOTARGETS with an argument DIR_PREFIX for the location of the package

  (Ivan Kuten)
parent 01fee651
Loading
Loading
Loading
Loading
+14 −19
Original line number Diff line number Diff line
@@ -58,6 +58,8 @@
# FOO_SUBDIR [default empty]
#	relative path in the package source from which to run configure and
#	make
# FOO_DIR_PREFIX [default empty]
#	toplevel relative path to package *.mk file and corresponding patches
#
## The following variables contain hook target names
## by default they do nothing, they can be overriden in package makefiles
@@ -151,23 +153,13 @@ $(BUILD_DIR)/%/.stamp_patched:
	$(call MESSAGE,"Patching")
	$(if $($(PKG)_PATCH),toolchain/patch-kernel.sh $(@D) $(DL_DIR) $($(PKG)_PATCH))
	$(Q)(\
	if test -d package/$($(PKG)_NAME) ; then \
	  if test "$(wildcard package/$($(PKG)_NAME)/$(NAMEVER)*.patch)" ; then \
	    toolchain/patch-kernel.sh $(@D) package/$($(PKG)_NAME) $(NAMEVER)\*.patch || exit 1 ; \
	if test -d $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME) ; then \
	  if test "$(wildcard $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME)/$(NAMEVER)*.patch)" ; then \
	    toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME) $(NAMEVER)\*.patch || exit 1 ; \
	  else \
	    toolchain/patch-kernel.sh $(@D) package/$($(PKG)_NAME) $($(PKG)_NAME)\*.patch || exit 1 ; \
	    if test -d package/$($(PKG)_NAME)/$(NAMEVER) ; then \
	      toolchain/patch-kernel.sh $(@D) package/$($(PKG)_NAME)/$(NAMEVER) \*.patch || exit 1 ; \
	    fi; \
	  fi; \
	else \
	  echo "This must be wrong. Why do you need to special-case _any_ package here? Skipping until this is resolved properly."; \
	  if false && test "$(wildcard package/x11r7/$($(PKG)_NAME)/$(NAMEVER)*.patch)" ; then \
	    toolchain/patch-kernel.sh $(@D) package/x11r7/$($(PKG)_NAME) $(NAMEVER)\*.patch || exit 1 ; \
	  else \
	    toolchain/patch-kernel.sh $(@D) package/x11r7/$($(PKG)_NAME) $($(PKG)_NAME)\*.patch || exit 1 ; \
	    if test -d package/x11r7/$($(PKG)_NAME)/$(NAMEVER) ; then \
	      toolchain/patch-kernel.sh $(@D) package/x11r7/$($(PKG)_NAME)/$(NAMEVER) \*.patch || exit 1 ; \
	    toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME) $($(PKG)_NAME)\*.patch || exit 1 ; \
	    if test -d package/$($(PKG)_DIR_PREFIX)/$($(PKG)_NAME)/$(NAMEVER) ; then \
	      toolchain/patch-kernel.sh $(@D) $($(PKG)_DIR_PREFIX)/$($(PKG)_NAME)/$(NAMEVER) \*.patch || exit 1 ; \
	    fi; \
	  fi; \
	fi; \
@@ -258,15 +250,17 @@ $(BUILD_DIR)/%/.stamp_dircleaned:
################################################################################
# AUTOTARGETS -- the target generator macro; define a set of human-readable 
# make targets, stamps, and default per-package variables.
# Argument 1 is the (lowercase) package name.
# Argument 1 is the package directory prefix.
# Argument 2 is the (lowercase) package name.
################################################################################

define AUTOTARGETS
$(call AUTOTARGETS_INNER,$(1),$(call UPPERCASE,$(1)))
$(call AUTOTARGETS_INNER,$(2),$(call UPPERCASE,$(2)),$(1))
endef
      
# AUTOTARGETS_INNER -- does the job for AUTOTARGETS; argument 1 is the
# lowercase package name, argument 2 the uppercase package name
# lowercase package name, argument 2 the uppercase package name,
# argument 3 the package directory prefix
define AUTOTARGETS_INNER

# define package-specific variables to default values
@@ -290,6 +284,7 @@ $(2)_CLEAN_OPT ?= clean
$(2)_UNINSTALL_STAGING_OPT	?= DESTDIR=$$(STAGING_DIR) uninstall
$(2)_UNINSTALL_TARGET_OPT	?= DESTDIR=$$(TARGET_DIR)  uninstall
$(2)_SUBDIR			?=
$(2)_DIR_PREFIX			=  $(if $(3),$(3),$(TOP_SRCDIR)/package)


# define sub-target stamps
+1 −1
Original line number Diff line number Diff line
@@ -13,5 +13,5 @@ LIBXCB_AUTORECONF = YES
LIBXCB_DEPENDENCIES = pthread-stubs xcb-proto xlib_libXdmcp xlib_libXau
LIBXCB_CONF_ENV = STAGING_DIR="$(STAGING_DIR)"

$(eval $(call AUTOTARGETS,libxcb))
$(eval $(call AUTOTARGETS,package/x11r7,libxcb))
+1 −1
Original line number Diff line number Diff line
@@ -12,4 +12,4 @@ OPENCHROME_DEPENDENCIES = xserver_xorg-server libdrm xlib_libX11 xlib_libXvMC xp
OPENCHROME_AUTORECONF = YES
OPENCHROME_CONF_OPT = --enable-shared --disable-static

$(eval $(call AUTOTARGETS,openchrome))
$(eval $(call AUTOTARGETS,package/x11r7,openchrome))
+1 −1
Original line number Diff line number Diff line
@@ -10,5 +10,5 @@ PTHREAD_STUBS_SITE = http://xcb.freedesktop.org/dist/
PTHREAD_STUBS_DEPENDENCIES = uclibc
PTHREAD_STUBS_INSTALL_STAGING = YES

$(eval $(call AUTOTARGETS,pthread-stubs))
$(eval $(call AUTOTARGETS,package/x11r7,pthread-stubs))
+1 −1
Original line number Diff line number Diff line
@@ -10,4 +10,4 @@ XAPP_APPRES_SITE = http://xorg.freedesktop.org/releases/individual/app
XAPP_APPRES_AUTORECONF = YES
XAPP_APPRES_DEPENDENCIES = xlib_libX11 xlib_libXt

$(eval $(call AUTOTARGETS,xapp_appres))
$(eval $(call AUTOTARGETS,package/x11r7,xapp_appres))
Loading