- $(CP) $(PKG_BUILD_DIR) $(PKG_BUILD_DIR)_$(1)
- $(CP) ./files/$(1).config $(PKG_BUILD_DIR)_$(1)/.config
-ifneq ($(CONFIG_PACKAGE_kmod-madwifi),)
- echo "CONFIG_DRIVER_MADWIFI=y" >> $(PKG_BUILD_DIR)_$(1)/.config
-endif
-ifneq ($(CONFIG_PACKAGE_kmod-mac80211),)
- echo "CONFIG_DRIVER_DEVICESCAPE=y" >> $(PKG_BUILD_DIR)_$(1)/.config
-endif
-endef
+ 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
+
+TARGET_CPPFLAGS := \
+ -I$(STAGING_DIR)/usr/include/libnl-tiny \
+ $(TARGET_CPPFLAGS) \
+ -I$(STAGING_DIR)/usr/include/madwifi \
+ -I$(STAGING_DIR)/usr/include/mac80211 \
+ -DCONFIG_LIBNL20 \
+ -D_GNU_SOURCE