ALL=hostapd hostapd_cli
-VERIFY=verify_config
+CONFIG_FILE = .config
include ../src/build.rules
export BINDIR ?= /usr/local/bin/
--include .config
-
ifndef CONFIG_NO_GITVER
# Add VERSION_STR postfix for builds from a git repository
ifeq ($(wildcard ../.git),../.git)
CFLAGS += -DCONFIG_NO_TKIP
endif
-verify_config:
- @if [ ! -r .config ]; then \
- echo 'Building hostapd requires a configuration file'; \
- echo '(.config). See README for more instructions. You can'; \
- echo 'run "cp defconfig .config" to create an example'; \
- echo 'configuration.'; \
- exit 1; \
- fi
-
$(DESTDIR)$(BINDIR)/%: %
install -D $(<) $(@)
.PHONY: all
-all: $(VERIFY) $(ALL) $(EXTRA_TARGETS)
+all: _all
# disable built-in rules
.SUFFIXES:
CFLAGS = -MMD -O2 -Wall -g
endif
+ifneq ($(CONFIG_FILE),)
+-include $(CONFIG_FILE)
+
+.PHONY: verify_config
+verify_config:
+ @if [ ! -r $(CONFIG_FILE) ]; then \
+ echo 'Building $(firstword $(ALL)) requires a configuration file'; \
+ echo '(.config). See README for more instructions. You can'; \
+ echo 'run "cp defconfig .config" to create an example'; \
+ echo 'configuration.'; \
+ exit 1; \
+ fi
+VERIFY := verify_config
+else
+VERIFY :=
+endif
+
+# default target
+.PHONY: _all
+_all: $(VERIFY) $(ALL) $(EXTRA_TARGETS)
+
Q=@
E=echo
ifeq ($(V), 1)
ALL += libwpa_client.so
endif
-VERIFY=verify_config
EXTRA_TARGETS=dynamic_eap_methods
+CONFIG_FILE=.config
include ../src/build.rules
ifdef LIBS
CFLAGS += -I$(abspath ../src)
CFLAGS += -I$(abspath ../src/utils)
--include .config
-
ifndef CONFIG_NO_GITVER
# Add VERSION_STR postfix for builds from a git repository
ifeq ($(wildcard ../.git),../.git)
CONFIG_TDLS_TESTING=y
endif
-verify_config:
- @if [ ! -r .config ]; then \
- echo 'Building wpa_supplicant requires a configuration file'; \
- echo '(.config). See README for more instructions. You can'; \
- echo 'run "cp defconfig .config" to create an example'; \
- echo 'configuration.'; \
- exit 1; \
- fi
-
mkconfig:
@if [ -f .config ]; then \
echo '.config exists - did not replace it'; \