[PATCH v6 07/15] build: put object files into build/ folder

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Johannes Berg <johannes.berg@xxxxxxxxx>

Instead of building in the source tree, put most object
files into the build/ folder at the root, and put each
thing that's being built into a separate folder.

This then allows us to build hostapd and wpa_supplicant
(or other combinations) without "make clean" inbetween.

For the tests keep the objects in place for now (and to
do that, add the build rule) so that we don't have to
rewrite all of that with $(call BUILDOBJS,...) which is
just noise there.

Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
---
 .gitignore              |  1 +
 eap_example/Makefile    | 18 +++++++++++-------
 hostapd/Makefile        | 22 +++++++++++++++++-----
 hs20/client/Makefile    | 14 +++-----------
 hs20/server/Makefile    | 10 +++-------
 radius_example/Makefile |  5 +++--
 src/ap/Makefile         |  4 ++--
 src/build.rules         | 32 ++++++++++++++++++++++++--------
 src/common/Makefile     |  4 ++--
 src/crypto/Makefile     |  4 ++--
 src/eap_common/Makefile |  4 ++--
 src/eap_peer/Makefile   |  4 ++--
 src/eap_server/Makefile |  4 ++--
 src/eapol_auth/Makefile |  4 ++--
 src/eapol_supp/Makefile |  4 ++--
 src/l2_packet/Makefile  |  4 ++--
 src/objs.mk             |  3 +++
 src/p2p/Makefile        |  4 ++--
 src/radius/Makefile     |  4 ++--
 src/rsn_supp/Makefile   |  4 ++--
 src/tls/Makefile        |  4 ++--
 src/utils/Makefile      |  4 ++--
 src/wps/Makefile        |  4 ++--
 tests/Makefile          |  7 +++++++
 wlantest/Makefile       | 10 +++++++---
 wpa_supplicant/Makefile | 34 ++++++++++++++++++++++++++--------
 26 files changed, 135 insertions(+), 81 deletions(-)
 create mode 100644 src/objs.mk

diff --git a/.gitignore b/.gitignore
index e057b54ea1e6..52a77fc01b9e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,3 +34,4 @@ wlantest/wlantest
 wlantest/wlantest_cli
 **/parallel-vm.log
 tags
+build/
diff --git a/eap_example/Makefile b/eap_example/Makefile
index ecef3c97662b..7660b8ddd036 100644
--- a/eap_example/Makefile
+++ b/eap_example/Makefile
@@ -7,9 +7,9 @@ CFLAGS += -I../src
 CFLAGS += -I../src/utils
 
 
-OBJS_both += ../src/utils/libutils.a
-OBJS_both += ../src/crypto/libcrypto.a
-OBJS_both += ../src/tls/libtls.a
+EAP_LIBS += ../src/utils/libutils.a
+EAP_LIBS += ../src/crypto/libcrypto.a
+EAP_LIBS += ../src/tls/libtls.a
 
 OBJS_both += ../src/eap_common/eap_peap_common.o
 OBJS_both += ../src/eap_common/eap_psk_common.o
@@ -83,8 +83,12 @@ CFLAGS += -DEAP_SERVER
 
 
 OBJS_lib=$(OBJS_both) $(OBJS_peer) $(OBJS_server)
+_OBJS_VAR := OBJS_lib
+include ../src/objs.mk
 
 OBJS_ex = eap_example.o eap_example_peer.o eap_example_server.o
+_OBJS_VAR := OBJS_ex
+include ../src/objs.mk
 
 
 ../src/utils/libutils.a:
@@ -99,8 +103,8 @@ OBJS_ex = eap_example.o eap_example_peer.o eap_example_server.o
 
 ifneq ($(CONFIG_SOLIB), yes)
 LIBEAP = libeap.a
-libeap.a: $(OBJS_lib)
-	$(AR) crT libeap.a $(OBJS_lib)
+libeap.a: $(EAP_LIBS) $(OBJS_lib)
+	$(AR) crT libeap.a $^
 	$(RANLIB) libeap.a
 
 else
