Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 1 | ################################################################################ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 2 | # Autotools package infrastructure |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 3 | # |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 4 | # This file implements an infrastructure that eases development of |
| 5 | # package .mk files for autotools packages. It should be used for all |
| 6 | # packages that use the autotools as their build system. Non-autotools |
| 7 | # packages should use the generic infrastructure in |
| 8 | # package/Makefile.package.in. |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 9 | # |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 10 | # See the Buildroot documentation for details on the usage of this |
| 11 | # infrastructure |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 12 | # |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 13 | # In terms of implementation, this autotools infrastructure requires |
| 14 | # the .mk file to only specify metadata informations about the |
| 15 | # package: name, version, download URL, etc. |
Bernhard Reutner-Fischer | 00b8456 | 2007-09-30 12:46:02 +0000 | [diff] [blame] | 16 | # |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 17 | # We still allow the package .mk file to override what the different |
| 18 | # steps are doing, if needed. For example, if <PKG>_BUILD_CMDS is |
| 19 | # already defined, it is used as the list of commands to perform to |
| 20 | # build the package, instead of the default autotools behaviour. The |
| 21 | # package can also define some post operation hooks. |
Bernhard Reutner-Fischer | 00b8456 | 2007-09-30 12:46:02 +0000 | [diff] [blame] | 22 | # |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 23 | ################################################################################ |
| 24 | |
Thomas Petazzoni | 102a93b | 2011-08-31 23:35:06 +0200 | [diff] [blame^] | 25 | |
| 26 | # |
| 27 | # Utility function to upgrade config.sub and config.guess files |
| 28 | # |
| 29 | # argument 1 : directory into which config.guess and config.sub need |
| 30 | # to be updated. Note that config.sub and config.guess are searched |
| 31 | # recursively in this directory. |
| 32 | # |
| 33 | define CONFIG_UPDATE |
| 34 | for file in config.guess config.sub; do \ |
| 35 | for i in $$(find $(1) -name $$file); do \ |
| 36 | cp support/gnuconfig/$$file $$i; \ |
| 37 | done; \ |
| 38 | done |
| 39 | endef |
| 40 | |
Peter Korsgaard | d58636d | 2009-01-16 10:27:48 +0000 | [diff] [blame] | 41 | ################################################################################ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 42 | # AUTOTARGETS_INNER -- defines how the configuration, compilation and |
| 43 | # installation of an autotools package should be done, implements a |
| 44 | # few hooks to tune the build process for autotools specifities and |
| 45 | # calls the generic package infrastructure to generate the necessary |
| 46 | # make targets |
Peter Korsgaard | d58636d | 2009-01-16 10:27:48 +0000 | [diff] [blame] | 47 | # |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 48 | # argument 1 is the lowercase package name |
| 49 | # argument 2 is the uppercase package name, including an HOST_ prefix |
| 50 | # for host packages |
| 51 | # argument 3 is the uppercase package name, without the HOST_ prefix |
| 52 | # for host packages |
| 53 | # argument 4 is the package directory prefix |
| 54 | # argument 5 is the type (target or host) |
Peter Korsgaard | d58636d | 2009-01-16 10:27:48 +0000 | [diff] [blame] | 55 | ################################################################################ |
| 56 | |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 57 | define AUTOTARGETS_INNER |
| 58 | |
| 59 | # define package-specific variables to default values |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 60 | ifndef $(2)_SUBDIR |
| 61 | ifdef $(3)_SUBDIR |
| 62 | $(2)_SUBDIR = $($(3)_SUBDIR) |
| 63 | else |
| 64 | $(2)_SUBDIR ?= |
| 65 | endif |
| 66 | endif |
| 67 | |
Thomas Petazzoni | d2c73f5 | 2010-04-28 23:40:45 +0200 | [diff] [blame] | 68 | ifndef $(2)_LIBTOOL_PATCH |
| 69 | ifdef $(3)_LIBTOOL_PATCH |
| 70 | $(2)_LIBTOOL_PATCH = $($(3)_LIBTOOL_PATCH) |
| 71 | else |
| 72 | $(2)_LIBTOOL_PATCH ?= YES |
| 73 | endif |
| 74 | endif |
| 75 | |
Peter Korsgaard | ce1ae87 | 2011-05-17 10:00:01 +0200 | [diff] [blame] | 76 | ifndef $(2)_MAKE |
| 77 | ifdef $(3)_MAKE |
| 78 | $(2)_MAKE = $($(3)_MAKE) |
| 79 | else |
| 80 | $(2)_MAKE ?= $(MAKE) |
| 81 | endif |
| 82 | endif |
| 83 | |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 84 | $(2)_CONF_ENV ?= |
| 85 | $(2)_CONF_OPT ?= |
Bernhard Reutner-Fischer | 00b8456 | 2007-09-30 12:46:02 +0000 | [diff] [blame] | 86 | $(2)_MAKE_ENV ?= |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 87 | $(2)_MAKE_OPT ?= |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 88 | $(2)_AUTORECONF ?= NO |
| 89 | $(2)_AUTORECONF_OPT ?= |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 90 | $(2)_INSTALL_STAGING_OPT ?= DESTDIR=$$(STAGING_DIR) install |
Paulius Zaleckas | 31365de | 2010-03-30 17:20:55 +0200 | [diff] [blame] | 91 | $(2)_INSTALL_TARGET_OPT ?= DESTDIR=$$(TARGET_DIR) install |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 92 | $(2)_CLEAN_OPT ?= clean |
| 93 | $(2)_UNINSTALL_STAGING_OPT ?= DESTDIR=$$(STAGING_DIR) uninstall |
| 94 | $(2)_UNINSTALL_TARGET_OPT ?= DESTDIR=$$(TARGET_DIR) uninstall |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 95 | |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 96 | $(2)_SRCDIR = $$($(2)_DIR)/$($(2)_SUBDIR) |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 97 | |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 98 | # |
| 99 | # Configure step. Only define it if not already defined by the package |
| 100 | # .mk file. And take care of the differences between host and target |
| 101 | # packages. |
| 102 | # |
| 103 | ifndef $(2)_CONFIGURE_CMDS |
| 104 | ifeq ($(5),target) |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 105 | |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 106 | # Configure package for target |
| 107 | define $(2)_CONFIGURE_CMDS |
| 108 | (cd $$($$(PKG)_SRCDIR) && rm -rf config.cache && \ |
| 109 | $$(TARGET_CONFIGURE_OPTS) \ |
| 110 | $$(TARGET_CONFIGURE_ARGS) \ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 111 | $$($$(PKG)_CONF_ENV) \ |
| 112 | ./configure \ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 113 | --target=$$(GNU_TARGET_NAME) \ |
| 114 | --host=$$(GNU_TARGET_NAME) \ |
| 115 | --build=$$(GNU_HOST_NAME) \ |
| 116 | --prefix=/usr \ |
| 117 | --exec-prefix=/usr \ |
| 118 | --sysconfdir=/etc \ |
Yann E. MORIN | a8d6e2c | 2011-08-10 00:12:34 +0200 | [diff] [blame] | 119 | --program-prefix="" \ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 120 | $$(DISABLE_DOCUMENTATION) \ |
| 121 | $$(DISABLE_NLS) \ |
| 122 | $$(DISABLE_LARGEFILE) \ |
| 123 | $$(DISABLE_IPV6) \ |
Thomas Petazzoni | 009d8fc | 2011-05-30 23:57:02 +0200 | [diff] [blame] | 124 | $$(SHARED_STATIC_LIBS_OPTS) \ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 125 | $$(QUIET) $$($$(PKG)_CONF_OPT) \ |
| 126 | ) |
| 127 | endef |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 128 | else |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 129 | |
| 130 | # Configure package for host |
| 131 | define $(2)_CONFIGURE_CMDS |
| 132 | (cd $$($$(PKG)_SRCDIR) && rm -rf config.cache; \ |
| 133 | $$(HOST_CONFIGURE_OPTS) \ |
| 134 | CFLAGS="$$(HOST_CFLAGS)" \ |
| 135 | LDFLAGS="$$(HOST_LDFLAGS)" \ |
Lionel Landwerlin | 1b41e32 | 2010-04-30 02:24:09 +0200 | [diff] [blame] | 136 | $$($$(PKG)_CONF_ENV) \ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 137 | ./configure \ |
| 138 | --prefix="$$(HOST_DIR)/usr" \ |
| 139 | --sysconfdir="$$(HOST_DIR)/etc" \ |
Thomas Petazzoni | 009d8fc | 2011-05-30 23:57:02 +0200 | [diff] [blame] | 140 | --enable-shared --disable-static \ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 141 | $$($$(PKG)_CONF_OPT) \ |
| 142 | ) |
| 143 | endef |
| 144 | endif |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 145 | endif |
| 146 | |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 147 | # |
| 148 | # Hook to update config.sub and config.guess if needed |
| 149 | # |
| 150 | define UPDATE_CONFIG_HOOK |
Thomas Petazzoni | 102a93b | 2011-08-31 23:35:06 +0200 | [diff] [blame^] | 151 | @$$(call MESSAGE, "Updating config.sub and config.guess") |
| 152 | $$(call CONFIG_UPDATE,$$(@D)) |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 153 | endef |
| 154 | |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 155 | $(2)_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 156 | |
| 157 | # |
| 158 | # Hook to patch libtool to make it work properly for cross-compilation |
| 159 | # |
| 160 | define LIBTOOL_PATCH_HOOK |
Lionel Landwerlin | e131773 | 2010-11-04 03:50:22 +0100 | [diff] [blame] | 161 | @$$(call MESSAGE,"Patching libtool") |
Martin Banky | 83af822 | 2010-10-09 12:52:49 +0200 | [diff] [blame] | 162 | $(Q)if test "$$($$(PKG)_LIBTOOL_PATCH)" = "YES" \ |
| 163 | -a "$$($$(PKG)_AUTORECONF)" != "YES"; then \ |
| 164 | for i in `find $$($$(PKG)_SRCDIR) -name ltmain.sh`; do \ |
| 165 | ltmain_version=`sed -n '/^[ ]*VERSION=/{s/^[ ]*VERSION=//;p;q;}' $$$$i | \ |
| 166 | sed -e 's/\([0-9].[0-9]*\).*/\1/' -e 's/\"//'`; \ |
| 167 | if test $$$${ltmain_version} = '1.5'; then \ |
Thomas Petazzoni | 59a326b | 2011-08-31 23:35:04 +0200 | [diff] [blame] | 168 | support/scripts/apply-patches.sh $$$${i%/*} support/libtool buildroot-libtool-v1.5.patch; \ |
Martin Banky | 83af822 | 2010-10-09 12:52:49 +0200 | [diff] [blame] | 169 | elif test $$$${ltmain_version} = "2.2"; then\ |
Thomas Petazzoni | 59a326b | 2011-08-31 23:35:04 +0200 | [diff] [blame] | 170 | support/scripts/apply-patches.sh $$$${i%/*} support/libtool buildroot-libtool-v2.2.patch; \ |
Peter Korsgaard | f055b26 | 2011-03-28 21:45:06 +0200 | [diff] [blame] | 171 | elif test $$$${ltmain_version} = "2.4"; then\ |
Thomas Petazzoni | 59a326b | 2011-08-31 23:35:04 +0200 | [diff] [blame] | 172 | support/scripts/apply-patches.sh $$$${i%/*} support/libtool buildroot-libtool-v2.4.patch; \ |
Martin Banky | 83af822 | 2010-10-09 12:52:49 +0200 | [diff] [blame] | 173 | fi \ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 174 | done \ |
| 175 | fi |
| 176 | endef |
| 177 | |
Peter Korsgaard | 073af42 | 2009-12-30 13:42:01 +0100 | [diff] [blame] | 178 | # default values are not evaluated yet, so don't rely on this defaulting to YES |
Thomas Petazzoni | 87d0af9 | 2010-04-28 23:40:47 +0200 | [diff] [blame] | 179 | ifneq ($$($(2)_LIBTOOL_PATCH),NO) |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 180 | $(2)_POST_PATCH_HOOKS += LIBTOOL_PATCH_HOOK |
| 181 | endif |
| 182 | |
| 183 | # |
| 184 | # Hook to autoreconf the package if needed |
| 185 | # |
| 186 | define AUTORECONF_HOOK |
Lionel Landwerlin | e131773 | 2010-11-04 03:50:22 +0100 | [diff] [blame] | 187 | @$$(call MESSAGE,"Autoreconfiguring") |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 188 | $(Q)cd $$($$(PKG)_SRCDIR) && $(AUTORECONF) $$($$(PKG)_AUTORECONF_OPT) |
Martin Banky | 83af822 | 2010-10-09 12:52:49 +0200 | [diff] [blame] | 189 | $(Q)if test "$$($$(PKG)_LIBTOOL_PATCH)" = "YES"; then \ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 190 | for i in `find $$($$(PKG)_SRCDIR) -name ltmain.sh`; do \ |
Martin Banky | 83af822 | 2010-10-09 12:52:49 +0200 | [diff] [blame] | 191 | ltmain_version=`sed -n '/^[ ]*VERSION=/{s/^[ ]*VERSION=//;p;q;}' $$$$i | sed 's/\([0-9].[0-9]*\).*/\1/'`; \ |
| 192 | if test $$$${ltmain_version} = "1.5"; then \ |
Thomas Petazzoni | 59a326b | 2011-08-31 23:35:04 +0200 | [diff] [blame] | 193 | support/scripts/apply-patches.sh $$$${i%/*} package buildroot-libtool-v1.5.patch; \ |
Martin Banky | 83af822 | 2010-10-09 12:52:49 +0200 | [diff] [blame] | 194 | elif test $$$${ltmain_version} = "2.2"; then\ |
Thomas Petazzoni | 59a326b | 2011-08-31 23:35:04 +0200 | [diff] [blame] | 195 | support/scripts/apply-patches.sh $$$${i%/*} package buildroot-libtool-v2.2.patch; \ |
Peter Korsgaard | 3178a20 | 2011-05-03 10:01:28 +0200 | [diff] [blame] | 196 | elif test $$$${ltmain_version} = "2.4"; then\ |
Thomas Petazzoni | 59a326b | 2011-08-31 23:35:04 +0200 | [diff] [blame] | 197 | support/scripts/apply-patches.sh $$$${i%/*} package buildroot-libtool-v2.4.patch; \ |
Martin Banky | 83af822 | 2010-10-09 12:52:49 +0200 | [diff] [blame] | 198 | fi \ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 199 | done \ |
| 200 | fi |
| 201 | endef |
| 202 | |
Thomas Petazzoni | 7dfa3b3 | 2010-04-28 23:40:42 +0200 | [diff] [blame] | 203 | ifeq ($$($(2)_AUTORECONF),YES) |
Lionel Landwerlin | 89d1ad9 | 2010-11-04 03:50:24 +0100 | [diff] [blame] | 204 | $(2)_PRE_CONFIGURE_HOOKS += AUTORECONF_HOOK |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 205 | $(2)_DEPENDENCIES += host-automake host-autoconf host-libtool |
| 206 | endif |
| 207 | |
| 208 | # |
| 209 | # Build step. Only define it if not already defined by the package .mk |
| 210 | # file. |
| 211 | # |
| 212 | ifndef $(2)_BUILD_CMDS |
| 213 | ifeq ($(5),target) |
| 214 | define $(2)_BUILD_CMDS |
| 215 | $(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPT) -C $$($$(PKG)_SRCDIR) |
| 216 | endef |
| 217 | else |
| 218 | define $(2)_BUILD_CMDS |
| 219 | $(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPT) -C $$($$(PKG)_SRCDIR) |
| 220 | endef |
| 221 | endif |
| 222 | endif |
| 223 | |
| 224 | # |
| 225 | # Host installation step. Only define it if not already defined by the |
| 226 | # package .mk file. |
| 227 | # |
| 228 | ifndef $(2)_INSTALL_CMDS |
| 229 | define $(2)_INSTALL_CMDS |
Thomas Petazzoni | b06e7ac | 2011-01-23 17:08:53 +0100 | [diff] [blame] | 230 | $(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) -C $$($$(PKG)_SRCDIR) install |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 231 | endef |
| 232 | endif |
| 233 | |
| 234 | # |
| 235 | # Staging installation step. Only define it if not already defined by |
| 236 | # the package .mk file. |
| 237 | # |
| 238 | ifndef $(2)_INSTALL_STAGING_CMDS |
| 239 | define $(2)_INSTALL_STAGING_CMDS |
Thomas Petazzoni | 600d1f8 | 2010-12-13 17:27:50 +0100 | [diff] [blame] | 240 | $(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_STAGING_OPT) -C $$($$(PKG)_SRCDIR) |
Peter Korsgaard | ecf5939 | 2010-01-18 14:53:06 +0100 | [diff] [blame] | 241 | for i in $$$$(find $(STAGING_DIR)/usr/lib* -name "*.la"); do \ |
Lionel Landwerlin | e8b469b | 2010-04-30 02:24:06 +0200 | [diff] [blame] | 242 | cp -f $$$$i $$$$i~; \ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 243 | $$(SED) "s:\(['= ]\)/usr:\\1$(STAGING_DIR)/usr:g" $$$$i; \ |
| 244 | done |
| 245 | endef |
| 246 | endif |
| 247 | |
| 248 | # |
| 249 | # Target installation step. Only define it if not already defined by |
| 250 | # the package .mk file. |
| 251 | # |
| 252 | ifndef $(2)_INSTALL_TARGET_CMDS |
| 253 | define $(2)_INSTALL_TARGET_CMDS |
Thomas Petazzoni | 600d1f8 | 2010-12-13 17:27:50 +0100 | [diff] [blame] | 254 | $(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_TARGET_OPT) -C $$($$(PKG)_SRCDIR) |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 255 | endef |
| 256 | endif |
| 257 | |
| 258 | # |
| 259 | # Clean step. Only define it if not already defined by |
| 260 | # the package .mk file. |
| 261 | # |
| 262 | ifndef $(2)_CLEAN_CMDS |
| 263 | define $(2)_CLEAN_CMDS |
Thomas Petazzoni | 600d1f8 | 2010-12-13 17:27:50 +0100 | [diff] [blame] | 264 | -$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_CLEAN_OPT) -C $$($$(PKG)_SRCDIR) |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 265 | endef |
| 266 | endif |
| 267 | |
| 268 | # |
| 269 | # Uninstall from staging step. Only define it if not already defined by |
| 270 | # the package .mk file. |
| 271 | # |
| 272 | ifndef $(2)_UNINSTALL_STAGING_CMDS |
| 273 | define $(2)_UNINSTALL_STAGING_CMDS |
Thomas Petazzoni | 600d1f8 | 2010-12-13 17:27:50 +0100 | [diff] [blame] | 274 | $(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_UNINSTALL_STAGING_OPT) -C $$($$(PKG)_SRCDIR) |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 275 | endef |
| 276 | endif |
| 277 | |
| 278 | # |
| 279 | # Uninstall from target step. Only define it if not already defined |
| 280 | # by the package .mk file. |
| 281 | # |
| 282 | ifndef $(2)_UNINSTALL_TARGET_CMDS |
| 283 | define $(2)_UNINSTALL_TARGET_CMDS |
Thomas Petazzoni | 600d1f8 | 2010-12-13 17:27:50 +0100 | [diff] [blame] | 284 | $(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_UNINSTALL_TARGET_OPT) -C $$($$(PKG)_SRCDIR) |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 285 | endef |
| 286 | endif |
| 287 | |
| 288 | # Call the generic package infrastructure to generate the necessary |
| 289 | # make targets |
| 290 | $(call GENTARGETS_INNER,$(1),$(2),$(3),$(4),$(5)) |
| 291 | |
| 292 | endef |
| 293 | |
| 294 | ################################################################################ |
| 295 | # AUTOTARGETS -- the target generator macro for autotools packages |
| 296 | # |
| 297 | # Argument 1 is the package directory prefix [mandatory] |
| 298 | # Argument 2 is the lowercase package name [mandatory] |
| 299 | # Argument 3 is "target" or "host" [optional, default: "target"] |
| 300 | ################################################################################ |
| 301 | |
| 302 | define AUTOTARGETS |
| 303 | ifeq ($(3),host) |
| 304 | $(call AUTOTARGETS_INNER,$(3)-$(2),$(call UPPERCASE,$(3)-$(2)),$(call UPPERCASE,$(2)),$(1),host) |
| 305 | else |
| 306 | $(call AUTOTARGETS_INNER,$(2),$(call UPPERCASE,$(2)),$(call UPPERCASE,$(2)),$(1),target) |
| 307 | endif |
| 308 | endef |