-define Build/ConfigureTarget
- rm -rf $(PKG_BUILD_DIR)/hostapd.$(1)
- $(CP) $(PKG_BUILD_DIR)/hostapd $(PKG_BUILD_DIR)/hostapd.$(1)
- $(CP) ./files/$(1).config $(PKG_BUILD_DIR)/hostapd.$(1)/.config
- $(if $(CONFIG_PACKAGE_kmod-mac80211),,$(SED) 's,^CONFIG_DRIVER_DEVICESCAPE,#CONFIG_DRIVER_DEVICESCAPE,g' $(PKG_BUILD_DIR)/hostapd.$(1)/.config)
- $(if $(CONFIG_PACKAGE_kmod-madwifi),,$(SED) 's,^CONFIG_DRIVER_MADWIFI,#CONFIG_DRIVER_MADWIFI,g' $(PKG_BUILD_DIR)/hostapd.$(1)/.config)
-endef
-
-define Build/CompileTarget
- CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/madwifi -I$(STAGING_DIR)/usr/include/mac80211 -I$(STAGING_DIR)/usr/include" \
- $(MAKE) -C $(PKG_BUILD_DIR)/hostapd.$(1) \
- $(TARGET_CONFIGURE_OPTS) \
- LIBS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib \
- $(if $(CONFIG_PACKAGE_kmod-mac80211),-lm $(STAGING_DIR)/usr/lib/libnl.a) \
- $(if $(findstring default,$(1)),-lssl -lcrypto)" \
- hostapd hostapd_cli
- $(CP) $(PKG_BUILD_DIR)/hostapd.$(1)/hostapd_cli $(PKG_BUILD_DIR)/
-endef
-
-define Package/InstallTemplate
- $(INSTALL_DIR) $$(1)/lib/wifi
- $(INSTALL_DATA) ./files/hostapd.sh $$(1)/lib/wifi/hostapd.sh
-# config is managed through uci
-# $(INSTALL_DIR) $$(1)/etc
-# $(INSTALL_CONF) $(PKG_BUILD_DIR)/hostapd.$(2)/hostapd.conf $$(1)/etc/hostapd.conf
- $(INSTALL_DIR) $$(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd.$(2)/hostapd $$(1)/usr/sbin/
-endef
-
-define Package/Template
- ifneq ($(CONFIG_PACKAGE_$(1)),)
- define Build/Configure/$(2)
- $(call Build/ConfigureTarget,$(2))
+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))