-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/$(1).config $(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 $(TARGET_CPPFLAGS)" \
- $(MAKE) -C $(PKG_BUILD_DIR)/hostapd.$(1)/hostapd \
- $(TARGET_CONFIGURE_OPTS) \
- $(DRIVER_MAKEOPTS) \
- LIBS="$(TARGET_LDFLAGS) \
- $(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))
- endef
- define Build/Compile/$(2)
- $(call Build/CompileTarget,$(2))
- endef
- define Package/$(1)/install
- $(call Package/InstallTemplate,$(1),$(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))