]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
build: Use the new build system for fuzz tests
authorJohannes Berg <johannes.berg@intel.com>
Sun, 11 Oct 2020 07:58:57 +0000 (09:58 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 11 Oct 2020 08:15:16 +0000 (11:15 +0300)
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
18 files changed:
src/build.rules
tests/fuzzing/ap-mgmt/Makefile
tests/fuzzing/asn1/Makefile
tests/fuzzing/dpp-uri/Makefile
tests/fuzzing/eap-aka-peer/Makefile
tests/fuzzing/eap-mschapv2-peer/Makefile
tests/fuzzing/eap-sim-peer/Makefile
tests/fuzzing/eapol-key-auth/Makefile
tests/fuzzing/eapol-key-supp/Makefile
tests/fuzzing/eapol-supp/Makefile
tests/fuzzing/json/Makefile
tests/fuzzing/p2p/Makefile
tests/fuzzing/rules.include
tests/fuzzing/sae/Makefile
tests/fuzzing/tls-client/Makefile
tests/fuzzing/tls-server/Makefile
tests/fuzzing/wnm/Makefile
tests/fuzzing/x509/Makefile

index 32f45ae1eff121ff2e006fa152ac44099d7f0630..5960ba8415b4a13bdea210073cd13443fca647a9 100644 (file)
@@ -83,6 +83,10 @@ $(BUILDDIR)/$(PROJ)/src/%.o: $(ROOTDIR)src/%.c $(CONFIG_FILE) | _make_dirs
 $(BUILDDIR)/$(PROJ)/%.o: %.c $(CONFIG_FILE) | _make_dirs
        $(Q)$(CC) -c -o $@ $(CFLAGS) $<
        @$(E) "  CC " $<
+# for the fuzzing tests
+$(BUILDDIR)/$(PROJ)/wpa_supplicant/%.o: $(ROOTDIR)wpa_supplicant/%.c $(CONFIG_FILE) | _make_dirs
+       $(Q)$(CC) -c -o $@ $(CFLAGS) $<
+       @$(E) "  CC " $<
 
 BUILDOBJ = $(patsubst %,$(BUILDDIR)/$(PROJ)/%,$(patsubst $(ROOTDIR)%,%,$(1)))
 
index 192ae723e2d8c247f5af0f61827cb2162c1a0d92..159c7c3f8106c7cbc9b34762765a9220d8e77f3f 100644 (file)
@@ -1,4 +1,4 @@
-all: ap-mgmt
+ALL=ap-mgmt
 include ../rules.include
 
 CFLAGS += -DCONFIG_WNM
@@ -26,11 +26,13 @@ ELIBS += $(SRC)/tls/libtls.a
 
 OBJS += $(SRC)/drivers/driver_common.o
 
-ap-mgmt: ap-mgmt.o $(OBJS) $(LIBS)
+OBJS += ap-mgmt.o
+
+_OBJS_VAR := OBJS
+include ../../../src/objs.mk
+
+ap-mgmt: $(OBJS) $(LIBS)
        $(LDO) $(LDFLAGS) -o $@ $^ $(LIBS) $(ELIBS)
 
-clean:
-       $(MAKE) -C $(SRC) clean
+clean: common-clean
        rm -f ap-mgmt *~ *.o *.d ../*~ ../*.o ../*.d
-
--include $(OBJS:%.o=%.d)
index 4286259342ecf12896fc72ec590f5b605faf142e..fb8fbed684ef2f2a8b235832495190254b1a0010 100644 (file)
@@ -1,4 +1,4 @@
-all: asn1
+ALL=asn1
 include ../rules.include
 
 OBJS += $(SRC)/utils/common.o
@@ -7,12 +7,14 @@ OBJS += $(SRC)/utils/wpa_debug.o
 OBJS += $(SRC)/utils/wpabuf.o
 OBJS += $(SRC)/tls/asn1.o
 
-asn1: asn1.o $(OBJS) $(LIBS)
+OBJS += asn1.o
+
+_OBJS_VAR := OBJS
+include ../../../src/objs.mk
+
+asn1: $(OBJS) $(LIBS)
        $(LDO) $(LDFLAGS) -o $@ $^ $(LIBS) $(ELIBS)
 
-clean:
+clean: common-clean
        $(MAKE) -C $(SRC) clean
-       $(MAKE) -C $(WPAS_SRC) clean
        rm -f asn1 *~ *.o *.d ../*~ ../*.o ../*.d
-
--include $(OBJS:%.o=%.d)
index 07bfac06c8261d4e67dbcc9b8a8c4482e0f70b86..aca8f02ad4347e6eb19b02962d584ed137041b95 100644 (file)
@@ -28,11 +28,13 @@ OBJS += $(SRC)/common/dpp_pkex.o
 OBJS += $(SRC)/common/dpp_reconfig.o
 OBJS += $(SRC)/common/dpp_tcp.o
 
-dpp-uri: dpp-uri.o $(OBJS) $(LIBS)
+OBJS += dpp-uri.o
+
+_OBJS_VAR := OBJS
+include ../../../src/objs.mk
+
+dpp-uri: $(OBJS) $(LIBS)
        $(LDO) $(LDFLAGS) -o $@ $^ -lcrypto
 
-clean:
-       $(MAKE) -C $(SRC) clean
+clean: common-clean
        rm -f dpp-uri *~ *.o *.d ../*~ ../*.o ../*.d
-
--include $(OBJS:%.o=%.d)
index d1a4cd372ba5d04c116c4db925453321c2f18d66..bd960caa763eca5ad7143885337098919dc3fb31 100644 (file)
@@ -1,4 +1,4 @@
-all: eap-aka-peer
+ALL=eap-aka-peer
 include ../rules.include
 
 CFLAGS += -DIEEE8021X_EAPOL
@@ -10,12 +10,14 @@ OBJS += $(SRC)/eap_common/eap_common.o
 LIBS += $(SRC)/crypto/libcrypto.a
 LIBS += $(SRC)/utils/libutils.a
 
-eap-aka-peer: eap-aka-peer.o $(OBJS) $(LIBS)
+OBJS += eap-aka-peer.o
+
+_OBJS_VAR := OBJS
+include ../../../src/objs.mk
+
+eap-aka-peer: $(OBJS) $(LIBS)
        $(Q)$(LDO) $(LDFLAGS) -o $@ $^ $(LIBS) $(ELIBS)
        @$(E) "  LD " $@
 
-clean:
-       $(MAKE) -C $(SRC) clean
+clean: common-clean
        rm -f eap-aka-peer *~ *.o *.d ../*~ ../*.o ../*.d
-
--include $(OBJS:%.o=%.d)
index 801e0af816cb435092b108a627460fa84390a0af..953855c85ed45bff61ba9dd07f9080c5318fa3a4 100644 (file)
@@ -1,4 +1,4 @@
-all: eap-mschapv2-peer
+ALL=eap-mschapv2-peer
 include ../rules.include
 
 CFLAGS += -DIEEE8021X_EAPOL
@@ -9,12 +9,14 @@ OBJS += $(SRC)/eap_common/eap_common.o
 LIBS += $(SRC)/crypto/libcrypto.a
 LIBS += $(SRC)/utils/libutils.a
 
-eap-mschapv2-peer: eap-mschapv2-peer.o $(OBJS) $(LIBS)
+OBJS += eap-mschapv2-peer.o
+
+_OBJS_VAR := OBJS
+include ../../../src/objs.mk
+
+eap-mschapv2-peer: $(OBJS) $(LIBS)
        $(Q)$(LDO) $(LDFLAGS) -o $@ $^ $(LIBS) $(ELIBS)
        @$(E) "  LD " $@
 
-clean:
-       $(MAKE) -C $(SRC) clean
+clean: common-clean
        rm -f eap-mschapv2-peer *~ *.o *.d ../*~ ../*.o ../*.d
-
--include $(OBJS:%.o=%.d)
index 302717e95f1d88774ec03fc828cfa0dc6fd2e9ed..9292ccb79b2d96cac3b200caeeae789df9a7288d 100644 (file)
@@ -1,4 +1,4 @@
-all: eap-sim-peer
+ALL=eap-sim-peer
 include ../rules.include
 
 CFLAGS += -DIEEE8021X_EAPOL
@@ -10,12 +10,14 @@ OBJS += $(SRC)/eap_common/eap_common.o
 LIBS += $(SRC)/crypto/libcrypto.a
 LIBS += $(SRC)/utils/libutils.a
 
-eap-sim-peer: eap-sim-peer.o $(OBJS) $(LIBS)
+OBJS += eap-sim-peer.o
+
+_OBJS_VAR := OBJS
+include ../../../src/objs.mk
+
+eap-sim-peer: $(OBJS) $(LIBS)
        $(Q)$(LDO) $(LDFLAGS) -o $@ $^ $(LIBS) $(ELIBS)
        @$(E) "  LD " $@
 
-clean:
-       $(MAKE) -C $(SRC) clean
+clean: common-clean
        rm -f eap-sim-peer *~ *.o *.d ../*~ ../*.o ../*.d
-
--include $(OBJS:%.o=%.d)
index bd2b2756600f78d8fa7f2137bd35472ded8380e2..bdc731ff493187decb1d664f3d8206080073bea9 100644 (file)
@@ -1,4 +1,4 @@
-all: eapol-key-auth
+ALL=eapol-key-auth
 include ../rules.include
 
 CFLAGS += -DCONFIG_IEEE80211R_AP
@@ -19,11 +19,13 @@ LIBS += $(SRC)/radius/libradius.a
 
 OBJS += $(SRC)/drivers/driver_common.o
 
-eapol-key-auth: eapol-key-auth.o $(OBJS) $(LIBS)
+OBJS += eapol-key-auth.o
+
+_OBJS_VAR := OBJS
+include ../../../src/objs.mk
+
+eapol-key-auth: $(OBJS) $(LIBS)
        $(LDO) $(LDFLAGS) -o $@ $^ -Wl,--start-group $(LIBS) -Wl,--end-group
 
-clean:
-       $(MAKE) -C $(SRC) clean
+clean: common-clean
        rm -f eapol-key-auth *~ *.o *.d ../*~ ../*.o ../*.d
-
--include $(OBJS:%.o=%.d)
index afe56658463402c0e7fb7b742ed1325a5202e4c6..29e419b7cd034293e35ac528d1d53ff1c4cae6e3 100644 (file)
@@ -1,4 +1,4 @@
-all: eapol-key-supp
+ALL=eapol-key-supp
 include ../rules.include
 
 CFLAGS += -DCONFIG_IEEE80211R_AP
@@ -15,11 +15,13 @@ LIBS += $(SRC)/eap_common/libeap_common.a
 LIBS += $(SRC)/l2_packet/libl2_packet.a
 LIBS += $(SRC)/utils/libutils.a
 
-eapol-key-supp: eapol-key-supp.o $(OBJS) $(LIBS)
+OBJS += eapol-key-supp.o
+
+_OBJS_VAR := OBJS
+include ../../../src/objs.mk
+
+eapol-key-supp: $(OBJS) $(LIBS)
        $(LDO) $(LDFLAGS) -o $@ $^ -Wl,--start-group $(LIBS) -Wl,--end-group
 
-clean:
-       $(MAKE) -C $(SRC) clean
+clean: common-clean
        rm -f eapol-key-supp *~ *.o *.d ../*~ ../*.o ../*.d
-
--include $(OBJS:%.o=%.d)
index 41a505d3720e4559d88551b26b8bb1a66d1c8bba..27e631148df14fa20d3caf6494a03f3c7c8f935b 100644 (file)
@@ -1,4 +1,4 @@
-all: eapol-supp
+ALL=eapol-supp
 include ../rules.include
 
 CFLAGS += -DIEEE8021X_EAPOL
@@ -13,11 +13,13 @@ LIBS += $(SRC)/eap_common/libeap_common.a
 LIBS += $(SRC)/l2_packet/libl2_packet.a
 LIBS += $(SRC)/utils/libutils.a
 
-eapol-supp: eapol-supp.o $(OBJS) $(LIBS)
+OBJS += eapol-supp.o
+
+_OBJS_VAR := OBJS
+include ../../../src/objs.mk
+
+eapol-supp: $(OBJS) $(LIBS)
        $(LDO) $(LDFLAGS) -o $@ $^ -Wl,--start-group $(LIBS) -Wl,--end-group
 
-clean:
-       $(MAKE) -C $(SRC) clean
+clean: common-clean
        rm -f eapol-supp *~ *.o *.d ../*~ ../*.o ../*.d
-
--include $(OBJS:%.o=%.d)
index ffa0c5a993d6563cf41510cb36cc749113443cf0..8de19293e29bb975d4d20c2c8638fab01a598db9 100644 (file)
@@ -1,4 +1,4 @@
-all: json
+ALL=json
 include ../rules.include
 
 OBJS += $(SRC)/utils/base64.o
@@ -8,12 +8,13 @@ OBJS += $(SRC)/utils/os_unix.o
 OBJS += $(SRC)/utils/wpa_debug.o
 OBJS += $(SRC)/utils/wpabuf.o
 
-json: json.o $(OBJS) $(LIBS)
+OBJS += json.o
+
+_OBJS_VAR := OBJS
+include ../../../src/objs.mk
+
+json: $(OBJS) $(LIBS)
        $(LDO) $(LDFLAGS) -o $@ $^ $(LIBS) $(ELIBS)
 
-clean:
-       $(MAKE) -C $(SRC) clean
-       $(MAKE) -C $(WPAS_SRC) clean
+clean: common-clean
        rm -f json *~ *.o *.d ../*~ ../*.o ../*.d
-
--include $(OBJS:%.o=%.d)
index c088e32d0028bc0a511d1e736867a8d4c40c6453..ef31a7505e282beea475335eb3313c42367fa1c9 100644 (file)
@@ -1,4 +1,4 @@
-all: p2p
+ALL=p2p
 include ../rules.include
 
 LIBS += $(SRC)/utils/libutils.a
@@ -8,11 +8,13 @@ LIBS += $(SRC)/p2p/libp2p.a
 LIBS += $(SRC)/tls/libtls.a
 LIBS += $(SRC)/wps/libwps.a
 
-p2p: p2p.o $(OBJS) $(LIBS)
+OBJS += p2p.o
+
+_OBJS_VAR := OBJS
+include ../../../src/objs.mk
+
+p2p: $(OBJS) $(LIBS)
        $(LDO) $(LDFLAGS) -o $@ $^ $(LIBS)
 
-clean:
-       $(MAKE) -C $(SRC) clean
+clean: common-clean
        rm -f p2p *~ *.o *.d ../*~ ../*.o ../*.d
-
--include $(OBJS:%.o=%.d)
index a3b0ee0aa3e176115dd2c47668fb1aedd430a038..b2e8a81ea878c7857c6ee29d8928418537f959f9 100644 (file)
@@ -1,3 +1,6 @@
+FUZZ_RULES := $(lastword $(MAKEFILE_LIST))
+include $(dir $(FUZZ_RULES))../../src/build.rules
+
 FUZZ_CFLAGS =
 
 ifdef LIBFUZZER
@@ -18,14 +21,6 @@ CFLAGS += -DTEST_LIBFUZZER
 LDFLAGS += $(FUZZ_FLAGS)
 endif
 
-ifndef CC
-CC=gcc
-endif
-
-ifndef LDO
-LDO=$(CC)
-endif
-
 WPAS_SRC=../../../wpa_supplicant
 SRC=../../../src
 
@@ -76,18 +71,3 @@ $(SRC)/utils/libutils.a:
 
 $(SRC)/wps/libwps.a:
        $(MAKE) -C $(SRC)/wps
-
-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 " $<
index 5b86c2f43b13bc1c1d16284b26a874e1d173a874..ee7257afeaa8f174e7ef7c9f57885099b7c7e566 100644 (file)
@@ -1,4 +1,4 @@
-all: sae
+ALL=sae
 include ../rules.include
 
 CFLAGS += -DCONFIG_SHA256
@@ -13,11 +13,13 @@ OBJS += $(SRC)/crypto/sha256-prf.o
 OBJS += $(SRC)/crypto/sha256-kdf.o
 OBJS += $(SRC)/common/dragonfly.o
 
-sae: sae.o $(OBJS) $(LIBS)
+OBJS += sae.o
+
+_OBJS_VAR := OBJS
+include ../../../src/objs.mk
+
+sae: $(OBJS) $(LIBS)
        $(LDO) $(LDFLAGS) -o $@ $^ -lcrypto
 
-clean:
-       $(MAKE) -C $(SRC) clean
+clean: common-clean
        rm -f sae *~ *.o *.d ../*~ ../*.o ../*.d
-
--include $(OBJS:%.o=%.d)
index e91125ec1cf84b867d8c37543adcb4783d7bc23c..7d5e8d536fe7d4e4308f6e95128f9068442d248a 100644 (file)
@@ -1,4 +1,4 @@
-all: tls-client
+ALL=tls-client
 include ../rules.include
 
 LIBS += $(SRC)/common/libcommon.a
@@ -14,12 +14,13 @@ LIBS += $(SRC)/utils/libutils.a
 ELIBS += $(SRC)/crypto/libcrypto.a
 ELIBS += $(SRC)/tls/libtls.a
 
-tls-client: tls-client.o $(OBJS) $(LIBS)
+OBJS += tls-client.o
+
+_OBJS_VAR := OBJS
+include ../../../src/objs.mk
+
+tls-client: $(OBJS) $(LIBS)
        $(LDO) $(LDFLAGS) -o $@ $^ $(LIBS) $(ELIBS)
 
-clean:
-       $(MAKE) -C $(SRC) clean
-       $(MAKE) -C $(WPAS_SRC) clean
+clean: common-clean
        rm -f tls-client *~ *.o *.d ../*~ ../*.o ../*.d
-
--include $(OBJS:%.o=%.d)
index dbb53e5a4ca7e4d1aa618c43d890db8f0f9e4eec..45304328e4b2bfc4d6273956319fcb744bec779b 100644 (file)
@@ -1,4 +1,4 @@
-all: tls-server
+ALL=tls-server
 include ../rules.include
 
 LIBS += $(SRC)/common/libcommon.a
@@ -14,12 +14,13 @@ LIBS += $(SRC)/utils/libutils.a
 ELIBS += $(SRC)/crypto/libcrypto.a
 ELIBS += $(SRC)/tls/libtls.a
 
-tls-server: tls-server.o $(OBJS) $(LIBS)
+OBJS += tls-server.o
+
+_OBJS_VAR := OBJS
+include ../../../src/objs.mk
+
+tls-server: $(OBJS) $(LIBS)
        $(LDO) $(LDFLAGS) -o $@ $^ $(LIBS) $(ELIBS)
 
-clean:
-       $(MAKE) -C $(SRC) clean
-       $(MAKE) -C $(WPAS_SRC) clean
+clean: common-clean
        rm -f tls-server *~ *.o *.d ../*~ ../*.o ../*.d
-
--include $(OBJS:%.o=%.d)
index b8d33ac04c6dcc60bea0f1ddfce6dbe1e32817ce..f27dd341b3333d7ef4af9530f79caa429b3cd71d 100644 (file)
@@ -1,4 +1,4 @@
-all: wnm
+ALL=wnm
 include ../rules.include
 
 CFLAGS += -DCONFIG_WNM
@@ -42,12 +42,13 @@ OBJS += $(WPAS_SRC)/wpas_glue.o
 OBJS += $(SRC)/drivers/driver_common.o
 OBJS += $(SRC)/drivers/drivers.o
 
-wnm: wnm.o $(OBJS) $(LIBS)
+OBJS += wnm.o
+
+_OBJS_VAR := OBJS
+include ../../../src/objs.mk
+
+wnm: $(OBJS) $(LIBS)
        $(LDO) $(LDFLAGS) -o $@ $^ $(LIBS) $(ELIBS)
 
-clean:
-       $(MAKE) -C $(SRC) clean
-       $(MAKE) -C $(WPAS_SRC) clean
+clean: common-clean
        rm -f wnm *~ *.o *.d ../*~ ../*.o ../*.d
-
--include $(OBJS:%.o=%.d)
index d7f751a9dcb56ed28029636b2b67c6fd2c283964..7fff15a3a94a6fe0fc6967b6ae5b804631ade1b6 100644 (file)
@@ -1,4 +1,4 @@
-all: x509
+ALL=x509
 include ../rules.include
 
 LIBS += $(SRC)/common/libcommon.a
@@ -9,12 +9,13 @@ LIBS += $(SRC)/utils/libutils.a
 ELIBS += $(SRC)/crypto/libcrypto.a
 ELIBS += $(SRC)/tls/libtls.a
 
-x509: x509.o $(OBJS) $(LIBS)
+OBJS += x509.o
+
+_OBJS_VAR := OBJS
+include ../../../src/objs.mk
+
+x509: $(OBJS) $(LIBS)
        $(LDO) $(LDFLAGS) -o $@ $^ $(LIBS) $(ELIBS)
 
-clean:
-       $(MAKE) -C $(SRC) clean
-       $(MAKE) -C $(WPAS_SRC) clean
+clean: common-clean
        rm -f x509 *~ *.o *.d ../*~ ../*.o ../*.d
-
--include $(OBJS:%.o=%.d)