build: Use the new build system for fuzz tests

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg 2020-10-11 09:58:57 +02:00 committed by Jouni Malinen
parent a49f628845
commit 00b5e99b65
18 changed files with 134 additions and 123 deletions

View 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)))

View 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)

View 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)

View 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)

View 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)

View 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)

View 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)

View 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)

View 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)

View 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)

View 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)

View 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)

View 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 " $<

View 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)

View 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)

View 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)

View 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)

View 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)