From patchwork Mon Jun 22 08:14:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 1314382 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sipsolutions.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=OYpsQHxG; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=vVz18nbg; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49r9QH1zwLz9sQx for ; Mon, 22 Jun 2020 23:35:19 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=1YHuZxE1GDt3K1xDW+0SCIxPYswp5rUipDHgDhT1y7Y=; b=OYpsQHxGNS/KP5+7Epk7z4SF/M 4/qDZPRfwUsIi9e55ajfmKgzSIvumnfeZIju/SGhiCVvNdCz4KtKtNFdiYoLhSRDqYHCin9tizgMy xyLSbL89IV9p1RBtzKg/Sppv8XPUnq9KO/UQbRcJkv6GV71RAI6NRET9W5EwNgjX0iMHN/azw280S HC2lHsDlsasj9Gy1+qi8zFnWsizWebiR6AXlmL7zeyVWg+pmzEdloMEg+LvVa7cT8/E+7P/c6pGSA aYG38Jaw8Oz6+cD8o4USLhye5rtJftdVRh4dFYJFTNYwsPJvaYypZR3c5BmJl3GZtn/fa3G502p8z pHP9RuKQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMag-00040N-Qp; Mon, 22 Jun 2020 13:34:26 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLx5-0004kM-UI for hostap@merlin.infradead.org; Mon, 22 Jun 2020 12:53:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=xMi/8qZ+c18D7MTKo49BiC6pN+bHb6lx6Ir4uHI7Mv8=; b=vVz18nbg061EMYr/VCCNWJj7Rv 2LcywM+oK9hTfiA7wPMxlTEpLtVBBEmI4WvvSDCd0xuQ5gsC405TgykYMzd0pqvvr9YebknSElA6T T4by2vcmqTrlzfdd1oxyr1zuc3ViFqnN3osr7fPYv9yyTqNSeNfLTTKul3hdhYfRtpt4HiaBG9LA0 Xch/CfirtA8ur1MZOYBeBk741EX9UHFmAxrejGRiYX6jTet5h9pzbVOxgUiFRXgRwLg7T+YME4QHI ojvgumUc3FssAFiuAxRBs8wc6LGETbz7PEGKtas68Fab9e5sKfRok0nMTjc/76sdpzblWHoROu/a5 2kwXI9og==; Received: from s3.sipsolutions.net ([2a01:4f8:191:4433::2] helo=sipsolutions.net) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnHdW-0003c6-Fv for hostap@lists.infradead.org; Mon, 22 Jun 2020 08:17:04 +0000 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1jnHbI-009x6F-5V; Mon, 22 Jun 2020 10:14:44 +0200 From: Johannes Berg To: hostap@lists.infradead.org Subject: [PATCH v3 1/6] hs20: server: add a .gitignore file Date: Mon, 22 Jun 2020 10:14:29 +0200 Message-Id: <1592813672-I81366372464f4b460a73bad9da126e78d1d692a5@changeid> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200622_091702_816559_8209258B X-CRM114-Status: UNSURE ( 9.61 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.5 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.4 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Johannes Berg Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Johannes Berg Signed-off-by: Johannes Berg --- hs20/server/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 hs20/server/.gitignore diff --git a/hs20/server/.gitignore b/hs20/server/.gitignore new file mode 100644 index 000000000000..fecb096c128a --- /dev/null +++ b/hs20/server/.gitignore @@ -0,0 +1 @@ +hs20_spp_server From patchwork Mon Jun 22 08:14:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 1314378 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sipsolutions.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=tghYUe5L; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=TxrTpERw; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49r9Kv1BD6z9sQx for ; Mon, 22 Jun 2020 23:31:30 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=71XcsYVngwqseua+hSzPQo0xP5U+Sy9Iw0LGmOxLj+w=; b=tghYUe5L1l98sgqcv6ZWeYG1m adfGvLPzMY4Mg4gviGDE5X6B11fgPiF9KThcSl4n9sSR/rFUnvNYcslUvfZ0CnhZqJkWV+o+RT/R8 TM80rDTSK3s741pDmIFx5unCk90SLyC1VCX0m5Ht2lyNhcXbg6NRAkPKrz2oKxEgcdvYVPtbrj7Ap qXQzCJY5+ZkF0RyWYVKEnZq/mGS+6HCZe0dKcNmdGn3ABRW7jnolMEegOZTPeXrmqTTigiUBurbom WrGGVoyx81utlmKKNBkr5ml6zG6Raf8o2qO5J8fkPTPyvUbta9tIxeQOWsNF2oDzrsxpzx//3LTHF dZyXaQweA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMVu-0001tO-Oi; Mon, 22 Jun 2020 13:29:30 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLwo-0004am-39 for hostap@merlin.infradead.org; Mon, 22 Jun 2020 12:53:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=/bWrVeYAzyF8tUGl27d1IAlS0etTVORZSurvDjm5eIs=; b=TxrTpERwJ8SCL187ONKzgm+XOw rnxfHMQgc6DWygjh8Pw2k3npEarjIg9T1S3sRqeLEsbzOl7f8WRdEq6/NHb75Y903xO44Nsl5JheF or4SGB4Og43mecSQCYEHlyP7ob0PdFFaqJIei7t/gGpv3HEl/HrYdiBUg2eCTpsMTwt+UWEGus3Uw G7w8/vA2HU4ttdF/gRGpCU2OK335UrLIiwLCer8GlMFn+aEnKDkP/+k1bRKDbey6t1wLFhOV9dU5g XkBMotjB4x8g7vdbsWgzJ1wdgJ5YGURhLdIDfII9OoiRvMxaNcA7jw+e3AXFpns9FshPYrwd7B7PF KH/sNZLg==; Received: from s3.sipsolutions.net ([2a01:4f8:191:4433::2] helo=sipsolutions.net) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnHbU-0003Xj-3w for hostap@lists.infradead.org; Mon, 22 Jun 2020 08:14:58 +0000 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1jnHbI-009x6F-Dw; Mon, 22 Jun 2020 10:14:44 +0200 From: Johannes Berg To: hostap@lists.infradead.org Subject: [PATCH v3 2/6] build: pull common fragments into a common.rules file Date: Mon, 22 Jun 2020 10:14:30 +0200 Message-Id: <1592813672-I5adf174c14de58d5c5133d7424e164654fd1c160@changeid> X-Mailer: git-send-email 2.26.2 In-Reply-To: <1592813672-I81366372464f4b460a73bad9da126e78d1d692a5@changeid> References: <1592813672-I81366372464f4b460a73bad9da126e78d1d692a5@changeid> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200622_091456_540323_38879052 X-CRM114-Status: GOOD ( 13.30 ) X-Spam-Score: -1.5 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.4 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Johannes Berg Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Johannes Berg Some things are used by most of the binaries, pull them into a common rule fragment that we can use properly. Signed-off-by: Johannes Berg --- eap_example/Makefile | 31 +------------------- hostapd/Makefile | 34 ++------------------- hs20/client/Makefile | 30 ++----------------- hs20/server/Makefile | 14 ++------- radius_example/Makefile | 14 +-------- src/build.rules | 42 ++++++++++++++++++++++++++ tests/Makefile | 20 +++---------- wlantest/Makefile | 35 +--------------------- wpa_supplicant/Makefile | 65 +++++++++++------------------------------ 9 files changed, 73 insertions(+), 212 deletions(-) create mode 100644 src/build.rules diff --git a/eap_example/Makefile b/eap_example/Makefile index 0cc19bd5359f..e5f3b3471035 100644 --- a/eap_example/Makefile +++ b/eap_example/Makefile @@ -1,19 +1,6 @@ ALL=eap_example -all: $(ALL) - -ifndef CC -CC=gcc -endif - -ifndef RANLIB -RANLIB=ranlib -endif - -ifndef CFLAGS -CFLAGS = -MMD -O2 -Wall -g -endif - +include ../src/build.rules CFLAGS += -I. CFLAGS += -I../src @@ -95,22 +82,6 @@ OBJS_server += ../src/eap_server/eap_server_tls_common.o CFLAGS += -DEAP_SERVER -ifndef LDO -LDO=$(CC) -endif - -Q=@ -E=echo -ifeq ($(V), 1) -Q= -E=true -endif - -%.o: %.c - $(Q)$(CC) -c -o $@ $(CFLAGS) $< - @$(E) " CC " $< - - OBJS_lib=$(OBJS_both) $(OBJS_peer) $(OBJS_server) OBJS_ex = eap_example.o eap_example_peer.o eap_example_server.o diff --git a/hostapd/Makefile b/hostapd/Makefile index 1400002a99a5..5c830fb448b1 100644 --- a/hostapd/Makefile +++ b/hostapd/Makefile @@ -1,10 +1,7 @@ -ifndef CC -CC=gcc -endif +ALL=hostapd hostapd_cli +VERIFY=verify_config -ifndef CFLAGS -CFLAGS = -MMD -O2 -Wall -g -endif +include ../src/build.rules ifdef LIBS # If LIBS is set with some global build system defaults, clone those for @@ -1264,31 +1261,6 @@ ifdef CONFIG_NO_TKIP CFLAGS += -DCONFIG_NO_TKIP endif -ALL=hostapd hostapd_cli - -all: verify_config $(ALL) - -Q=@ -E=echo -ifeq ($(V), 1) -Q= -E=true -endif -ifeq ($(QUIET), 1) -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 \ echo 'Building hostapd requires a configuration file'; \ diff --git a/hs20/client/Makefile b/hs20/client/Makefile index cc2af03f43f6..70fb73598dfe 100644 --- a/hs20/client/Makefile +++ b/hs20/client/Makefile @@ -1,28 +1,6 @@ -all: hs20-osu-client +ALL=hs20-osu-client -ifndef CC -CC=gcc -endif - -ifndef LDO -LDO=$(CC) -endif - -ifeq ($(QUIET), 1) -Q=@ -E=true -else -Q=@ -E=echo -ifeq ($(V), 1) -Q= -E=true -endif -endif - -ifndef CFLAGS -CFLAGS = -MMD -O2 -Wall -g -endif +include ../../src/build.rules CFLAGS += -I../../src/utils CFLAGS += -I../../src/common @@ -97,10 +75,6 @@ hs20-osu-client: $(OBJS) $(Q)$(LDO) $(LDFLAGS) -o hs20-osu-client $(OBJS) $(LIBS) @$(E) " LD " $@ -%.o: %.c - $(Q)$(CC) -c -o $@ $(CFLAGS) $< - @$(E) " CC " $< - clean: rm -f core *~ *.o *.d hs20-osu-client rm -f ../../src/utils/*.o diff --git a/hs20/server/Makefile b/hs20/server/Makefile index 9b7372796028..9ec7e4491ad4 100644 --- a/hs20/server/Makefile +++ b/hs20/server/Makefile @@ -1,16 +1,6 @@ -all: hs20_spp_server +ALL=hs20_spp_server -ifndef CC -CC=gcc -endif - -ifndef LDO -LDO=$(CC) -endif - -ifndef CFLAGS -CFLAGS = -MMD -O2 -Wall -g -endif +include ../../src/build.rules CFLAGS += -I../../src CFLAGS += -I../../src/utils diff --git a/radius_example/Makefile b/radius_example/Makefile index 883e2f2da577..75cb3caeb3dd 100644 --- a/radius_example/Makefile +++ b/radius_example/Makefile @@ -1,18 +1,6 @@ ALL=radius_example -all: $(ALL) - -ifndef CC -CC=gcc -endif - -ifndef LDO -LDO=$(CC) -endif - -ifndef CFLAGS -CFLAGS = -MMD -O2 -Wall -g -endif +include ../src/build.rules CFLAGS += -I. CFLAGS += -I../src diff --git a/src/build.rules b/src/build.rules new file mode 100644 index 000000000000..c83683ce6213 --- /dev/null +++ b/src/build.rules @@ -0,0 +1,42 @@ +all: $(VERIFY) $(ALL) $(EXTRA_TARGETS) + +ifndef CC +CC=gcc +endif + +ifndef RANLIB +RANLIB=ranlib +endif + +ifndef LDO +LDO=$(CC) +endif + +ifndef CFLAGS +CFLAGS = -MMD -O2 -Wall -g +endif + +Q=@ +E=echo +ifeq ($(V), 1) +Q= +E=true +endif +ifeq ($(QUIET), 1) +Q=@ +E=true +endif + +ifeq ($(Q),@) +MAKEFLAGS += --no-print-directory +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 diff --git a/tests/Makefile b/tests/Makefile index 0817c9a27995..119ed7a2ae90 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,9 +1,9 @@ -TESTS=test-base64 test-md4 test-milenage \ +ALL=test-base64 test-md4 test-milenage \ test-rsa-sig-ver \ test-sha1 \ test-sha256 test-aes test-asn1 test-x509v3 test-list test-rc4 -all: $(TESTS) +include ../src/build.rules ifdef LIBFUZZER CC=clang @@ -14,18 +14,6 @@ LDFLAGS += -fsanitize=fuzzer,address,signed-integer-overflow,unsigned-integer-ov TEST_FUZZ=y endif -ifndef CC -CC=gcc -endif - -ifndef LDO -LDO=$(CC) -endif - -ifndef CFLAGS -CFLAGS = -MMD -O2 -Wall -g -endif - ifdef TEST_FUZZ CFLAGS += -DCONFIG_NO_RANDOM_POOL CFLAGS += -DTEST_FUZZ @@ -152,7 +140,7 @@ test-x509v3: test-x509v3.o $(LIBS) $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS) -run-tests: $(TESTS) +run-tests: $(ALL) ./test-aes ./test-list ./test-md4 @@ -165,7 +153,7 @@ run-tests: $(TESTS) clean: $(MAKE) -C ../src clean - rm -f $(TESTS) *~ *.o *.d + rm -f $(ALL) *~ *.o *.d rm -f test-eapol rm -f test-https rm -f test-json diff --git a/wlantest/Makefile b/wlantest/Makefile index 22ea646c0926..0324fa54855e 100644 --- a/wlantest/Makefile +++ b/wlantest/Makefile @@ -1,22 +1,9 @@ ALL=wlantest wlantest_cli test_vectors -all: $(ALL) +include ../src/build.rules UNAME := $(shell uname -s) -ifndef CC -CC=gcc -endif - -ifndef RANLIB -RANLIB=ranlib -endif - -ifndef CFLAGS -CFLAGS = -MMD -O2 -Wall -g -endif - - CFLAGS += -I. CFLAGS += -I../src CFLAGS += -I../src/utils @@ -26,26 +13,6 @@ ifneq ($(UNAME),Darwin) LIBS += -lrt endif -ifndef LDO -LDO=$(CC) -endif - -Q=@ -E=echo -ifeq ($(V), 1) -Q= -E=true -endif -ifeq ($(QUIET), 1) -Q=@ -E=true -endif - -%.o: %.c - $(Q)$(CC) -c -o $@ $(CFLAGS) $< - @$(E) " CC " $< - - OWN_LIBS += ../src/utils/libutils.a OWN_LIBS += ../src/crypto/libcrypto.a diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile index 09ac7a49367f..be3dad3c8a9c 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile @@ -1,11 +1,24 @@ -ifndef CC -CC=gcc +BINALL=wpa_supplicant wpa_cli + +ifndef CONFIG_NO_WPA_PASSPHRASE +BINALL += wpa_passphrase endif -ifndef CFLAGS -CFLAGS = -MMD -O2 -Wall -g +ALL = $(BINALL) +ALL += systemd/wpa_supplicant.service +ALL += systemd/wpa_supplicant@.service +ALL += systemd/wpa_supplicant-nl80211@.service +ALL += systemd/wpa_supplicant-wired@.service +ALL += dbus/fi.w1.wpa_supplicant1.service +ifdef CONFIG_BUILD_WPA_CLIENT_SO +ALL += libwpa_client.so endif +VERIFY=verify_config +EXTRA_TARGETS=dynamic_eap_methods + +include ../src/build.rules + ifdef LIBS # If LIBS is set with some global build system defaults, clone those for # LIBS_c and LIBS_p to cover wpa_passphrase and wpa_cli as well. @@ -44,25 +57,6 @@ CONFIG_WPS_TESTING=y CONFIG_TDLS_TESTING=y endif -BINALL=wpa_supplicant wpa_cli - -ifndef CONFIG_NO_WPA_PASSPHRASE -BINALL += wpa_passphrase -endif - -ALL = $(BINALL) -ALL += systemd/wpa_supplicant.service -ALL += systemd/wpa_supplicant@.service -ALL += systemd/wpa_supplicant-nl80211@.service -ALL += systemd/wpa_supplicant-wired@.service -ALL += dbus/fi.w1.wpa_supplicant1.service -ifdef CONFIG_BUILD_WPA_CLIENT_SO -ALL += libwpa_client.so -endif - - -all: verify_config $(ALL) dynamic_eap_methods - verify_config: @if [ ! -r .config ]; then \ echo 'Building wpa_supplicant requires a configuration file'; \ @@ -1866,21 +1860,6 @@ ifdef CONFIG_NO_TKIP CFLAGS += -DCONFIG_NO_TKIP endif -ifndef LDO -LDO=$(CC) -endif - -Q=@ -E=echo -ifeq ($(V), 1) -Q= -E=true -endif -ifeq ($(QUIET), 1) -Q=@ -E=true -endif - dynamic_eap_methods: $(EAPDYN) ../src/drivers/build.wpa_supplicant: @@ -1979,16 +1958,6 @@ 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 $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@ @$(E) " sed" $< From patchwork Mon Jun 22 08:14:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 1314381 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sipsolutions.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=KAhKhSAs; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=iqafMy6a; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49r9PH2SLZz9sQt for ; Mon, 22 Jun 2020 23:34:27 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bFYXtlG7cHpLo3vCHdEPOld9c4RhZZCSz99DU6ZTgZI=; b=KAhKhSAszStWMsoGiv70Jk2JG VCX7Fesn+ZU0yEe9J0Cs0y++LgTRAXrHyhR/SlncPrX3ZONoAPTOVw+h5M4rN23o1ud/coLZwXdyR kqWr+fXu1cCyVofnFlUrAuWPtP8039KK4COYnq+RU7WRNP4SlFg2VqclBWgb43L6cc31/13eAmkAW iYAKLc3RNQxrMBFim7IPtN8ivPp1dTYyphSfvo3+RypLJ16Z9pv0Zi49W/tjBQmfUHHBuv75rXV/g rwG7yizsiIdyBHTdgVRsTpjV9eIhCX8R2CEcX9YQRdepd/2eRt0pZqqFGJTUMXMKzkw3WZNp3ri6n CoHgObtnQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMZP-0003KT-5J; Mon, 22 Jun 2020 13:33:07 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLx2-0004hz-J4 for hostap@merlin.infradead.org; Mon, 22 Jun 2020 12:53:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=Nzu8awsVquUd1V7ZamY6O8Yd3gfaiDBlVMlNivMukf8=; b=iqafMy6afmIOpMenmAif4CSFOZ dn0MIjR9QLKOmupNwUKvcPW4eCy/lxxKKQ/XFgn41osGD2Mps2UrgISIw0+GVodG6qXEf1RMqNesW cvUinF3JsRqWaR14fLXpDEogC8Hm/1EnyRyxlS1j6aZidI/WbNOQhzaUih/JYYGHJx6+aBnPpHgpr GikSIVCqnJmdA4aU8saQrWT9f5p7Q7ckg+7sHzXkG2Z0Tl1RL1cwcX9c3uc4LyOJCJVUgmmH4VevR gVZ9gQysstrF4yOTD2TZbyezUzdq0TEwnIIs+QidUFFvpL1BE/rIezfTuOr5np7pEtu43FzzcrPMo VEqktiew==; Received: from s3.sipsolutions.net ([2a01:4f8:191:4433::2] helo=sipsolutions.net) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnHbR-0003XQ-DQ for hostap@lists.infradead.org; Mon, 22 Jun 2020 08:14:55 +0000 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1jnHbI-009x6F-O6; Mon, 22 Jun 2020 10:14:44 +0200 From: Johannes Berg To: hostap@lists.infradead.org Subject: [PATCH v3 3/6] build: disable built-in rules Date: Mon, 22 Jun 2020 10:14:31 +0200 Message-Id: <1592813672-Ide74bfaa4f5d4a7c630198a163d950264e139e85@changeid> X-Mailer: git-send-email 2.26.2 In-Reply-To: <1592813672-I81366372464f4b460a73bad9da126e78d1d692a5@changeid> References: <1592813672-I81366372464f4b460a73bad9da126e78d1d692a5@changeid> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200622_091453_744282_9BBDC125 X-CRM114-Status: UNSURE ( 8.04 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.5 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.4 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Johannes Berg Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Johannes Berg This makes things faster and easier to debug. Signed-off-by: Johannes Berg --- src/build.rules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/build.rules b/src/build.rules index c83683ce6213..d6861a671306 100644 --- a/src/build.rules +++ b/src/build.rules @@ -1,5 +1,8 @@ all: $(VERIFY) $(ALL) $(EXTRA_TARGETS) +# disable built-in rules +.SUFFIXES: + ifndef CC CC=gcc endif From patchwork Mon Jun 22 08:14:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 1314380 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sipsolutions.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=GxZKabnS; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=fJsA+cQO; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49r9Ln2B5xz9sQt for ; Mon, 22 Jun 2020 23:32:17 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sFPXcbwIVSebWA+YYVqX/1caE2A0zg83xPyn4VZRhMc=; b=GxZKabnS7KPdtKEk9FHyo0iYg K78ls08ytB4A4VGZd/yVg+2mRH2vLmh1db4rmcO6fzvEGUPjYaNFqT1MJULvjq+wnKQCuwbAb1+68 vUp6vYqrb0frSyBFxJNokGpjNdd18yCqz1drjCdYDJO52X1ypd66Gp5KQktRxDI0hfsMSkAJPp+Au klN75qYbLjWNRsTlcWLv1eC/Kz8bYjAXAXGxvnnN21fdGguFkjBndYwU0rHpTNRB3vllT4c25j343 NyD4/FPIdW4uUsJz3bM7kM6AQ4EJAzgBBzcud2LGNl6aiuuJ6bR2Nm2VDFyGTuYU69hdy1rMUziB4 vRlAlIyyA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMWO-00026F-Oz; Mon, 22 Jun 2020 13:30:01 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLwq-0004ca-G6 for hostap@merlin.infradead.org; Mon, 22 Jun 2020 12:53:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=F7nXKQZaEdNsJjzwYAyXrieNXy6mN5pwp2BoL+C44QA=; b=fJsA+cQOTYa+8B3wZRlp9Tp/BX /GPL81uRnVot4M1Kfdqhh2vlW/ZFD6jHDi/rlnMkbwL5BEQ92U2cFPO/MKR/3666QlGba2ldwiwBA 6pG4B+eMW6hdwimoFtr4AKY+SCOuH///6z+smbdyFdx30K2NabHjJED1BM3Ihoe8Uapo5DCcNkQRw YYSdjwlZu6lGgteTaFSb+hlfSnPe0OZhB7HQiEnrymYUmMCTjkOAHLlGZipp+ofJZTgIY4rgzj+MG 5bAmZiHVZkVIDwvdyF1iB5c8GKnv2yhVCjXOEPBBuqOkvdmSNFTONxwgNMCsJrBf6ovtYfrDsCBgZ gJNuc8LA==; Received: from s3.sipsolutions.net ([2a01:4f8:191:4433::2] helo=sipsolutions.net) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnHbU-0003Xk-5n for hostap@lists.infradead.org; Mon, 22 Jun 2020 08:14:59 +0000 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1jnHbJ-009x6F-00; Mon, 22 Jun 2020 10:14:45 +0200 From: Johannes Berg To: hostap@lists.infradead.org Subject: [PATCH v3 4/6] build: use common.rules in lib.rules Date: Mon, 22 Jun 2020 10:14:32 +0200 Message-Id: <1592813672-I847cd5e04defedd5c34720fe4688c0173f883e9a@changeid> X-Mailer: git-send-email 2.26.2 In-Reply-To: <1592813672-I81366372464f4b460a73bad9da126e78d1d692a5@changeid> References: <1592813672-I81366372464f4b460a73bad9da126e78d1d692a5@changeid> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200622_091456_637441_B6240567 X-CRM114-Status: UNSURE ( 9.01 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.5 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.4 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Johannes Berg Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Johannes Berg Use the new common.rules in lib.rules and also unify the clean targets to lib.rules. Signed-off-by: Johannes Berg --- src/ap/Makefile | 6 ++---- src/common/Makefile | 6 ++---- src/crypto/Makefile | 7 ++----- src/eap_common/Makefile | 6 ++---- src/eap_peer/Makefile | 6 ++---- src/eap_server/Makefile | 6 ++---- src/eapol_auth/Makefile | 6 ++---- src/eapol_supp/Makefile | 6 ++---- src/l2_packet/Makefile | 6 ++---- src/lib.rules | 26 ++++---------------------- src/p2p/Makefile | 6 ++---- src/radius/Makefile | 7 ++----- src/rsn_supp/Makefile | 6 ++---- src/tls/Makefile | 7 ++----- src/utils/Makefile | 7 ++----- src/wps/Makefile | 6 ++---- 16 files changed, 34 insertions(+), 86 deletions(-) diff --git a/src/ap/Makefile b/src/ap/Makefile index 54e48a0dd032..805181d00c12 100644 --- a/src/ap/Makefile +++ b/src/ap/Makefile @@ -1,12 +1,10 @@ -all: libap.a +ALL=libap.a -clean: - rm -f *~ *.o *.d *.gcno *.gcda *.gcov libap.a +include ../lib.rules install: @echo Nothing to be made. -include ../lib.rules CFLAGS += -DHOSTAPD CFLAGS += -DNEED_AP_MLME diff --git a/src/common/Makefile b/src/common/Makefile index ccb280e9019c..eeb69f0d4ff3 100644 --- a/src/common/Makefile +++ b/src/common/Makefile @@ -1,12 +1,10 @@ -all: libcommon.a +ALL=libcommon.a -clean: - rm -f *~ *.o *.d *.gcno *.gcda *.gcov libcommon.a +include ../lib.rules install: @echo Nothing to be made. -include ../lib.rules CFLAGS += -DCONFIG_IEEE80211R CFLAGS += -DCONFIG_HS20 diff --git a/src/crypto/Makefile b/src/crypto/Makefile index c40e95566104..94eac66fa955 100644 --- a/src/crypto/Makefile +++ b/src/crypto/Makefile @@ -1,14 +1,11 @@ -all: libcrypto.a +ALL=libcrypto.a -clean: - rm -f *~ *.o *.d *.gcno *.gcda *.gcov libcrypto.a +include ../lib.rules install: @echo Nothing to be made. -include ../lib.rules - CFLAGS += -DCONFIG_CRYPTO_INTERNAL CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER diff --git a/src/eap_common/Makefile b/src/eap_common/Makefile index f00b438c6188..7d6777babf4f 100644 --- a/src/eap_common/Makefile +++ b/src/eap_common/Makefile @@ -1,12 +1,10 @@ -all: libeap_common.a +ALL=libeap_common.a -clean: - rm -f *~ *.o *.d *.gcno *.gcda *.gcov libeap_common.a +include ../lib.rules install: @echo Nothing to be made. -include ../lib.rules LIB_OBJS= \ chap.o \ diff --git a/src/eap_peer/Makefile b/src/eap_peer/Makefile index 6531ccd5dac0..282b89696e5c 100644 --- a/src/eap_peer/Makefile +++ b/src/eap_peer/Makefile @@ -1,7 +1,6 @@ -all: libeap_peer.a +ALL=libeap_peer.a -clean: - rm -f *~ *.o *.so *.d *.gcno *.gcda *.gcov libeap_peer.a +include ../lib.rules install: if ls *.so >/dev/null 2>&1; then \ @@ -9,7 +8,6 @@ install: cp *.so $(DESTDIR)$(LIBDIR)/wpa_supplicant \ ; fi -include ../lib.rules CFLAGS += -DIEEE8021X_EAPOL diff --git a/src/eap_server/Makefile b/src/eap_server/Makefile index 1172b72466d2..4ece9aa67b35 100644 --- a/src/eap_server/Makefile +++ b/src/eap_server/Makefile @@ -1,12 +1,10 @@ -all: libeap_server.a +ALL=libeap_server.a -clean: - rm -f *~ *.o *.d *.gcno *.gcda *.gcov libeap_server.a +include ../lib.rules install: @echo Nothing to be made. -include ../lib.rules CFLAGS += -DCONFIG_HS20 diff --git a/src/eapol_auth/Makefile b/src/eapol_auth/Makefile index 7b927a127731..0175a19d940e 100644 --- a/src/eapol_auth/Makefile +++ b/src/eapol_auth/Makefile @@ -1,12 +1,10 @@ -all: libeapol_auth.a +ALL=libeapol_auth.a -clean: - rm -f *~ *.o *.d *.gcno *.gcda *.gcov libeapol_auth.a +include ../lib.rules install: @echo Nothing to be made. -include ../lib.rules LIB_OBJS = eapol_auth_sm.o eapol_auth_dump.o diff --git a/src/eapol_supp/Makefile b/src/eapol_supp/Makefile index 80db9d48689e..c98280b469b7 100644 --- a/src/eapol_supp/Makefile +++ b/src/eapol_supp/Makefile @@ -1,12 +1,10 @@ -all: libeapol_supp.a +ALL=libeapol_supp.a -clean: - rm -f *~ *.o *.d *.gcno *.gcda *.gcov libeapol_supp.a +include ../lib.rules install: @echo Nothing to be made. -include ../lib.rules CFLAGS += -DIEEE8021X_EAPOL diff --git a/src/l2_packet/Makefile b/src/l2_packet/Makefile index 47925b790c74..20f229511e9c 100644 --- a/src/l2_packet/Makefile +++ b/src/l2_packet/Makefile @@ -1,12 +1,10 @@ -all: libl2_packet.a +ALL=libl2_packet.a -clean: - rm -f *~ *.o *.d *.gcno *.gcda *.gcov libl2_packet.a +include ../lib.rules install: @echo Nothing to be made. -include ../lib.rules LIB_OBJS = l2_packet_linux.o diff --git a/src/lib.rules b/src/lib.rules index a46315442d2a..81b895967e01 100644 --- a/src/lib.rules +++ b/src/lib.rules @@ -1,10 +1,5 @@ -ifndef CC -CC=gcc -endif - -ifndef CFLAGS -CFLAGS = -MMD -O2 -Wall -g -endif +LIB_RULES := $(lastword $(MAKEFILE_LIST)) +include $(dir $(LIB_RULES))build.rules ifdef TEST_FUZZ CFLAGS += -DCONFIG_NO_RANDOM_POOL @@ -14,18 +9,5 @@ endif CFLAGS += $(FUZZ_CFLAGS) CFLAGS += -I.. -I../utils - -Q=@ -E=echo -ifeq ($(V), 1) -Q= -E=true -endif -ifeq ($(QUIET), 1) -Q=@ -E=true -endif - -%.o: %.c - $(Q)$(CC) -c -o $@ $(CFLAGS) $< - @$(E) " CC " $< +clean: + $(Q)rm -f *~ *.o *.d *.gcno *.gcda *.gcov $(ALL) diff --git a/src/p2p/Makefile b/src/p2p/Makefile index 5587fcf281d3..174cf6f6f7f4 100644 --- a/src/p2p/Makefile +++ b/src/p2p/Makefile @@ -1,12 +1,10 @@ -all: libp2p.a +ALL=libp2p.a -clean: - rm -f *~ *.o *.d *.gcno *.gcda *.gcov libp2p.a +include ../lib.rules install: @echo Nothing to be made. -include ../lib.rules CFLAGS += -DCONFIG_WIFI_DISPLAY CFLAGS += -DCONFIG_WPS_NFC diff --git a/src/radius/Makefile b/src/radius/Makefile index 3ad4751dfbfe..dbe9a9a9fa71 100644 --- a/src/radius/Makefile +++ b/src/radius/Makefile @@ -1,14 +1,11 @@ -all: libradius.a +ALL=libradius.a -clean: - rm -f *~ *.o *.d *.gcno *.gcda *.gcov libradius.a +include ../lib.rules install: @echo Nothing to be made. -include ../lib.rules - CFLAGS += -DCONFIG_IPV6 LIB_OBJS= \ diff --git a/src/rsn_supp/Makefile b/src/rsn_supp/Makefile index eea0efba96e6..255cb73a7505 100644 --- a/src/rsn_supp/Makefile +++ b/src/rsn_supp/Makefile @@ -1,12 +1,10 @@ -all: librsn_supp.a +ALL=librsn_supp.a -clean: - rm -f *~ *.o *.d *.gcno *.gcda *.gcov librsn_supp.a +include ../lib.rules install: @echo Nothing to be made. -include ../lib.rules CFLAGS += -DCONFIG_IEEE80211R CFLAGS += -DCONFIG_TDLS diff --git a/src/tls/Makefile b/src/tls/Makefile index 52a890a157d2..0a36cf9e4530 100644 --- a/src/tls/Makefile +++ b/src/tls/Makefile @@ -1,14 +1,11 @@ -all: libtls.a +ALL=libtls.a -clean: - rm -f *~ *.o *.d libtls.a +include ../lib.rules install: @echo Nothing to be made. -include ../lib.rules - CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH CFLAGS += -DCONFIG_CRYPTO_INTERNAL CFLAGS += -DCONFIG_TLSV11 diff --git a/src/utils/Makefile b/src/utils/Makefile index 1ee2bee67f6b..29fb1295d726 100644 --- a/src/utils/Makefile +++ b/src/utils/Makefile @@ -1,14 +1,11 @@ -all: libutils.a +ALL=libutils.a -clean: - rm -f *~ *.o *.d *.gcno *.gcda *.gcov libutils.a +include ../lib.rules install: @echo Nothing to be made. -include ../lib.rules - #CFLAGS += -DWPA_TRACE CFLAGS += -DCONFIG_IPV6 CFLAGS += -DCONFIG_DEBUG_FILE diff --git a/src/wps/Makefile b/src/wps/Makefile index 4806fe8dadf7..811b62977be8 100644 --- a/src/wps/Makefile +++ b/src/wps/Makefile @@ -1,12 +1,10 @@ -all: libwps.a +ALL=libwps.a -clean: - rm -f *~ *.o *.d *.gcno *.gcda *.gcov libwps.a +include ../lib.rules install: @echo Nothing to be made. -include ../lib.rules CFLAGS += -DCONFIG_P2P CFLAGS += -DCONFIG_WPS_OOB From patchwork Mon Jun 22 08:14:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 1314379 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sipsolutions.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=Lqs6elZq; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=owbLZxDY; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49r9L82PHzz9sQt for ; Mon, 22 Jun 2020 23:31:44 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1rt5iI3dHUivoPObWLtVpswjmFfVArpSd5btJ3urL1c=; b=Lqs6elZqolm5YJVSdq+Cr85dn vLEtBeyb4iSLOyr/KynjM1JL5xjgq4oW1uzsGy3oA0jp33JK7mZUYwJn8txs9/IfHzYiIN7/k45FU s8vEpx5iRjTx3uxPH7Fr6U5ML9d8FMwA1AwBjJ/Z6ShI2aFlob0xTjUPixiV2Krm6VgFXOt4C16hQ T09ELnUJQicu8qQjVpdqiDoLFfTnr3kor53U63/D/Sgpva2qoQpMBgLr4szmIXX/YnV6c0QAZK5Hu qIKejaXpQUVsi7R+8oEs1eAFyD4T62HQdHgQTSCAT0xCHmO49UyQuoBol0StFdtjFWzNFF8V65EN3 gGP61gZdA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMW4-0001yX-3s; Mon, 22 Jun 2020 13:29:40 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLwq-0004cZ-Fr for hostap@merlin.infradead.org; Mon, 22 Jun 2020 12:53:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=FsKIFl1ykR2BSZ9aYXiZWMSaYTYg9D2NG2abVFNA9I4=; b=owbLZxDY5f803iRjHv02FB/Dec SB87ib6ESZAa58RZ+1y7QeUFoGIZIkXyFE6IUOAADR+Bu+H8VJKRKuEoyDPbTbxXtaMrL/TWW4eXQ IPOAUR5uLShy77Yc8SoalQ90oVJzoTmkBE0PloJkL1eg6WJFKNmFivpsRmQU4RAsKmZpWEnm1uJH0 ZkzDIBJZcHzDjkyy0uSnjL0WoXHt1Nsju98dsj/7FHI39QV67f/umLlo5LIgMz88xtcCw3aOCaeuY 2oDmE5aaf9FxSTyyC0zKt7TZ0M8BeOPbEyAftDXgn552P2im3Mvl9UF2KLRFK94kX7D3/hu6ol3d9 1futxMtQ==; Received: from s3.sipsolutions.net ([2a01:4f8:191:4433::2] helo=sipsolutions.net) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnHbM-0003Wn-1T for hostap@lists.infradead.org; Mon, 22 Jun 2020 08:14:51 +0000 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1jnHbJ-009x6F-8w; Mon, 22 Jun 2020 10:14:45 +0200 From: Johannes Berg To: hostap@lists.infradead.org Subject: [PATCH v3 5/6] build: add a common-clean target Date: Mon, 22 Jun 2020 10:14:33 +0200 Message-Id: <1592813672-If0b4368e847a16595115731f5341cfd34714b387@changeid> X-Mailer: git-send-email 2.26.2 In-Reply-To: <1592813672-I81366372464f4b460a73bad9da126e78d1d692a5@changeid> References: <1592813672-I81366372464f4b460a73bad9da126e78d1d692a5@changeid> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200622_091448_481549_A34232BE X-CRM114-Status: GOOD ( 10.60 ) X-Spam-Score: -1.5 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.4 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Johannes Berg Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Johannes Berg Clean up in a more common fashion as well, initially for ../src/. Also add $(Q) to the clean target in src/ Signed-off-by: Johannes Berg --- eap_example/Makefile | 5 ++--- hostapd/Makefile | 5 ++--- hs20/client/Makefile | 4 ++-- hs20/server/Makefile | 4 ++-- radius_example/Makefile | 5 ++--- src/Makefile | 4 ++-- src/build.rules | 8 ++++++++ tests/Makefile | 5 ++--- wlantest/Makefile | 5 ++--- wpa_supplicant/Makefile | 4 ++-- 10 files changed, 26 insertions(+), 23 deletions(-) diff --git a/eap_example/Makefile b/eap_example/Makefile index e5f3b3471035..ecef3c97662b 100644 --- a/eap_example/Makefile +++ b/eap_example/Makefile @@ -116,8 +116,7 @@ endif eap_example: $(OBJS_ex) $(LIBEAP) $(LDO) $(LDFLAGS) -o eap_example $(OBJS_ex) -L. -leap $(LIBS) -clean: - $(MAKE) -C ../src clean - rm -f core *~ *.o *.d libeap.a libeap.so $(ALL) +clean: common-clean + rm -f core *~ *.o *.d libeap.a libeap.so -include $(OBJS:%.o=%.d) diff --git a/hostapd/Makefile b/hostapd/Makefile index 5c830fb448b1..2e15c8911483 100644 --- a/hostapd/Makefile +++ b/hostapd/Makefile @@ -1362,9 +1362,8 @@ 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 +clean: common-clean + rm -f core *~ *.o nt_password_hash hlr_auc_gw rm -f sae_pk_gen rm -f *.d *.gcno *.gcda *.gcov rm -f lcov.info diff --git a/hs20/client/Makefile b/hs20/client/Makefile index 70fb73598dfe..cbb1105e186b 100644 --- a/hs20/client/Makefile +++ b/hs20/client/Makefile @@ -75,8 +75,8 @@ hs20-osu-client: $(OBJS) $(Q)$(LDO) $(LDFLAGS) -o hs20-osu-client $(OBJS) $(LIBS) @$(E) " LD " $@ -clean: - rm -f core *~ *.o *.d hs20-osu-client +clean: common-clean + rm -f core *~ *.o *.d rm -f ../../src/utils/*.o rm -f ../../src/utils/*.d rm -f ../../src/common/*.o diff --git a/hs20/server/Makefile b/hs20/server/Makefile index 9ec7e4491ad4..24b81cd8a28a 100644 --- a/hs20/server/Makefile +++ b/hs20/server/Makefile @@ -36,8 +36,8 @@ OBJS += ../../src/utils/xml_libxml2.o hs20_spp_server: $(OBJS) $(LDO) $(LDFLAGS) -o hs20_spp_server $(OBJS) $(LIBS) -clean: - rm -f core *~ *.o *.d hs20_spp_server +clean: common-clean + rm -f core *~ *.o *.d rm -f ../../src/utils/*.o rm -f ../../src/utils/*.d rm -f ../../src/crypto/*.o diff --git a/radius_example/Makefile b/radius_example/Makefile index 75cb3caeb3dd..3492ac70fc49 100644 --- a/radius_example/Makefile +++ b/radius_example/Makefile @@ -27,8 +27,7 @@ OBJS_ex = radius_example.o radius_example: $(OBJS_ex) $(LIBS) $(LDO) $(LDFLAGS) -o radius_example $(OBJS_ex) $(LIBS) $(LLIBS) -clean: - $(MAKE) -C ../src clean - rm -f core *~ *.o *.d $(ALL) +clean: common-clean + rm -f core *~ *.o *.d -include $(OBJS:%.o=%.d) diff --git a/src/Makefile b/src/Makefile index c9e84c11de7a..6eb7f2acb5a1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -5,8 +5,8 @@ all: for d in $(SUBDIRS); do [ -d $$d ] && $(MAKE) -C $$d; done clean: - for d in $(SUBDIRS); do [ -d $$d ] && $(MAKE) -C $$d clean; done - rm -f *~ + $(Q)for d in $(SUBDIRS); do [ -d $$d ] && $(MAKE) -C $$d clean; done + $(Q)rm -f *~ install: for d in $(SUBDIRS); do [ -d $$d ] && $(MAKE) -C $$d install; done diff --git a/src/build.rules b/src/build.rules index d6861a671306..e70a0aa2cda7 100644 --- a/src/build.rules +++ b/src/build.rules @@ -3,6 +3,9 @@ all: $(VERIFY) $(ALL) $(EXTRA_TARGETS) # disable built-in rules .SUFFIXES: +ROOTDIR := $(dir $(lastword $(MAKEFILE_LIST))) +ROOTDIR := $(dir $(ROOTDIR:%/=%)) + ifndef CC CC=gcc endif @@ -43,3 +46,8 @@ else $(Q)$(CC) -c -o $@ $(CFLAGS) $< @$(E) " CC " $< endif + +.PHONY: common-clean +common-clean: + $(Q)$(MAKE) -C $(ROOTDIR)/src clean + $(Q)rm -f $(ALL) diff --git a/tests/Makefile b/tests/Makefile index 119ed7a2ae90..4d9f2e0ab8c1 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -151,9 +151,8 @@ run-tests: $(ALL) @echo @echo All tests completed successfully. -clean: - $(MAKE) -C ../src clean - rm -f $(ALL) *~ *.o *.d +clean: common-clean + rm -f *~ *.o *.d rm -f test-eapol rm -f test-https rm -f test-json diff --git a/wlantest/Makefile b/wlantest/Makefile index 0324fa54855e..fee80f6f4e2c 100644 --- a/wlantest/Makefile +++ b/wlantest/Makefile @@ -81,8 +81,7 @@ wlantest_cli: $(OBJS_cli) $(OWN_LIBS) test_vectors: $(TOBJS) $(OWN_LIBS) $(LDO) $(LDFLAGS) -o test_vectors $(TOBJS) $(OWN_LIBS) $(LIBS) -clean: - $(MAKE) -C ../src clean - rm -f core *~ *.o *.d $(ALL) +clean: common-clean + rm -f core *~ *.o *.d -include $(OBJS:%.o=%.d) diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile index be3dad3c8a9c..f34379c5e2f6 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile @@ -2003,11 +2003,11 @@ lcov-html: wpa_supplicant.gcda lcov -c -d .. > lcov.info genhtml lcov.info --output-directory lcov-html -clean: +clean: common-clean $(MAKE) -C ../src clean $(MAKE) -C dbus clean rm -f core *~ *.o *.d *.gcno *.gcda *.gcov - rm -f eap_*.so $(ALL) $(WINALL) eapol_test preauth_test + rm -f eap_*.so $(WINALL) eapol_test preauth_test rm -f wpa_priv rm -f nfc_pw_token rm -f lcov.info From patchwork Mon Jun 22 08:14:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 1314397 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sipsolutions.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=q4L73uZ3; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=EpkmJqBk; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49r9kh3D8yz9sQt for ; Mon, 22 Jun 2020 23:49:32 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kz73eYIPFTQ8Ox8a/CUezG27N7Vbh/URkZxAcgswMY0=; b=q4L73uZ3eSvPeNCSgXx3twxJM B54Xagb438f3+3SO0J7VZWXPyYNxhkEgA6QCv6aUWJf+zDdfDM7cjPSgtjDXPUxIIlxZ+Apc3lXLb GZyMN/v8lqEBqWQ3sxoPyrBn/VkShLFAJ97HNDH2GbnpcsUovw6xpTfbZD0uZwOTjqJb0y72zbExY onkoSnNuofK9Mi8w6GF61Kpg9IgErKoLFnnoeAFxFh2opRtkEyrrgu49wYp56y7C7M0B2H/V6vquP CWfnE8gkcTPIKWlE+JL+KGYwmj/onQu+zqyiHGYdWFwLZyZ3sVbXfxCxA0vMiRaP3m5oLuFqFq7Qc G09PYA2gw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnMnH-0001bY-0u; Mon, 22 Jun 2020 13:47:27 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnLxv-000553-8r for hostap@merlin.infradead.org; Mon, 22 Jun 2020 12:54:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=/ySKc68xfs9CW581JtgiY3IoutlTdkLvFMFI9zkc7Zc=; b=EpkmJqBkehNHbCWB19lXMkx2kB nMZZa+eqTklMc6F04c/UM3IET9Q/rcmXXDROqsSvf5CcLkPubkWH2L/M2upxaBdFfO3AyFr1HEaDW BQvy7ZiNgDIEVR8uK75Vpcq2WPYxYFMJTJZm8lSb7beF2t9C3b1jnsnf4Iilbv0ayJ2Ob8kANVaf1 kEWVI1WdkvcF5A92ay9onpnFbC+7/DFb9Ee2bvZjm1uBSBv3/YWrlrnbV99vVGfTAlTJ4Zscp8zuf OcGCt1s8KsrDoe7hag+i8x1i7aewi0WvKUPG6dOb22TziM5OKEE3BaKPMXN1XLgyAexJjNkjolb7Y wvNChDNg==; Received: from s3.sipsolutions.net ([2a01:4f8:191:4433::2] helo=sipsolutions.net) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnHbO-0003X5-9v for hostap@lists.infradead.org; Mon, 22 Jun 2020 08:14:54 +0000 Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1jnHbJ-009x6F-Gf; Mon, 22 Jun 2020 10:14:45 +0200 From: Johannes Berg To: hostap@lists.infradead.org Subject: [PATCH v3 6/6] build: put object files into build/ folder Date: Mon, 22 Jun 2020 10:14:34 +0200 Message-Id: <1592813672-I22e373c8507f766a8c489a5df7c9fd165db58375@changeid> X-Mailer: git-send-email 2.26.2 In-Reply-To: <1592813672-I81366372464f4b460a73bad9da126e78d1d692a5@changeid> References: <1592813672-I81366372464f4b460a73bad9da126e78d1d692a5@changeid> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200622_091450_777941_746A368A X-CRM114-Status: GOOD ( 12.30 ) X-Spam-Score: -1.5 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.4 KHOP_HELO_FCRDNS Relay HELO differs from its IP's reverse DNS X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Johannes Berg Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Johannes Berg 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. Signed-off-by: Johannes Berg --- .gitignore | 1 + hostapd/Makefile | 24 +++++++++++++++++------- hs20/client/Makefile | 13 ++----------- hs20/server/Makefile | 9 ++------- src/ap/Makefile | 3 +-- src/build.rules | 34 ++++++++++++++++++++++++++-------- src/common/Makefile | 3 +-- src/crypto/Makefile | 3 +-- src/eap_common/Makefile | 3 +-- src/eap_peer/Makefile | 3 +-- src/eap_server/Makefile | 3 +-- src/eapol_auth/Makefile | 3 +-- src/eapol_supp/Makefile | 3 +-- src/l2_packet/Makefile | 3 +-- src/p2p/Makefile | 3 +-- src/radius/Makefile | 3 +-- src/rsn_supp/Makefile | 3 +-- src/tls/Makefile | 3 +-- src/utils/Makefile | 3 +-- src/wps/Makefile | 3 +-- wlantest/Makefile | 7 ++++--- wpa_supplicant/Makefile | 32 ++++++++++++++++++++++---------- 22 files changed, 89 insertions(+), 76 deletions(-) diff --git a/.gitignore b/.gitignore index 6a985a75df43..bfbdb307d736 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ wlantest/test_vectors wlantest/wlantest wlantest/wlantest_cli **/parallel-vm.log +build/ diff --git a/hostapd/Makefile b/hostapd/Makefile index 2e15c8911483..9168b7d49b47 100644 --- a/hostapd/Makefile +++ b/hostapd/Makefile @@ -1,6 +1,11 @@ ALL=hostapd hostapd_cli VERIFY=verify_config +# before build.rules for code coverage +-include .config +# and export for sub-makefiles +export CONFIG_CODE_COVERAGE + include ../src/build.rules ifdef LIBS @@ -27,8 +32,6 @@ CFLAGS += -I$(abspath ../src/utils) 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) @@ -1283,6 +1286,8 @@ install: $(addprefix $(DESTDIR)$(BINDIR)/,$(ALL)) BCHECK=../src/drivers/build.hostapd +$(call BUILDOBJS,OBJS) + hostapd: $(BCHECK) $(OBJS) $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) @$(E) " LD " $@ @@ -1290,6 +1295,9 @@ hostapd: $(BCHECK) $(OBJS) ifdef CONFIG_WPA_TRACE OBJS_c += ../src/utils/trace.o endif + +$(call BUILDOBJS,OBJS_c) + hostapd_cli: $(OBJS_c) $(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c) @$(E) " LD " $@ @@ -1346,6 +1354,10 @@ SOBJS += ../src/crypto/sha256-kdf.o SOBJS += ../src/crypto/sha384-kdf.o SOBJS += ../src/crypto/sha512-kdf.o +$(call BUILDOBJS,NOBJS) +$(call BUILDOBJS,HOBJS) +$(call BUILDOBJS,SOBJS) + nt_password_hash: $(NOBJS) $(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n) @$(E) " LD " $@ @@ -1358,15 +1370,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..1987a51e928f 100644 --- a/hs20/client/Makefile +++ b/hs20/client/Makefile @@ -71,19 +71,10 @@ CFLAGS += -DEAP_TLS_OPENSSL OBJS += ../../src/crypto/tls_openssl_ocsp.o LIBS += -lssl -lcrypto +$(call BUILDOBJS,OBJS) 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..d02ce4850c39 100644 --- a/hs20/server/Makefile +++ b/hs20/server/Makefile @@ -33,14 +33,9 @@ CFLAGS += $(shell xml2-config --cflags) LIBS += $(shell xml2-config --libs) OBJS += ../../src/utils/xml_libxml2.o +$(call BUILDOBJS,OBJS) 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/src/ap/Makefile b/src/ap/Makefile index 805181d00c12..c381ab785385 100644 --- a/src/ap/Makefile +++ b/src/ap/Makefile @@ -65,7 +65,6 @@ LIB_OBJS= \ wps_hostapd.o \ x_snoop.o +$(call BUILDOBJS,LIB_OBJS) libap.a: $(LIB_OBJS) $(AR) crT $@ $? - --include $(OBJS:%.o=%.d) diff --git a/src/build.rules b/src/build.rules index e70a0aa2cda7..79df1b010839 100644 --- a/src/build.rules +++ b/src/build.rules @@ -4,7 +4,13 @@ all: $(VERIFY) $(ALL) $(EXTRA_TARGETS) .SUFFIXES: ROOTDIR := $(dir $(lastword $(MAKEFILE_LIST))) -ROOTDIR := $(dir $(ROOTDIR:%/=%)) +ROOTDIR := $(dir $(ROOTDIR:%../src/=%))../ +BUILDDIR := $(ROOTDIR)build +_PROJ := $(abspath $(PWD)) +ABSROOT := $(abspath $(ROOTDIR)) +_PROJ := $(_PROJ:$(ABSROOT)/%=%) +COVSUFFIX = $(if $(CONFIG_CODE_COVERAGE),-cov,) +PROJ = $(_PROJ)$(COVSUFFIX) ifndef CC CC=gcc @@ -37,17 +43,29 @@ ifeq ($(Q),@) MAKEFLAGS += --no-print-directory endif -ifdef CONFIG_CODE_COVERAGE -%.o: %.c +_DIRS = +$(BUILDDIR): + mkdir -p $(BUILDDIR) +.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))) + +define BUILDOBJS = +$(eval $(1) := $$(call BUILDOBJ,$($(1)))) +$(eval -include $($(1):%.o=%.d)) +$(eval _DIRS += $(dir $($(1)))) +endef .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..f369f8191d99 100644 --- a/src/common/Makefile +++ b/src/common/Makefile @@ -19,7 +19,6 @@ LIB_OBJS= \ sae.o \ wpa_common.o +$(call BUILDOBJS,LIB_OBJS) libcommon.a: $(LIB_OBJS) $(AR) crT $@ $? - --include $(OBJS:%.o=%.d) diff --git a/src/crypto/Makefile b/src/crypto/Makefile index 94eac66fa955..cab74cd244fc 100644 --- a/src/crypto/Makefile +++ b/src/crypto/Makefile @@ -66,7 +66,6 @@ LIB_OBJS += random.o endif +$(call BUILDOBJS,LIB_OBJS) libcrypto.a: $(LIB_OBJS) $(AR) crT $@ $? - --include $(OBJS:%.o=%.d) diff --git a/src/eap_common/Makefile b/src/eap_common/Makefile index 7d6777babf4f..7af4da005320 100644 --- a/src/eap_common/Makefile +++ b/src/eap_common/Makefile @@ -23,7 +23,6 @@ LIB_OBJS= \ eap_wsc_common.o \ ikev2_common.o +$(call BUILDOBJS,LIB_OBJS) 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..80e13e5f548e 100644 --- a/src/eap_peer/Makefile +++ b/src/eap_peer/Makefile @@ -15,7 +15,6 @@ LIB_OBJS= \ eap.o \ eap_methods.o +$(call BUILDOBJS,LIB_OBJS) 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..bce3d9ce8d28 100644 --- a/src/eap_server/Makefile +++ b/src/eap_server/Makefile @@ -13,7 +13,6 @@ LIB_OBJS= \ eap_server_identity.o \ eap_server_methods.o +$(call BUILDOBJS,LIB_OBJS) 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..da61c9395a97 100644 --- a/src/eapol_auth/Makefile +++ b/src/eapol_auth/Makefile @@ -8,7 +8,6 @@ install: LIB_OBJS = eapol_auth_sm.o eapol_auth_dump.o +$(call BUILDOBJS,LIB_OBJS) 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..2f87e8f682e2 100644 --- a/src/eapol_supp/Makefile +++ b/src/eapol_supp/Makefile @@ -10,7 +10,6 @@ CFLAGS += -DIEEE8021X_EAPOL LIB_OBJS = eapol_supp_sm.o +$(call BUILDOBJS,LIB_OBJS) 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..bd8d83d63354 100644 --- a/src/l2_packet/Makefile +++ b/src/l2_packet/Makefile @@ -8,7 +8,6 @@ install: LIB_OBJS = l2_packet_linux.o +$(call BUILDOBJS,LIB_OBJS) libl2_packet.a: $(LIB_OBJS) $(AR) crT $@ $? - --include $(OBJS:%.o=%.d) diff --git a/src/p2p/Makefile b/src/p2p/Makefile index 174cf6f6f7f4..9a8846dc1c82 100644 --- a/src/p2p/Makefile +++ b/src/p2p/Makefile @@ -21,7 +21,6 @@ LIB_OBJS= \ p2p_sd.o \ p2p_utils.o +$(call BUILDOBJS,LIB_OBJS) libp2p.a: $(LIB_OBJS) $(AR) crT $@ $? - --include $(OBJS:%.o=%.d) diff --git a/src/radius/Makefile b/src/radius/Makefile index dbe9a9a9fa71..1ca6e88065c7 100644 --- a/src/radius/Makefile +++ b/src/radius/Makefile @@ -14,7 +14,6 @@ LIB_OBJS= \ radius_das.o \ radius_server.o +$(call BUILDOBJS,LIB_OBJS) libradius.a: $(LIB_OBJS) $(AR) crT $@ $? - --include $(OBJS:%.o=%.d) diff --git a/src/rsn_supp/Makefile b/src/rsn_supp/Makefile index 255cb73a7505..fb3bac53ba9c 100644 --- a/src/rsn_supp/Makefile +++ b/src/rsn_supp/Makefile @@ -19,7 +19,6 @@ LIB_OBJS= \ wpa.o \ wpa_ie.o +$(call BUILDOBJS,LIB_OBJS) librsn_supp.a: $(LIB_OBJS) $(AR) crT $@ $? - --include $(OBJS:%.o=%.d) diff --git a/src/tls/Makefile b/src/tls/Makefile index 0a36cf9e4530..db6f9a93a8d7 100644 --- a/src/tls/Makefile +++ b/src/tls/Makefile @@ -31,7 +31,6 @@ LIB_OBJS= \ x509v3.o +$(call BUILDOBJS,LIB_OBJS) libtls.a: $(LIB_OBJS) $(AR) crT $@ $? - --include $(OBJS:%.o=%.d) diff --git a/src/utils/Makefile b/src/utils/Makefile index 29fb1295d726..1b987e489962 100644 --- a/src/utils/Makefile +++ b/src/utils/Makefile @@ -34,7 +34,6 @@ LIB_OBJS += edit.o #LIB_OBJS += pcsc_funcs.o +$(call BUILDOBJS,LIB_OBJS) libutils.a: $(LIB_OBJS) $(AR) crT $@ $? - --include $(OBJS:%.o=%.d) diff --git a/src/wps/Makefile b/src/wps/Makefile index 811b62977be8..e0b664dbab34 100644 --- a/src/wps/Makefile +++ b/src/wps/Makefile @@ -33,7 +33,6 @@ LIB_OBJS= \ wps_upnp_ssdp.o \ wps_upnp_web.o +$(call BUILDOBJS,LIB_OBJS) libwps.a: $(LIB_OBJS) $(AR) crT $@ $? - --include $(OBJS:%.o=%.d) diff --git a/wlantest/Makefile b/wlantest/Makefile index fee80f6f4e2c..8fe7fb7d832f 100644 --- a/wlantest/Makefile +++ b/wlantest/Makefile @@ -71,6 +71,9 @@ TOBJS += gcmp.o OBJS_cli = wlantest_cli.o +$(call BUILDOBJS,OBJS) +$(call BUILDOBJS,TOBJS) +$(call BUILDOBJS,OBJS_cli) wlantest: $(OBJS) $(OWN_LIBS) $(LDO) $(LDFLAGS) -o wlantest $(OBJS) $(OWN_LIBS) $(LIBS) @@ -82,6 +85,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 f34379c5e2f6..9286a1329b71 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile @@ -17,6 +17,11 @@ endif VERIFY=verify_config EXTRA_TARGETS=dynamic_eap_methods +# before build.rules for code coverage +-include .config +# and export for sub-makefiles +export CONFIG_CODE_COVERAGE + include ../src/build.rules ifdef LIBS @@ -39,8 +44,6 @@ CFLAGS += $(EXTRA_CFLAGS) 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) @@ -1870,28 +1873,34 @@ dynamic_eap_methods: $(EAPDYN) BCHECK=../src/drivers/build.wpa_supplicant +$(call BUILDOBJS,OBJS_priv) 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 +$(call BUILDOBJS,OBJS) wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) @$(E) " LD " $@ +$(call BUILDOBJS,OBJS_t) eapol_test: $(OBJS_t) $(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS) @$(E) " LD " $@ +$(call BUILDOBJS,OBJS_t2) preauth_test: $(OBJS_t2) $(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS) @$(E) " LD " $@ +$(call BUILDOBJS,OBJS_p) wpa_passphrase: $(OBJS_p) $(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p) $(LIBS) @$(E) " LD " $@ +$(call BUILDOBJS,OBJS_c) wpa_cli: $(OBJS_c) $(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c) @$(E) " LD " $@ @@ -1905,6 +1914,7 @@ LIBCTRLSO += ../src/utils/os_$(CONFIG_OS).c LIBCTRLSO += ../src/utils/common.c LIBCTRLSO += ../src/utils/wpa_debug.c +$(call BUILDOBJS,LIBCTRL) libwpa_client.a: $(LIBCTRL) $(Q)rm -f $@ $(Q)$(AR) crs $@ $? @@ -1914,14 +1924,17 @@ 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 +$(call BUILDOBJS,OBJS_wpatest) +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 " $@ +$(call BUILDOBJS,OBJS_nfc) nfc_pw_token: $(OBJS_nfc) $(Q)$(LDO) $(LDFLAGS) -o nfc_pw_token $(OBJS_nfc) $(LIBS) @$(E) " LD " $@ @@ -1999,8 +2012,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 @@ -2015,5 +2029,3 @@ clean: common-clean rm -f libwpa_client.a rm -f libwpa_client.so rm -f libwpa_test1 libwpa_test2 - --include $(OBJS:%.o=%.d)