- touch $(GDB_CLIENT_DIR)/.configured
-
-$(GDB_CLIENT_DIR)/gdb/gdb: $(GDB_CLIENT_DIR)/.configured
- $(MAKE) -C $(GDB_CLIENT_DIR)
- strip $(GDB_CLIENT_DIR)/gdb/gdb
-
-$(TARGET_CROSS)gdb: $(GDB_CLIENT_DIR)/gdb/gdb
- install -c $(GDB_CLIENT_DIR)/gdb/gdb $(TARGET_CROSS)gdb
- cd $(STAGING_DIR)/bin && \
- ln -fs $(TARGET_CROSS)gdb $(GNU_TARGET_NAME)-gdb
-
-source: $(DL_DIR)/$(GDB_SOURCE)
-prepare: $(GDB_DIR)/.patched
-compile:
-install: $(TARGET_CROSS)gdb
-clean:
- rm -rf $(GDB_CLIENT_DIR) $(GDB_DIR)
+endef
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR)
+ strip $(PKG_BUILD_DIR)/gdb/gdb
+endef
+
+define Build/Install
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb
+ ln -fs $(TARGET_CROSS)gdb $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb
+endef
+
+define Build/Clean
+ rm -rf $(PKG_BUILD_DIR)
+ rm -f $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb
+ rm -f $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb
+endef
+
+$(eval $(call HostBuild))