aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/Makefile
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-12-25 11:44:38 (GMT)
committerJouni Malinen <j@w1.fi>2013-12-26 11:37:06 (GMT)
commita4cfb486940e1f99a7ba2f0c9231a5c236ed7eda (patch)
tree36241f1e6693e5829366e9a8a56ab4a90412e4cc /wpa_supplicant/Makefile
parent0eff1ab3cb2c825d65f1afe0f3706f2aabaaa488 (diff)
downloadhostap-a4cfb486940e1f99a7ba2f0c9231a5c236ed7eda.zip
hostap-a4cfb486940e1f99a7ba2f0c9231a5c236ed7eda.tar.gz
hostap-a4cfb486940e1f99a7ba2f0c9231a5c236ed7eda.tar.bz2
Add make lcov-html to generate code coverage report
In addition, update build rules to compile object files in the same directory as the source code file if CONFIG_CODE_COVERAGE=y is set to make lcov find the source code files. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/Makefile')
-rw-r--r--wpa_supplicant/Makefile16
1 files changed, 14 insertions, 2 deletions
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 260c0ae..8ade64c 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -10,8 +10,8 @@ export LIBDIR ?= /usr/local/lib/
export BINDIR ?= /usr/local/sbin/
PKG_CONFIG ?= pkg-config
-CFLAGS += -I../src
-CFLAGS += -I../src/utils
+CFLAGS += -I$(abspath ../src)
+CFLAGS += -I$(abspath ../src/utils)
-include .config
@@ -1622,9 +1622,15 @@ eap_eke.so: ../src/eap_peer/eap_eke.c ../src/eap_common/eap_eke_common.c
$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \
-D$(*F:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init
+ifdef CONFIG_CODE_COVERAGE
+%.o: %.c
+ @$(E) " CC " $<
+ $(Q)cd $(dir $@); $(CC) -c -o $(notdir $@) $(CFLAGS) $(notdir $<)
+else
%.o: %.c
$(Q)$(CC) -c -o $@ $(CFLAGS) $<
@$(E) " CC " $<
+endif
%.service: %.service.in
sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@
@@ -1676,6 +1682,10 @@ FIPSLD=$(FIPSDIR)/bin/fipsld
fips:
$(MAKE) CC=$(FIPSLD) FIPSLD_CC="$(CC)"
+lcov-html: wpa_supplicant.gcda
+ lcov -c -d .. > lcov.info
+ genhtml lcov.info --output-directory lcov-html
+
clean:
$(MAKE) -C ../src clean
$(MAKE) -C dbus clean
@@ -1683,5 +1693,7 @@ clean:
rm -f eap_*.so $(ALL) $(WINALL) eapol_test preauth_test
rm -f wpa_priv
rm -f nfc_pw_token
+ rm -f lcov.info
+ rm -rf lcov-html
-include $(OBJS:%.o=%.d)