hostapd: fix rebuild checks (#6210)
[openwrt/openwrt.git] / package / hostapd / Makefile
index bb497fec3b09136e541b25bb33c4d4e8498cacc6..b1dde1c453e57563e5c32eb7916d49700111af1b 100644 (file)
@@ -80,9 +80,19 @@ define Package/hostapd-utils/description
  IEEE 802.1x/WPA/EAP/RADIUS Authenticator.
 endef
 
-define Build/Configure
+ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),$(subst .configured_,.config_,$(STAMP_CONFIGURED)))
+  $(warning $(wildcard $(PKG_BUILD_DIR)/.config_*) != $(subst .configured_,.config_,$(STAMP_CONFIGURED)))
+  define Build/Configure/rebuild
        rm -f $(PKG_BUILD_DIR)/hostapd/hostapd
+       rm -f $(PKG_BUILD_DIR)/hostapd/*.o
        rm -f $(PKG_BUILD_DIR)/src/drivers/drivers.o
+       rm -f $(PKG_BUILD_DIR)/.config_*
+       touch $(subst .configured_,.config_,$(STAMP_CONFIGURED))
+  endef
+endif
+
+define Build/Configure
+       $(Build/Configure/rebuild)
        $(CP) ./files/$(BUILD_VARIANT).config $(PKG_BUILD_DIR)/hostapd/.config
 endef