aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
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 /hostapd
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 'hostapd')
-rw-r--r--hostapd/Makefile16
1 files changed, 14 insertions, 2 deletions
diff --git a/hostapd/Makefile b/hostapd/Makefile
index ae96d35..e60ae9b 100644
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
@@ -6,8 +6,8 @@ ifndef CFLAGS
CFLAGS = -MMD -O2 -Wall -g
endif
-CFLAGS += -I../src
-CFLAGS += -I../src/utils
+CFLAGS += -I$(abspath ../src)
+CFLAGS += -I$(abspath ../src/utils)
# Uncomment following line and set the path to your kernel tree include
# directory if your C library does not include all header files.
@@ -873,9 +873,15 @@ Q=
E=true
endif
+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
verify_config:
@if [ ! -r .config ]; then \
@@ -944,9 +950,15 @@ hlr_auc_gw: $(HOBJS)
$(Q)$(CC) $(LDFLAGS) -o hlr_auc_gw $(HOBJS) $(LIBS_h)
@$(E) " LD " $@
+lcov-html:
+ lcov -c -d .. > lcov.info
+ genhtml lcov.info --output-directory lcov-html
+
clean:
$(MAKE) -C ../src clean
rm -f core *~ *.o hostapd hostapd_cli nt_password_hash hlr_auc_gw
rm -f *.d *.gcno *.gcda *.gcov
+ rm -f lcov.info
+ rm -rf lcov-html
-include $(OBJS:%.o=%.d)