]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
build: Make a common library build
authorJohannes Berg <johannes.berg@intel.com>
Mon, 12 Oct 2020 10:14:04 +0000 (12:14 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 12 Oct 2020 17:20:20 +0000 (20:20 +0300)
Derive the library name from the directory name, and let each
library Makefile only declare the objects that are needed.

This reduces duplicate code for the ar call. While at it, also
pretty-print that call.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
16 files changed:
src/ap/Makefile
src/common/Makefile
src/crypto/Makefile
src/eap_common/Makefile
src/eap_peer/Makefile
src/eap_server/Makefile
src/eapol_auth/Makefile
src/eapol_supp/Makefile
src/l2_packet/Makefile
src/lib.rules
src/p2p/Makefile
src/radius/Makefile
src/rsn_supp/Makefile
src/tls/Makefile
src/utils/Makefile
src/wps/Makefile

index 09d54924cb7e65c0a0c30c23ac213b5632f16cdf..9d67fb58b4e15dcd450b33ad198f97129c851f09 100644 (file)
@@ -1,5 +1,3 @@
-ALL=$(OUT)libap.a
-
 include ../lib.rules
 
 install:
@@ -67,5 +65,3 @@ LIB_OBJS= \
 
 _OBJS_VAR := LIB_OBJS
 include ../objs.mk
-$(OUT)libap.a: $(LIB_OBJS)
-       $(AR) crT $@ $?
index 19573ebd30e0b6189f455a4d85895ff4146030a8..a731c9230c0a40caad65f098357e4ea90f05d8a5 100644 (file)
@@ -1,5 +1,3 @@
-ALL=$(OUT)libcommon.a
-
 include ../lib.rules
 
 install:
@@ -21,5 +19,3 @@ LIB_OBJS= \
 
 _OBJS_VAR := LIB_OBJS
 include ../objs.mk
-$(OUT)libcommon.a: $(LIB_OBJS)
-       $(AR) crT $@ $?
index b8accd81c58383b89d5a4290f6a75177106a253e..b0e13bd1d279c8754919f10bd849b97eb68a9661 100644 (file)
@@ -1,5 +1,3 @@
-ALL=$(OUT)libcrypto.a
-
 include ../lib.rules
 
 install:
@@ -68,5 +66,3 @@ endif
 
 _OBJS_VAR := LIB_OBJS
 include ../objs.mk
-$(OUT)libcrypto.a: $(LIB_OBJS)
-       $(AR) crT $@ $?
index b50a4b731412b36aef10b3fc1c05ff8354a0f291..c85d01de727b1b9784236a6a4844f688ab2e71ae 100644 (file)
@@ -1,5 +1,3 @@
-ALL=$(OUT)libeap_common.a
-
 include ../lib.rules
 
 install:
@@ -25,5 +23,3 @@ LIB_OBJS= \
 
 _OBJS_VAR := LIB_OBJS
 include ../objs.mk
-$(OUT)libeap_common.a: $(LIB_OBJS)
-       $(AR) crT $@ $?
index d7a0372ad7610b0e99b572ca70076dfcf05a4cd5..1ce905d8c83938569295c0fbbf193dc614a026a5 100644 (file)
@@ -1,5 +1,3 @@
-ALL=$(OUT)libeap_peer.a
-
 include ../lib.rules
 
 install:
@@ -17,5 +15,3 @@ LIB_OBJS= \
 
 _OBJS_VAR := LIB_OBJS
 include ../objs.mk
-$(OUT)libeap_peer.a: $(LIB_OBJS)
-       $(AR) crT $@ $?
index b4261ec39263e17a6e8db79c26d78e226826c07a..c68565c07f9e9150e144ee646a3bb5ad081ff372 100644 (file)
@@ -1,5 +1,3 @@
-ALL=$(OUT)libeap_server.a
-
 include ../lib.rules
 
 install:
@@ -15,5 +13,3 @@ LIB_OBJS= \
 
 _OBJS_VAR := LIB_OBJS
 include ../objs.mk
-$(OUT)libeap_server.a: $(LIB_OBJS)
-       $(AR) crT $@ $?
index aa597eda4499a19f024703a2c28fe6f706f387a7..328e18f508e2caacdba047e89e7893f4a353a204 100644 (file)
@@ -1,5 +1,3 @@
-ALL=$(OUT)libeapol_auth.a
-
 include ../lib.rules
 
 install:
@@ -10,5 +8,3 @@ LIB_OBJS = eapol_auth_sm.o eapol_auth_dump.o
 
 _OBJS_VAR := LIB_OBJS
 include ../objs.mk
-$(OUT)libeapol_auth.a: $(LIB_OBJS)
-       $(AR) crT $@ $?
index 453e49e6bf4b7dc42f1fd7f78d37efdaec03be89..108e66c4c7aaa5db2fc6dd4fb8af84725270a581 100644 (file)
@@ -1,5 +1,3 @@
-ALL=$(OUT)libeapol_supp.a
-
 include ../lib.rules
 
 install:
@@ -12,5 +10,3 @@ LIB_OBJS = eapol_supp_sm.o
 
 _OBJS_VAR := LIB_OBJS
 include ../objs.mk
-$(OUT)libeapol_supp.a: $(LIB_OBJS)
-       $(AR) crT $@ $?
index 870d652bc63e9fcb2914c887c361881f74742acb..5c69413f31681e2852400edc67ea5666a9c94a20 100644 (file)
@@ -1,5 +1,3 @@
-ALL=$(OUT)libl2_packet.a
-
 include ../lib.rules
 
 install:
@@ -10,5 +8,3 @@ LIB_OBJS = l2_packet_linux.o
 
 _OBJS_VAR := LIB_OBJS
 include ../objs.mk
-$(OUT)libl2_packet.a: $(LIB_OBJS)
-       $(AR) crT $@ $?
index 81b895967e01da359405b75dab9c684f2afdf2bf..99b7bd02695885565c337fd9183e47a66b967b2f 100644 (file)
@@ -1,3 +1,6 @@
+_LIBMK := $(lastword $(wordlist 1,$(shell expr $(words $(MAKEFILE_LIST)) - 1),$(MAKEFILE_LIST)))
+_LIBNAME := $(notdir $(patsubst %/,%,$(dir $(abspath $(_LIBMK)))))
+ALL := $(OUT)lib$(_LIBNAME).a
 LIB_RULES := $(lastword $(MAKEFILE_LIST))
 include $(dir $(LIB_RULES))build.rules
 
@@ -9,5 +12,10 @@ endif
 CFLAGS += $(FUZZ_CFLAGS)
 CFLAGS += -I.. -I../utils
 
+.SECONDEXPANSION:
+$(ALL): $$(LIB_OBJS)
+       @$(E) "  AR  $(notdir $@)"
+       $(Q)$(AR) crT $@ $?
+
 clean:
        $(Q)rm -f *~ *.o *.d *.gcno *.gcda *.gcov $(ALL)
index 00e1908f0bc1a5cf3ef855271b66d8d292e9fa18..0289dec5e3b9c9404dc1c48866ddb5b25e475fba 100644 (file)
@@ -1,5 +1,3 @@
-ALL=$(OUT)libp2p.a
-
 include ../lib.rules
 
 install:
@@ -23,5 +21,3 @@ LIB_OBJS= \
 
 _OBJS_VAR := LIB_OBJS
 include ../objs.mk
-$(OUT)libp2p.a: $(LIB_OBJS)
-       $(AR) crT $@ $?
index 5cefa390fab9623ffe9d3528f7e498cd68bcdf49..8d25400e9c595ed2be491b33089a4cbc6ac5c7dc 100644 (file)
@@ -1,5 +1,3 @@
-ALL=$(OUT)libradius.a
-
 include ../lib.rules
 
 install:
@@ -16,5 +14,3 @@ LIB_OBJS= \
 
 _OBJS_VAR := LIB_OBJS
 include ../objs.mk
-$(OUT)libradius.a: $(LIB_OBJS)
-       $(AR) crT $@ $?
index f5f5cad17dfb86f013fab4a1d9196acf9292fb7d..25accf79576756976e0f0b946f3723ddfb39340e 100644 (file)
@@ -1,5 +1,3 @@
-ALL=$(OUT)librsn_supp.a
-
 include ../lib.rules
 
 install:
@@ -21,5 +19,3 @@ LIB_OBJS= \
 
 _OBJS_VAR := LIB_OBJS
 include ../objs.mk
-$(OUT)librsn_supp.a: $(LIB_OBJS)
-       $(AR) crT $@ $?
index 5483345e53316ab14a415c63f8e38030d4b73d2d..0e79902ef36410095a900b8841ad2f228be72d17 100644 (file)
@@ -1,5 +1,3 @@
-ALL=$(OUT)libtls.a
-
 include ../lib.rules
 
 install:
@@ -33,5 +31,3 @@ LIB_OBJS= \
 
 _OBJS_VAR := LIB_OBJS
 include ../objs.mk
-$(OUT)libtls.a: $(LIB_OBJS)
-       $(AR) crT $@ $?
index 91aba38466ff183bceaeff57cef0e6ed3ae29b58..fc7f4323d219f27afde4d3cab6801f33db1ac0e5 100644 (file)
@@ -1,5 +1,3 @@
-ALL=$(OUT)libutils.a
-
 include ../lib.rules
 
 install:
@@ -36,5 +34,3 @@ LIB_OBJS += edit.o
 
 _OBJS_VAR := LIB_OBJS
 include ../objs.mk
-$(OUT)libutils.a: $(LIB_OBJS)
-       $(AR) crT $@ $?
index 79106952783d3a3a220d95352225c2bbc53a2215..d7660fdd4f4b128d429700cfa808d02bd3c12f07 100644 (file)
@@ -1,5 +1,3 @@
-ALL=$(OUT)libwps.a
-
 include ../lib.rules
 
 install:
@@ -35,5 +33,3 @@ LIB_OBJS= \
 
 _OBJS_VAR := LIB_OBJS
 include ../objs.mk
-$(OUT)libwps.a: $(LIB_OBJS)
-       $(AR) crT $@ $?