From 1d0d8888af17ef834b70a5835ff5157121ae77e1 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Mon, 12 Oct 2020 12:14:05 +0200 Subject: [PATCH] build: Make more library things common 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 --- 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 9d67fb58b..a1e9b7c44 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 a731c9230..59ba6c5e2 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 b0e13bd1d..ce0997091 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 c85d01de7..fd058a09a 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 1ce905d8c..762c7a8eb 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 c68565c07..cc9b76d61 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 328e18f50..c82042f43 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 108e66c4c..67a11857b 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 5c69413f3..c616626bd 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 99b7bd026..8182db8c7 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 0289dec5e..4d1618006 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 8d25400e9..8cfb33d35 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 25accf795..d14d736c1 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 0e79902ef..c84fbe859 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 fc7f4323d..e8ad997ee 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 d7660fdd4..cddc6865a 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