@@ -108,8 +112,8 @@ CFLAGS  += -fPIC -DPIC
 LDFLAGS += -shared
 
 LIBEAP  = libeap.so
-libeap.so: $(OBJS_lib)
-	$(LDO) $(LDFLAGS) $(OBJS_lib) -o $(LIBEAP)
+libeap.so: $(EAP_LIBS) $(OBJS_lib)
+	$(LDO) $(LDFLAGS) $^ -o $(LIBEAP)
 
 endif
 
diff --git a/hostapd/Makefile b/hostapd/Makefile
index ac83730e9621..f07acdf24478 100644
--- a/hostapd/Makefile
+++ b/hostapd/Makefile
@@ -1272,6 +1272,9 @@ install: $(addprefix $(DESTDIR)$(BINDIR)/,$(ALL))
 
 BCHECK=../src/drivers/build.hostapd
 
+_OBJS_VAR := OBJS
+include ../src/objs.mk
+
 hostapd: $(BCHECK) $(OBJS)
 	$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
 	@$(E) "  LD " $@
@@ -1279,6 +1282,10 @@ hostapd: $(BCHECK) $(OBJS)
 ifdef CONFIG_WPA_TRACE
 OBJS_c += ../src/utils/trace.o
 endif
+
+_OBJS_VAR := OBJS_c
+include ../src/objs.mk
+
 hostapd_cli: $(OBJS_c)
 	$(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c)
 	@$(E) "  LD " $@
@@ -1335,6 +1342,13 @@ SOBJS += ../src/crypto/sha256-kdf.o
 SOBJS += ../src/crypto/sha384-kdf.o
 SOBJS += ../src/crypto/sha512-kdf.o
 
+_OBJS_VAR := NOBJS
+include ../src/objs.mk
+_OBJS_VAR := HOBJS
+include ../src/objs.mk
+_OBJS_VAR := SOBJS
+include ../src/objs.mk
+
 nt_password_hash: $(NOBJS)
 	$(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n)
 	@$(E) "  LD " $@
@@ -1347,15 +1361,13 @@ sae_pk_gen: $(SOBJS)
 	$(Q)$(CC) $(LDFLAGS) -o sae_pk_gen $(SOBJS) $(LIBS_s)
 	@$(E) "  LD " $@
 
+.PHONY: lcov-html
 lcov-html:
-	lcov -c -d .. > lcov.info
+	lcov -c -d $(BUILDDIR) > lcov.info
 	genhtml lcov.info --output-directory lcov-html
 
 clean: common-clean
-	rm -f core *~ *.o nt_password_hash hlr_auc_gw
+	rm -f core *~ nt_password_hash hlr_auc_gw
 	rm -f sae_pk_gen
-	rm -f *.d *.gcno *.gcda *.gcov
 	rm -f lcov.info
 	rm -rf lcov-html
-
--include $(OBJS:%.o=%.d)
diff --git a/hs20/client/Makefile b/hs20/client/Makefile
index cbb1105e186b..4dcfe2d3bf2c 100644
--- a/hs20/client/Makefile
+++ b/hs20/client/Makefile
@@ -71,19 +71,11 @@ CFLAGS += -DEAP_TLS_OPENSSL
 OBJS += ../../src/crypto/tls_openssl_ocsp.o
 LIBS += -lssl -lcrypto
 
+_OBJS_VAR := OBJS
+include ../../src/objs.mk
 hs20-osu-client: $(OBJS)
 	$(Q)$(LDO) $(LDFLAGS) -o hs20-osu-client $(OBJS) $(LIBS)
 	@$(E) "  LD " $@
 
 clean: common-clean
