kumquat-buildroot/package/aircrack-ng/aircrack-ng.mk

73 lines
2.0 KiB
Makefile
Raw Normal View History

################################################################################
#
# aircrack-ng
#
################################################################################
AIRCRACK_NG_VERSION = 1.2-rc4
AIRCRACK_NG_SITE = http://download.aircrack-ng.org
AIRCRACK_NG_LICENSE = GPL-2.0+
AIRCRACK_NG_LICENSE_FILES = LICENSE
AIRCRACK_NG_DEPENDENCIES = openssl zlib host-pkgconf
# Enable buddy-ng, easside-ng, tkiptun-ng, wesside-ng
AIRCRACK_NG_MAKE_OPTS = unstable=true
# Account for libpthread in static
AIRCRACK_NG_LDFLAGS = $(TARGET_LDFLAGS) \
$(if $(BR2_STATIC_LIBS),-lpthread -lz)
# libnl support has issues when building static
ifeq ($(BR2_STATIC_LIBS),y)
AIRCRACK_NG_MAKE_OPTS += libnl=false
else
AIRCRACK_NG_MAKE_OPTS += libnl=true
AIRCRACK_NG_DEPENDENCIES += libnl
endif
ifeq ($(BR2_TOOLCHAIN_HAS_SSP),y)
AIRCRACK_NG_MAKE_OPTS += STACK_PROTECTOR=true
else
AIRCRACK_NG_MAKE_OPTS += STACK_PROTECTOR=false
endif
ifeq ($(BR2_PACKAGE_LIBPCAP),y)
AIRCRACK_NG_DEPENDENCIES += libpcap
AIRCRACK_NG_MAKE_OPTS += HAVE_PCAP=yes \
packages: use backtick instead of $(shell ...) make function It is often difficult to know exactly when make will expand the variable, and usually it can only be expanded after the dependencies have been built (e.g. pkg-config or the .pc file). Using a backtick instead makes it very clear that it will be expanded only while executing the command. This change is useful for two cases: 1. The per-package staging (and host) directory will be created as part of the configure step, so any $(shell ...) variable that is used in the configure step will fail because the directory doesn't exist yet. 2. 'make printvars' evaluates the variables it prints. It will therefore trigger a lot of errors from missing .pc files and others. The backticks, on the other hand, are not expanded, so with this change the output of 'make printvars' becomes clean again. This commit contains only the easy changes: replace $(shell ...) with `...`, and also replace ' with " where needed. Follow-up commits will tackle the more complicated cases that need additional explanation. After this change, the following instances of $(shell ...) will remain: - All assignments that use := - All variables that are used in make conditionals (which don't expand the backticks). - All variables that only refer to system executables and make variables that don't change. - The calls to check-host-* in dependencies.mk, because it is eval'ed. [Original patch by Fabio Porcedda, but extended quite a bit by Arnout.] Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-07-12 16:35:26 +02:00
$(if $(BR2_STATIC_LIBS),LIBPCAP="-lpcap `$(STAGING_DIR)/usr/bin/pcap-config --static --additional-libs`")
else
AIRCRACK_NG_MAKE_OPTS += HAVE_PCAP=no
endif
ifeq ($(BR2_PACKAGE_PCRE),y)
AIRCRACK_NG_DEPENDENCIES += pcre
AIRCRACK_NG_MAKE_OPTS += pcre=true
else
AIRCRACK_NG_MAKE_OPTS += pcre=false
endif
# Duplicate -lpthread, because it is also needed by sqlite
ifeq ($(BR2_PACKAGE_SQLITE),y)
AIRCRACK_NG_DEPENDENCIES += sqlite
AIRCRACK_NG_MAKE_OPTS += sqlite=true LIBSQL="-lsqlite3 $(if $(BR2_STATIC_LIBS),-lpthread)"
else
AIRCRACK_NG_MAKE_OPTS += sqlite=false
endif
ifeq ($(BR2_X86_CPU_HAS_SSE),y)
AIRCRACK_NG_MAKE_OPTS += NEWSSE=true
else
AIRCRACK_NG_MAKE_OPTS += NEWSSE=false
endif
define AIRCRACK_NG_BUILD_CMDS
$(TARGET_CONFIGURE_OPTS) LDFLAGS="$(AIRCRACK_NG_LDFLAGS)" \
$(MAKE) -C $(@D) $(AIRCRACK_NG_MAKE_OPTS)
endef
define AIRCRACK_NG_INSTALL_TARGET_CMDS
$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) \
prefix=/usr $(AIRCRACK_NG_MAKE_OPTS) install
endef
$(eval $(generic-package))