build: Move config file handling into build.rules
This will make it easier to split out the handling in a proper way, and handle common cflags/dependencies. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
0430bc8267
commit
0464d5d5d6
3 changed files with 24 additions and 25 deletions
|
@ -1,5 +1,5 @@
|
||||||
ALL=hostapd hostapd_cli
|
ALL=hostapd hostapd_cli
|
||||||
VERIFY=verify_config
|
CONFIG_FILE = .config
|
||||||
|
|
||||||
include ../src/build.rules
|
include ../src/build.rules
|
||||||
|
|
||||||
|
@ -27,8 +27,6 @@ CFLAGS += -I$(abspath ../src/utils)
|
||||||
|
|
||||||
export BINDIR ?= /usr/local/bin/
|
export BINDIR ?= /usr/local/bin/
|
||||||
|
|
||||||
-include .config
|
|
||||||
|
|
||||||
ifndef CONFIG_NO_GITVER
|
ifndef CONFIG_NO_GITVER
|
||||||
# Add VERSION_STR postfix for builds from a git repository
|
# Add VERSION_STR postfix for builds from a git repository
|
||||||
ifeq ($(wildcard ../.git),../.git)
|
ifeq ($(wildcard ../.git),../.git)
|
||||||
|
@ -1261,15 +1259,6 @@ ifdef CONFIG_NO_TKIP
|
||||||
CFLAGS += -DCONFIG_NO_TKIP
|
CFLAGS += -DCONFIG_NO_TKIP
|
||||||
endif
|
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)/%: %
|
$(DESTDIR)$(BINDIR)/%: %
|
||||||
install -D $(<) $(@)
|
install -D $(<) $(@)
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: $(VERIFY) $(ALL) $(EXTRA_TARGETS)
|
all: _all
|
||||||
|
|
||||||
# disable built-in rules
|
# disable built-in rules
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
|
@ -23,6 +23,27 @@ ifndef CFLAGS
|
||||||
CFLAGS = -MMD -O2 -Wall -g
|
CFLAGS = -MMD -O2 -Wall -g
|
||||||
endif
|
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=@
|
Q=@
|
||||||
E=echo
|
E=echo
|
||||||
ifeq ($(V), 1)
|
ifeq ($(V), 1)
|
||||||
|
|
|
@ -14,9 +14,9 @@ ifdef CONFIG_BUILD_WPA_CLIENT_SO
|
||||||
ALL += libwpa_client.so
|
ALL += libwpa_client.so
|
||||||
endif
|
endif
|
||||||
|
|
||||||
VERIFY=verify_config
|
|
||||||
EXTRA_TARGETS=dynamic_eap_methods
|
EXTRA_TARGETS=dynamic_eap_methods
|
||||||
|
|
||||||
|
CONFIG_FILE=.config
|
||||||
include ../src/build.rules
|
include ../src/build.rules
|
||||||
|
|
||||||
ifdef LIBS
|
ifdef LIBS
|
||||||
|
@ -39,8 +39,6 @@ CFLAGS += $(EXTRA_CFLAGS)
|
||||||
CFLAGS += -I$(abspath ../src)
|
CFLAGS += -I$(abspath ../src)
|
||||||
CFLAGS += -I$(abspath ../src/utils)
|
CFLAGS += -I$(abspath ../src/utils)
|
||||||
|
|
||||||
-include .config
|
|
||||||
|
|
||||||
ifndef CONFIG_NO_GITVER
|
ifndef CONFIG_NO_GITVER
|
||||||
# Add VERSION_STR postfix for builds from a git repository
|
# Add VERSION_STR postfix for builds from a git repository
|
||||||
ifeq ($(wildcard ../.git),../.git)
|
ifeq ($(wildcard ../.git),../.git)
|
||||||
|
@ -57,15 +55,6 @@ CONFIG_WPS_TESTING=y
|
||||||
CONFIG_TDLS_TESTING=y
|
CONFIG_TDLS_TESTING=y
|
||||||
endif
|
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:
|
mkconfig:
|
||||||
@if [ -f .config ]; then \
|
@if [ -f .config ]; then \
|
||||||
echo '.config exists - did not replace it'; \
|
echo '.config exists - did not replace it'; \
|
||||||
|
|
Loading…
Reference in a new issue