]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
build: Add a common-clean target
authorJohannes Berg <johannes.berg@intel.com>
Fri, 18 Sep 2020 09:49:51 +0000 (11:49 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 10 Oct 2020 09:48:41 +0000 (12:48 +0300)
Clean up in a more common fashion as well, initially for ../src/.

Also add $(Q) to the clean target in src/

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
eap_example/Makefile
hostapd/Makefile
hs20/client/Makefile
hs20/server/Makefile
radius_example/Makefile
src/Makefile
src/build.rules
tests/Makefile
wlantest/Makefile
wpa_supplicant/Makefile

index e5f3b34710356d9d690a93e037a96619af3a8a03..ecef3c97662ba8478a7b24152c916c3f329638dc 100644 (file)
@@ -116,8 +116,7 @@ endif
 eap_example: $(OBJS_ex) $(LIBEAP)
        $(LDO) $(LDFLAGS) -o eap_example $(OBJS_ex) -L. -leap $(LIBS)
 
-clean:
-       $(MAKE) -C ../src clean
-       rm -f core *~ *.o *.d libeap.a libeap.so $(ALL)
+clean: common-clean
+       rm -f core *~ *.o *.d libeap.a libeap.so
 
 -include $(OBJS:%.o=%.d)
index 5c830fb448b18dcad49805154239dc6fa82c6259..2e15c8911483942a96ac3815db4fc64487f26baf 100644 (file)
@@ -1362,9 +1362,8 @@ lcov-html:
        lcov -c -d .. > lcov.info
        genhtml lcov.info --output-directory lcov-html
 
-clean:
-       $(MAKE) -C ../src clean
-       rm -f core *~ *.o hostapd hostapd_cli nt_password_hash hlr_auc_gw
+clean: common-clean
+       rm -f core *~ *.o nt_password_hash hlr_auc_gw
        rm -f sae_pk_gen
        rm -f *.d *.gcno *.gcda *.gcov
        rm -f lcov.info
index 70fb73598dfef402832b0ba69881e7bae228e7ed..cbb1105e186b679932e81e15c314c70d1f659033 100644 (file)
@@ -75,8 +75,8 @@ hs20-osu-client: $(OBJS)
        $(Q)$(LDO) $(LDFLAGS) -o hs20-osu-client $(OBJS) $(LIBS)
        @$(E) "  LD " $@
 
-clean:
-       rm -f core *~ *.o *.d hs20-osu-client
+clean: common-clean
+       rm -f core *~ *.o *.d
        rm -f ../../src/utils/*.o
        rm -f ../../src/utils/*.d
        rm -f ../../src/common/*.o
index 9ec7e4491ad47464de66105d35843b9bdbad6123..24b81cd8a28aa7ea1b3bb1ad56aecebe941ac29c 100644 (file)
@@ -36,8 +36,8 @@ OBJS += ../../src/utils/xml_libxml2.o
 hs20_spp_server: $(OBJS)
        $(LDO) $(LDFLAGS) -o hs20_spp_server $(OBJS) $(LIBS)
 
-clean:
-       rm -f core *~ *.o *.d hs20_spp_server
+clean: common-clean
+       rm -f core *~ *.o *.d
        rm -f ../../src/utils/*.o
        rm -f ../../src/utils/*.d
        rm -f ../../src/crypto/*.o
index 75cb3caeb3dd7129dc61ab60ca88c9e004741bef..3492ac70fc4949ffa54fa7fc6d1bacf41485ed92 100644 (file)
@@ -27,8 +27,7 @@ OBJS_ex = radius_example.o
 radius_example: $(OBJS_ex) $(LIBS)
        $(LDO) $(LDFLAGS) -o radius_example $(OBJS_ex) $(LIBS) $(LLIBS)
 
-clean:
-       $(MAKE) -C ../src clean
-       rm -f core *~ *.o *.d $(ALL)
+clean: common-clean
+       rm -f core *~ *.o *.d
 
 -include $(OBJS:%.o=%.d)
index c9e84c11de7a43cf2710fb9acc578d8102bfb08d..6eb7f2acb5a1e9740994c0d1c7f80b50413f825c 100644 (file)
@@ -5,8 +5,8 @@ all:
        for d in $(SUBDIRS); do [ -d $$d ] && $(MAKE) -C $$d; done
 
 clean:
-       for d in $(SUBDIRS); do [ -d $$d ] && $(MAKE) -C $$d clean; done
-       rm -f *~
+       $(Q)for d in $(SUBDIRS); do [ -d $$d ] && $(MAKE) -C $$d clean; done
+       $(Q)rm -f *~
 
 install:
        for d in $(SUBDIRS); do [ -d $$d ] && $(MAKE) -C $$d install; done
index 5edfea1dfa4d04921043526d05f6195ca9f6bb88..18e23ea5338cf9e02948c09390f14c278eb87f97 100644 (file)
@@ -4,6 +4,9 @@ all: $(VERIFY) $(ALL) $(EXTRA_TARGETS)
 # disable built-in rules
 .SUFFIXES:
 
+ROOTDIR := $(dir $(lastword $(MAKEFILE_LIST)))
+ROOTDIR := $(dir $(ROOTDIR:%/=%))
+
 ifndef CC
 CC=gcc
 endif
@@ -44,3 +47,8 @@ else
        $(Q)$(CC) -c -o $@ $(CFLAGS) $<
        @$(E) "  CC " $<
 endif
+
+.PHONY: common-clean
+common-clean:
+       $(Q)$(MAKE) -C $(ROOTDIR)/src clean
+       $(Q)rm -f $(ALL)
index 119ed7a2ae90a8c3eba4d0bd2811dcb39fb2a630..4d9f2e0ab8c1a04d2d727fbd53f859d703c746a8 100644 (file)
@@ -151,9 +151,8 @@ run-tests: $(ALL)
        @echo
        @echo All tests completed successfully.
 
-clean:
-       $(MAKE) -C ../src clean
-       rm -f $(ALL) *~ *.o *.d
+clean: common-clean
+       rm -f *~ *.o *.d
        rm -f test-eapol
        rm -f test-https
        rm -f test-json
index 0324fa54855e64e5805f9c9fd91f60bebe20b621..fee80f6f4e2cc2095d43cca89bace4e3099d6b3f 100644 (file)
@@ -81,8 +81,7 @@ wlantest_cli: $(OBJS_cli) $(OWN_LIBS)
 test_vectors: $(TOBJS) $(OWN_LIBS)
        $(LDO) $(LDFLAGS) -o test_vectors $(TOBJS) $(OWN_LIBS) $(LIBS)
 
-clean:
-       $(MAKE) -C ../src clean
-       rm -f core *~ *.o *.d $(ALL)
+clean: common-clean
+       rm -f core *~ *.o *.d
 
 -include $(OBJS:%.o=%.d)
index 13d9381687584df73f19be0c2aff4c2d2a8d9423..b18755bd74819bdf239d9e1c7c57613ab3092ee8 100644 (file)
@@ -2004,11 +2004,11 @@ lcov-html: wpa_supplicant.gcda
        lcov -c -d .. > lcov.info
        genhtml lcov.info --output-directory lcov-html
 
-clean:
+clean: common-clean
        $(MAKE) -C ../src clean
        $(MAKE) -C dbus clean
        rm -f core *~ *.o *.d *.gcno *.gcda *.gcov
-       rm -f eap_*.so $(ALL) $(WINALL) eapol_test preauth_test
+       rm -f eap_*.so $(WINALL) eapol_test preauth_test
        rm -f wpa_priv
        rm -f nfc_pw_token
        rm -f lcov.info