- 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 $(GNU_TARGET_NAME)-gdb $(REAL_GNU_TARGET_NAME)-gdb
-
-source: $(DL_DIR)/$(GDB_SOURCE)
-prepare: $(GDB_DIR)/.patched
-compile:
-install: $(TARGET_CROSS)gdb
-clean:
- rm -rf $(GDB_CLIENT_DIR)
+endef
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR)
+endef
+
+define Build/Install
+ mkdir -p $(TOOLCHAIN_DIR)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)gdb
+ ln -fs $(TARGET_CROSS)gdb $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-gdb
+ strip $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)gdb
+endef
+
+define Build/Clean
+ rm -rf \
+ $(PKG_BUILD_DIR) \
+ $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)gdb \
+ $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-gdb
+endef
+
+$(eval $(call HostBuild))