-define Build/ConfigureTarget
- rm -rf $(PKG_BUILD_DIR)/hostapd.$(1)
- mkdir -p $(PKG_BUILD_DIR)/hostapd.$(1)
- $(CP) \
- $(PKG_BUILD_DIR)/hostapd \
- $(PKG_BUILD_DIR)/src \
- $(PKG_BUILD_DIR)/hostapd.$(1)/
- $(CP) ./files/driver_nl80211.c $(PKG_BUILD_DIR)/hostapd.$(1)/hostapd/
- $(CP) ./files/radiotap.c $(PKG_BUILD_DIR)/hostapd.$(1)/hostapd/
- $(CP) ./files/radiotap.h $(PKG_BUILD_DIR)/hostapd.$(1)/hostapd/
- $(CP) ./files/radiotap_iter.h $(PKG_BUILD_DIR)/hostapd.$(1)/hostapd/
-
- $(CP) ./files/$(1).config $(PKG_BUILD_DIR)/hostapd.$(1)/hostapd/.config
- $(if $(CONFIG_PACKAGE_kmod-mac80211),,$(SED) 's,^CONFIG_DRIVER_DEVICESCAPE,#CONFIG_DRIVER_DEVICESCAPE,g' $(PKG_BUILD_DIR)/hostapd.$(1)/hostapd/.config)
- $(if $(CONFIG_PACKAGE_kmod-madwifi),,$(SED) 's,^CONFIG_DRIVER_MADWIFI,#CONFIG_DRIVER_MADWIFI,g' $(PKG_BUILD_DIR)/hostapd.$(1)/hostapd/.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/libnl -I$(STAGING_DIR)/usr/include" \
- $(MAKE) -C $(PKG_BUILD_DIR)/hostapd.$(1)/hostapd \
- $(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/hostapd_cli $(PKG_BUILD_DIR)/
-endef
-
-define Package/InstallTemplate
- $(INSTALL_DIR) $$(1)/lib/wifi
- $(INSTALL_DATA) ./files/hostapd.sh $$(1)/lib/wifi/hostapd.sh
- $(INSTALL_DIR) $$(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd.$(2)/hostapd/hostapd $$(1)/usr/sbin/
-# config is managed through uci
-# $(INSTALL_DIR) $$(1)/etc
-# $(INSTALL_CONF) $(PKG_BUILD_DIR)/hostapd.$(2)/hostapd/hostapd.conf $$(1)/etc/hostapd.conf
-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))