[PATCH 2/2] build: make more library things common
Johannes Berg
johannes at sipsolutions.net
Mon Oct 12 06:14:05 EDT 2020
From: Johannes Berg <johannes.berg at intel.com>
We don't really need to duplicate more of this, so just
move the lib.rules include to the end and do more of the
stuff that's common anyway there.
Signed-off-by: Johannes Berg <johannes.berg at intel.com>
---
src/ap/Makefile | 9 +--------
src/common/Makefile | 9 +--------
src/crypto/Makefile | 10 +---------
src/eap_common/Makefile | 9 +--------
src/eap_peer/Makefile | 6 +-----
src/eap_server/Makefile | 9 +--------
src/eapol_auth/Makefile | 10 +---------
src/eapol_supp/Makefile | 9 +--------
src/l2_packet/Makefile | 9 +--------
src/lib.rules | 9 +++++++--
src/p2p/Makefile | 9 +--------
src/radius/Makefile | 9 +--------
src/rsn_supp/Makefile | 9 +--------
src/tls/Makefile | 10 +---------
src/utils/Makefile | 9 +--------
src/wps/Makefile | 9 +--------
16 files changed, 22 insertions(+), 122 deletions(-)
diff --git a/src/ap/Makefile b/src/ap/Makefile
index 9d67fb58b4e1..a1e9b7c44d2f 100644
--- a/src/ap/Makefile
+++ b/src/ap/Makefile
@@ -1,9 +1,3 @@
-include ../lib.rules
-
-install:
- @echo Nothing to be made.
-
-
CFLAGS += -DHOSTAPD
CFLAGS += -DNEED_AP_MLME
CFLAGS += -DCONFIG_ETH_P_OUI
@@ -63,5 +57,4 @@ LIB_OBJS= \
wps_hostapd.o \
x_snoop.o
-_OBJS_VAR := LIB_OBJS
-include ../objs.mk
+include ../lib.rules
diff --git a/src/common/Makefile b/src/common/Makefile
index a731c9230c0a..59ba6c5e2d78 100644
--- a/src/common/Makefile
+++ b/src/common/Makefile
@@ -1,9 +1,3 @@
-include ../lib.rules
-
-install:
- @echo Nothing to be made.
-
-
CFLAGS += -DCONFIG_IEEE80211R
CFLAGS += -DCONFIG_HS20
CFLAGS += -DCONFIG_SAE
@@ -17,5 +11,4 @@ LIB_OBJS= \
sae.o \
wpa_common.o
-_OBJS_VAR := LIB_OBJS
-include ../objs.mk
+include ../lib.rules
diff --git a/src/crypto/Makefile b/src/crypto/Makefile
index b0e13bd1d279..ce0997091de1 100644
--- a/src/crypto/Makefile
+++ b/src/crypto/Makefile
@@ -1,9 +1,3 @@
-include ../lib.rules
-
-install:
- @echo Nothing to be made.
-
-
CFLAGS += -DCONFIG_CRYPTO_INTERNAL
CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
@@ -63,6 +57,4 @@ ifndef TEST_FUZZ
LIB_OBJS += random.o
endif
-
-_OBJS_VAR := LIB_OBJS
-include ../objs.mk
+include ../lib.rules
diff --git a/src/eap_common/Makefile b/src/eap_common/Makefile
index c85d01de727b..fd058a09a64d 100644
--- a/src/eap_common/Makefile
+++ b/src/eap_common/Makefile
@@ -1,9 +1,3 @@
-include ../lib.rules
-
-install:
- @echo Nothing to be made.
-
-
LIB_OBJS= \
chap.o \
eap_common.o \
@@ -21,5 +15,4 @@ LIB_OBJS= \
eap_wsc_common.o \
ikev2_common.o
-_OBJS_VAR := LIB_OBJS
-include ../objs.mk
+include ../lib.rules
diff --git a/src/eap_peer/Makefile b/src/eap_peer/Makefile
index 1ce905d8c839..762c7a8ebbce 100644
--- a/src/eap_peer/Makefile
+++ b/src/eap_peer/Makefile
@@ -1,17 +1,13 @@
-include ../lib.rules
-
install:
if ls *.so >/dev/null 2>&1; then \
install -d $(DESTDIR)$(LIBDIR)/wpa_supplicant && \
cp *.so $(DESTDIR)$(LIBDIR)/wpa_supplicant \
; fi
-
CFLAGS += -DIEEE8021X_EAPOL
LIB_OBJS= \
eap.o \
eap_methods.o
-_OBJS_VAR := LIB_OBJS
-include ../objs.mk
+include ../lib.rules
diff --git a/src/eap_server/Makefile b/src/eap_server/Makefile
index c68565c07f9e..cc9b76d619a1 100644
--- a/src/eap_server/Makefile
+++ b/src/eap_server/Makefile
@@ -1,9 +1,3 @@
-include ../lib.rules
-
-install:
- @echo Nothing to be made.
-
-
CFLAGS += -DCONFIG_HS20
LIB_OBJS= \
@@ -11,5 +5,4 @@ LIB_OBJS= \
eap_server_identity.o \
eap_server_methods.o
-_OBJS_VAR := LIB_OBJS
-include ../objs.mk
+include ../lib.rules
diff --git a/src/eapol_auth/Makefile b/src/eapol_auth/Makefile
index 328e18f508e2..c82042f437b2 100644
--- a/src/eapol_auth/Makefile
+++ b/src/eapol_auth/Makefile
@@ -1,10 +1,2 @@
-include ../lib.rules
-
-install:
- @echo Nothing to be made.
-
-
LIB_OBJS = eapol_auth_sm.o eapol_auth_dump.o
-
-_OBJS_VAR := LIB_OBJS
-include ../objs.mk
+include ../lib.rules
diff --git a/src/eapol_supp/Makefile b/src/eapol_supp/Makefile
index 108e66c4c7aa..67a11857bd43 100644
--- a/src/eapol_supp/Makefile
+++ b/src/eapol_supp/Makefile
@@ -1,12 +1,5 @@
-include ../lib.rules
-
-install:
- @echo Nothing to be made.
-
-
CFLAGS += -DIEEE8021X_EAPOL
LIB_OBJS = eapol_supp_sm.o
-_OBJS_VAR := LIB_OBJS
-include ../objs.mk
+include ../lib.rules
diff --git a/src/l2_packet/Makefile b/src/l2_packet/Makefile
index 5c69413f3168..c616626bd3c7 100644
--- a/src/l2_packet/Makefile
+++ b/src/l2_packet/Makefile
@@ -1,10 +1,3 @@
-include ../lib.rules
-
-install:
- @echo Nothing to be made.
-
-
LIB_OBJS = l2_packet_linux.o
-_OBJS_VAR := LIB_OBJS
-include ../objs.mk
+include ../lib.rules
diff --git a/src/lib.rules b/src/lib.rules
index 99b7bd026958..8182db8c7eb7 100644
--- a/src/lib.rules
+++ b/src/lib.rules
@@ -12,10 +12,15 @@ endif
CFLAGS += $(FUZZ_CFLAGS)
CFLAGS += -I.. -I../utils
-.SECONDEXPANSION:
-$(ALL): $$(LIB_OBJS)
+_OBJS_VAR := LIB_OBJS
+include ../objs.mk
+
+$(ALL): $(LIB_OBJS)
@$(E) " AR $(notdir $@)"
$(Q)$(AR) crT $@ $?
+install:
+ @echo Nothing to be made.
+
clean:
$(Q)rm -f *~ *.o *.d *.gcno *.gcda *.gcov $(ALL)
diff --git a/src/p2p/Makefile b/src/p2p/Makefile
index 0289dec5e3b9..4d1618006c68 100644
--- a/src/p2p/Makefile
+++ b/src/p2p/Makefile
@@ -1,9 +1,3 @@
-include ../lib.rules
-
-install:
- @echo Nothing to be made.
-
-
CFLAGS += -DCONFIG_WIFI_DISPLAY
CFLAGS += -DCONFIG_WPS_NFC
@@ -19,5 +13,4 @@ LIB_OBJS= \
p2p_sd.o \
p2p_utils.o
-_OBJS_VAR := LIB_OBJS
-include ../objs.mk
+include ../lib.rules
diff --git a/src/radius/Makefile b/src/radius/Makefile
index 8d25400e9c59..8cfb33d35f9f 100644
--- a/src/radius/Makefile
+++ b/src/radius/Makefile
@@ -1,9 +1,3 @@
-include ../lib.rules
-
-install:
- @echo Nothing to be made.
-
-
CFLAGS += -DCONFIG_IPV6
LIB_OBJS= \
@@ -12,5 +6,4 @@ LIB_OBJS= \
radius_das.o \
radius_server.o
-_OBJS_VAR := LIB_OBJS
-include ../objs.mk
+include ../lib.rules
diff --git a/src/rsn_supp/Makefile b/src/rsn_supp/Makefile
index 25accf795767..d14d736c1db6 100644
--- a/src/rsn_supp/Makefile
+++ b/src/rsn_supp/Makefile
@@ -1,9 +1,3 @@
-include ../lib.rules
-
-install:
- @echo Nothing to be made.
-
-
CFLAGS += -DCONFIG_IEEE80211R
CFLAGS += -DCONFIG_TDLS
CFLAGS += -DCONFIG_WNM
@@ -17,5 +11,4 @@ LIB_OBJS= \
wpa.o \
wpa_ie.o
-_OBJS_VAR := LIB_OBJS
-include ../objs.mk
+include ../lib.rules
diff --git a/src/tls/Makefile b/src/tls/Makefile
index 0e79902ef364..c84fbe85938c 100644
--- a/src/tls/Makefile
+++ b/src/tls/Makefile
@@ -1,9 +1,3 @@
-include ../lib.rules
-
-install:
- @echo Nothing to be made.
-
-
CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
CFLAGS += -DCONFIG_CRYPTO_INTERNAL
CFLAGS += -DCONFIG_TLSV11
@@ -28,6 +22,4 @@ LIB_OBJS= \
tlsv1_server_write.o \
x509v3.o
-
-_OBJS_VAR := LIB_OBJS
-include ../objs.mk
+include ../lib.rules
diff --git a/src/utils/Makefile b/src/utils/Makefile
index fc7f4323d219..e8ad997eed76 100644
--- a/src/utils/Makefile
+++ b/src/utils/Makefile
@@ -1,9 +1,3 @@
-include ../lib.rules
-
-install:
- @echo Nothing to be made.
-
-
#CFLAGS += -DWPA_TRACE
CFLAGS += -DCONFIG_IPV6
CFLAGS += -DCONFIG_DEBUG_FILE
@@ -32,5 +26,4 @@ LIB_OBJS += edit.o
#LIB_OBJS += pcsc_funcs.o
-_OBJS_VAR := LIB_OBJS
-include ../objs.mk
+include ../lib.rules
diff --git a/src/wps/Makefile b/src/wps/Makefile
index d7660fdd4f4b..cddc6865a559 100644
--- a/src/wps/Makefile
+++ b/src/wps/Makefile
@@ -1,9 +1,3 @@
-include ../lib.rules
-
-install:
- @echo Nothing to be made.
-
-
CFLAGS += -DCONFIG_P2P
CFLAGS += -DCONFIG_WPS_OOB
CFLAGS += -DCONFIG_WPS_NFC
@@ -31,5 +25,4 @@ LIB_OBJS= \
wps_upnp_ssdp.o \
wps_upnp_web.o
-_OBJS_VAR := LIB_OBJS
-include ../objs.mk
+include ../lib.rules
--
2.26.2
More information about the Hostap
mailing list