Use wildcards to gather plugin source files.

This commit is contained in:
Tobias Brunner
2010-03-19 13:34:53 +01:00
parent 52c7257366
commit 0f5a043989
3 changed files with 41 additions and 152 deletions
+7 -1
View File
@@ -7,9 +7,15 @@ strongswan_PLUGINS := aes des sha1 sha2 md5 fips-prf random x509 pubkey pkcs1 \
pem xcbc hmac gmp kernel-netlink socket-default attr android
# helper macros to only add source files for plugins included in the list above
# source files are relative to the android.mk that called the macro
plugin_enabled = $(findstring $(1), $(strongswan_PLUGINS))
add_plugin = $(if $(call plugin_enabled,$(1)), \
$(addprefix plugins/$(subst -,_,$(strip $(1))/),$(2)))
$(patsubst $(LOCAL_PATH)/%,%, \
$(wildcard \
$(LOCAL_PATH)/plugins/$(subst -,_,$(strip $(1)))/*.c \
) \
) \
)
# includes
strongswan_PATH := $(LOCAL_PATH)