-	rm -f core *~ *.o *.d
-	rm -f ../../src/utils/*.o
-	rm -f ../../src/utils/*.d
-	rm -f ../../src/common/*.o
-	rm -f ../../src/common/*.d
-	rm -f ../../src/crypto/*.o
-	rm -f ../../src/crypto/*.d
-	rm -f ../../src/wps/*.o
-	rm -f ../../src/wps/*.d
-
--include $(OBJS:%.o=%.d)
+	rm -f core *~
diff --git a/hs20/server/Makefile b/hs20/server/Makefile
index 24b81cd8a28a..0cab6d6b010a 100644
--- a/hs20/server/Makefile
+++ b/hs20/server/Makefile
@@ -33,14 +33,10 @@ CFLAGS += $(shell xml2-config --cflags)
 LIBS += $(shell xml2-config --libs)
 OBJS += ../../src/utils/xml_libxml2.o
 
+_OBJS_VAR := OBJS
+include ../../src/objs.mk
 hs20_spp_server: $(OBJS)
 	$(LDO) $(LDFLAGS) -o hs20_spp_server $(OBJS) $(LIBS)
 
 clean: common-clean
-	rm -f core *~ *.o *.d
-	rm -f ../../src/utils/*.o
-	rm -f ../../src/utils/*.d
-	rm -f ../../src/crypto/*.o
-	rm -f ../../src/crypto/*.d
-
--include $(OBJS:%.o=%.d)
+	rm -f core *~
diff --git a/radius_example/Makefile b/radius_example/Makefile
index 3492ac70fc49..f0e4e535aa3c 100644
--- a/radius_example/Makefile
+++ b/radius_example/Makefile
@@ -24,10 +24,11 @@ LLIBS = -lrt
 
 OBJS_ex = radius_example.o
 
+_OBJS_VAR := OBJS_ex
+include ../src/objs.mk
+
 radius_example: $(OBJS_ex) $(LIBS)
 	$(LDO) $(LDFLAGS) -o radius_example $(OBJS_ex) $(LIBS) $(LLIBS)
 
 clean: common-clean
 	rm -f core *~ *.o *.d
-
--include $(OBJS:%.o=%.d)
diff --git a/src/ap/Makefile b/src/ap/Makefile
index 805181d00c12..425b123405a4 100644
--- a/src/ap/Makefile
+++ b/src/ap/Makefile
@@ -65,7 +65,7 @@ LIB_OBJS= \
 	wps_hostapd.o \
 	x_snoop.o
 
+_OBJS_VAR := LIB_OBJS
+include ../objs.mk
 libap.a: $(LIB_OBJS)
 	$(AR) crT $@ $?
-
--include $(OBJS:%.o=%.d)
diff --git a/src/build.rules b/src/build.rules
index 486fea65861e..4b04eca58cf6 100644
--- a/src/build.rules
+++ b/src/build.rules
@@ -4,8 +4,13 @@ all: _all
 # disable built-in rules
 .SUFFIXES:
 
+# setup some variables
 ROOTDIR := $(dir $(lastword $(MAKEFILE_LIST)))
-ROOTDIR := $(dir $(ROOTDIR:%/=%))
+ROOTDIR := $(dir $(ROOTDIR:%../src/=%))../
+BUILDDIR := $(ROOTDIR)build
+_PROJ := $(abspath $(dir $(firstword $(MAKEFILE_LIST))))
+ABSROOT := $(abspath $(ROOTDIR))
+_PROJ := $(_PROJ:$(ABSROOT)/%=%)
 
 ifndef CC
 CC=gcc
@@ -26,6 +31,9 @@ endif
 ifneq ($(CONFIG_FILE),)
 -include $(CONFIG_FILE)
 
+# export for sub-makefiles
+export CONFIG_CODE_COVERAGE
+
 .PHONY: verify_config
 verify_config:
 	@if [ ! -r $(CONFIG_FILE) ]; then \
@@ -44,6 +52,10 @@ endif
 .PHONY: _all
 _all: $(VERIFY) $(ALL) $(EXTRA_TARGETS)
 
+# continue setup
+COVSUFFIX := $(if $(CONFIG_CODE_COVERAGE),-cov,)
+PROJ := $(_PROJ)$(COVSUFFIX)
+
 Q=@
 E=echo
 ifeq ($(V), 1)
@@ -59,17 +71,21 @@ ifeq ($(Q),@)
 MAKEFLAGS += --no-print-directory
 endif
 
-ifdef CONFIG_CODE_COVERAGE
-%.o: %.c
+_DIRS := $(BUILDDIR)/$(PROJ)
+.PHONY: _make_dirs
+_make_dirs:
+	@mkdir -p $(_DIRS)
+
+$(BUILDDIR)/$(PROJ)/src/%.o: $(ROOTDIR)src/%.c | _make_dirs
+	$(Q)$(CC) -c -o $@ $(CFLAGS) $<
 	@$(E) "  CC " $<
-	$(Q)cd $(dir $@); $(CC) -c -o $(notdir $@) $(CFLAGS) $(notdir $<)
-else
-%.o: %.c
+$(BUILDDIR)/$(PROJ)/%.o: %.c | _make_dirs
 	$(Q)$(CC) -c -o $@ $(CFLAGS) $<
 	@$(E) "  CC " $<
-endif
+
+BUILDOBJ = $(patsubst %,$(BUILDDIR)/$(PROJ)/%,$(patsubst $(ROOTDIR)%,%,$(1)))
 
 .PHONY: common-clean
 common-clean:
 	$(Q)$(MAKE) -C $(ROOTDIR)/src clean
-	$(Q)rm -f $(ALL)
+	$(Q)rm -rf $(ALL) $(BUILDDIR)/$(PROJ)
diff --git a/src/common/Makefile b/src/common/Makefile
index eeb69f0d4ff3..4cd48d9fd8ce 100644
--- a/src/common/Makefile
+++ b/src/common/Makefile
@@ -19,7 +19,7 @@ LIB_OBJS= \
 	sae.o \
 	wpa_common.o
 
+_OBJS_VAR := LIB_OBJS
+include ../objs.mk
 libcommon.a: $(LIB_OBJS)
 	$(AR) crT $@ $?
-
--include $(OBJS:%.o=%.d)
diff --git a/src/crypto/Makefile b/src/crypto/Makefile
index 94eac66fa955..3af5406ea381 100644
--- a/src/crypto/Makefile
+++ b/src/crypto/Makefile
@@ -66,7 +66,7 @@ LIB_OBJS += random.o
 endif
 
 
+_OBJS_VAR := LIB_OBJS
+include ../objs.mk
 libcrypto.a: $(LIB_OBJS)
 	$(AR) crT $@ $?
-
--include $(OBJS:%.o=%.d)
diff --git a/src/eap_common/Makefile b/src/eap_common/Makefile
index 7d6777babf4f..49fbbde02691 100644
--- a/src/eap_common/Makefile
+++ b/src/eap_common/Makefile
@@ -23,7 +23,7 @@ LIB_OBJS= \
 	eap_wsc_common.o \
 	ikev2_common.o
 
+_OBJS_VAR := LIB_OBJS
+include ../objs.mk
 libeap_common.a: $(LIB_OBJS)
 	$(AR) crT $@ $?
-
--include $(OBJS:%.o=%.d)
diff --git a/src/eap_peer/Makefile b/src/eap_peer/Makefile
index 282b89696e5c..36439b788379 100644
--- a/src/eap_peer/Makefile
+++ b/src/eap_peer/Makefile
@@ -15,7 +15,7 @@ LIB_OBJS= \
 	eap.o \
 	eap_methods.o
 
+_OBJS_VAR := LIB_OBJS
+include ../objs.mk
 libeap_peer.a: $(LIB_OBJS)
 	$(AR) crT $@ $?
-
--include $(OBJS:%.o=%.d)
diff --git a/src/eap_server/Makefile b/src/eap_server/Makefile
index 4ece9aa67b35..946ac195e251 100644
--- a/src/eap_server/Makefile
+++ b/src/eap_server/Makefile
@@ -13,7 +13,7 @@ LIB_OBJS= \
 	eap_server_identity.o \
 	eap_server_methods.o
 
+_OBJS_VAR := LIB_OBJS
+include ../objs.mk
 libeap_server.a: $(LIB_OBJS)
 	$(AR) crT $@ $?
-
--include $(OBJS:%.o=%.d)
diff --git a/src/eapol_auth/Makefile b/src/eapol_auth/Makefile
index 0175a19d940e..777979ce7c4f 100644
--- a/src/eapol_auth/Makefile
+++ b/src/eapol_auth/Makefile
@@ -8,7 +8,7 @@ install:
 
 LIB_OBJS = eapol_auth_sm.o eapol_auth_dump.o
 
+_OBJS_VAR := LIB_OBJS
+include ../objs.mk
 libeapol_auth.a: $(LIB_OBJS)
 	$(AR) crT $@ $?
-
--include $(OBJS:%.o=%.d)
diff --git a/src/eapol_supp/Makefile b/src/eapol_supp/Makefile
index c98280b469b7..265e5f25c37c 100644
--- a/src/eapol_supp/Makefile
+++ b/src/eapol_supp/Makefile
@@ -10,7 +10,7 @@ CFLAGS += -DIEEE8021X_EAPOL
 
 LIB_OBJS = eapol_supp_sm.o
 
+_OBJS_VAR := LIB_OBJS
+include ../objs.mk
 libeapol_supp.a: $(LIB_OBJS)
 	$(AR) crT $@ $?
-
--include $(OBJS:%.o=%.d)
diff --git a/src/l2_packet/Makefile b/src/l2_packet/Makefile
index 20f229511e9c..ab8c86ecc43d 100644
--- a/src/l2_packet/Makefile
+++ b/src/l2_packet/Makefile
@@ -8,7 +8,7 @@ install:
 
 LIB_OBJS = l2_packet_linux.o
 
+_OBJS_VAR := LIB_OBJS
+include ../objs.mk
 libl2_packet.a: $(LIB_OBJS)
 	$(AR) crT $@ $?
-
--include $(OBJS:%.o=%.d)
diff --git a/src/objs.mk b/src/objs.mk
new file mode 100644
index 000000000000..df9fb17a1c10
--- /dev/null
+++ b/src/objs.mk
@@ -0,0 +1,3 @@
+$(_OBJS_VAR) := $(call BUILDOBJ,$($(_OBJS_VAR)))
+-include $($(_OBJS_VAR):%.o=%.d)
+_DIRS += $(dir $($(_OBJS_VAR)))
diff --git a/src/p2p/Makefile b/src/p2p/Makefile
index 174cf6f6f7f4..c6b406661182 100644
--- a/src/p2p/Makefile
+++ b/src/p2p/Makefile
@@ -21,7 +21,7 @@ LIB_OBJS= \
 	p2p_sd.o \
 	p2p_utils.o
 
+_OBJS_VAR := LIB_OBJS
+include ../objs.mk
 libp2p.a: $(LIB_OBJS)
 	$(AR) crT $@ $?
-
--include $(OBJS:%.o=%.d)
diff --git a/src/radius/Makefile b/src/radius/Makefile
index dbe9a9a9fa71..83096f0c7fbb 100644
--- a/src/radius/Makefile
+++ b/src/radius/Makefile
@@ -14,7 +14,7 @@ LIB_OBJS= \
 	radius_das.o \
 	radius_server.o
 
+_OBJS_VAR := LIB_OBJS
+include ../objs.mk
 libradius.a: $(LIB_OBJS)
 	$(AR) crT $@ $?
-
--include $(OBJS:%.o=%.d)
diff --git a/src/rsn_supp/Makefile b/src/rsn_supp/Makefile
index 255cb73a7505..43288e3fd688 100644
--- a/src/rsn_supp/Makefile
+++ b/src/rsn_supp/Makefile
@@ -19,7 +19,7 @@ LIB_OBJS= \
 	wpa.o \
 	wpa_ie.o
 
+_OBJS_VAR := LIB_OBJS
+include ../objs.mk
 librsn_supp.a: $(LIB_OBJS)
 	$(AR) crT $@ $?
-
--include $(OBJS:%.o=%.d)
diff --git a/src/tls/Makefile b/src/tls/Makefile
index 0a36cf9e4530..3fac5ee8c6cd 100644
--- a/src/tls/Makefile
+++ b/src/tls/Makefile
@@ -31,7 +31,7 @@ LIB_OBJS= \
 	x509v3.o
 
 
+_OBJS_VAR := LIB_OBJS
+include ../objs.mk
 libtls.a: $(LIB_OBJS)
 	$(AR) crT $@ $?
-
--include $(OBJS:%.o=%.d)
diff --git a/src/utils/Makefile b/src/utils/Makefile
index 29fb1295d726..7be05101fc30 100644
--- a/src/utils/Makefile
+++ b/src/utils/Makefile
@@ -34,7 +34,7 @@ LIB_OBJS += edit.o
 
 #LIB_OBJS += pcsc_funcs.o
 
+_OBJS_VAR := LIB_OBJS
+include ../objs.mk
 libutils.a: $(LIB_OBJS)
 	$(AR) crT $@ $?
-
--include $(OBJS:%.o=%.d)
diff --git a/src/wps/Makefile b/src/wps/Makefile
index 811b62977be8..ed928ef41e94 100644
--- a/src/wps/Makefile
+++ b/src/wps/Makefile
@@ -33,7 +33,7 @@ LIB_OBJS= \
 	wps_upnp_ssdp.o \
 	wps_upnp_web.o
 
+_OBJS_VAR := LIB_OBJS
+include ../objs.mk
 libwps.a: $(LIB_OBJS)
 	$(AR) crT $@ $?
-
--include $(OBJS:%.o=%.d)
diff --git a/tests/Makefile b/tests/Makefile
index 4d9f2e0ab8c1..4a07a5dc55ca 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -5,6 +5,13 @@ ALL=test-base64 test-md4 test-milenage \
 
 include ../src/build.rules
 
+# for now, keep building in this folder, otherwise we need to
+# put each object for each test into a separate variable and
+# then do the objs.mk dance for it ...
+%.o: %.c
+	$(Q)$(CC) -c -o $@ $(CFLAGS) $<
+	@$(E) "  CC " $<
+
 ifdef LIBFUZZER
 CC=clang
 CFLAGS = -MMD -O2 -Wall -g
diff --git a/wlantest/Makefile b/wlantest/Makefile
index fee80f6f4e2c..410c309d4745 100644
--- a/wlantest/Makefile
+++ b/wlantest/Makefile
@@ -71,6 +71,12 @@ TOBJS += gcmp.o
 
 OBJS_cli = wlantest_cli.o
 
+_OBJS_VAR := OBJS
+include ../src/objs.mk
+_OBJS_VAR := TOBJS
+include ../src/objs.mk
+_OBJS_VAR := OBJS_cli
+include ../src/objs.mk
 
 wlantest: $(OBJS) $(OWN_LIBS)
 	$(LDO) $(LDFLAGS) -o wlantest $(OBJS) $(OWN_LIBS) $(LIBS)
@@ -82,6 +88,4 @@ test_vectors: $(TOBJS) $(OWN_LIBS)
 	$(LDO) $(LDFLAGS) -o test_vectors $(TOBJS) $(OWN_LIBS) $(LIBS)
 
 clean: common-clean
-	rm -f core *~ *.o *.d
-
--include $(OBJS:%.o=%.d)
+	rm -f core *~
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 8645d908f821..9f81addd8228 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -1860,28 +1860,40 @@ dynamic_eap_methods: $(EAPDYN)
 
 BCHECK=../src/drivers/build.wpa_supplicant
 
+_OBJS_VAR := OBJS_priv
+include ../src/objs.mk
 wpa_priv: $(BCHECK) $(OBJS_priv)
 	$(Q)$(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
 	@$(E) "  LD " $@
 
 $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
 
+_OBJS_VAR := OBJS
+include ../src/objs.mk
 wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
 	$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
 	@$(E) "  LD " $@
 
+_OBJS_VAR := OBJS_t
+include ../src/objs.mk
 eapol_test: $(OBJS_t)
 	$(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
 	@$(E) "  LD " $@
 
+_OBJS_VAR := OBJS_t2
+include ../src/objs.mk
 preauth_test: $(OBJS_t2)
 	$(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
 	@$(E) "  LD " $@
 
+_OBJS_VAR := OBJS_p
+include ../src/objs.mk
 wpa_passphrase: $(OBJS_p)
 	$(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p) $(LIBS)
 	@$(E) "  LD " $@
 
+_OBJS_VAR := OBJS_c
+include ../src/objs.mk
 wpa_cli: $(OBJS_c)
 	$(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
 	@$(E) "  LD " $@
@@ -1895,6 +1907,8 @@ LIBCTRLSO += ../src/utils/os_$(CONFIG_OS).c
 LIBCTRLSO += ../src/utils/common.c
 LIBCTRLSO += ../src/utils/wpa_debug.c
 
+_OBJS_VAR := LIBCTRL
+include ../src/objs.mk
 libwpa_client.a: $(LIBCTRL)
 	$(Q)rm -f $@
 	$(Q)$(AR) crs $@ $?
@@ -1904,14 +1918,19 @@ libwpa_client.so: $(LIBCTRLSO)
 	@$(E) "  CC  $@ ($^)"
 	$(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -fPIC $^
 
-libwpa_test1: libwpa_test.o libwpa_client.a
-	$(Q)$(LDO) $(LDFLAGS) -o libwpa_test1 libwpa_test.o libwpa_client.a $(LIBS_c)
+OBJS_wpatest := libwpa_test.o
+_OBJS_VAR := OBJS_wpatest
+include ../src/objs.mk
+libwpa_test1: $(OBJS_wpatest) libwpa_client.a
+	$(Q)$(LDO) $(LDFLAGS) -o libwpa_test1 $(OBJS_wpatest) libwpa_client.a $(LIBS_c)
 	@$(E) "  LD " $@
 
-libwpa_test2: libwpa_test.o libwpa_client.so
-	$(Q)$(LDO) $(LDFLAGS) -o libwpa_test2 libwpa_test.o -L. -lwpa_client $(LIBS_c)
+libwpa_test2: $(OBJS_wpatest) libwpa_client.so
+	$(Q)$(LDO) $(LDFLAGS) -o libwpa_test2 $(OBJS_wpatest) -L. -lwpa_client $(LIBS_c)
 	@$(E) "  LD " $@
 
+_OBJS_VAR := OBJS_nfc
+include ../src/objs.mk
 nfc_pw_token: $(OBJS_nfc)
 	$(Q)$(LDO) $(LDFLAGS) -o nfc_pw_token $(OBJS_nfc) $(LIBS)
 	@$(E) "  LD " $@
@@ -1989,8 +2008,9 @@ FIPSLD=$(FIPSDIR)/bin/fipsld
 fips:
 	$(MAKE) CC=$(FIPSLD) FIPSLD_CC="$(CC)"
 
-lcov-html: wpa_supplicant.gcda
-	lcov -c -d .. > lcov.info
+.PHONY: lcov-html
+lcov-html: $(call BUILDOBJ,wpa_supplicant.gcda)
+	lcov -c -d $(BUILDDIR) > lcov.info
 	genhtml lcov.info --output-directory lcov-html
 
 clean: common-clean
@@ -2005,5 +2025,3 @@ clean: common-clean
 	rm -f libwpa_client.a
 	rm -f libwpa_client.so
 	rm -f libwpa_test1 libwpa_test2
-
--include $(OBJS:%.o=%.d)
-- 
2.26.2


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux