Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #
  2. # Copyright (C) 2006-2012 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=wrt350nv2-builder
  9. PKG_VERSION:=2.4
  10. PKG_REVISION:=2
  11. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/${PKG_NAME}-$(PKG_VERSION)
  12. include $(INCLUDE_DIR)/host-build.mk
  13. define Host/Compile
  14. $(HOSTCC) $(HOST_CFLAGS) -c src/md5.c -o $(HOST_BUILD_DIR)/md5.o
  15. $(HOSTCC) $(HOST_CFLAGS) -c src/ioapi.c -o $(HOST_BUILD_DIR)/ioapi.o
  16. $(HOSTCC) $(HOST_CFLAGS) -c src/wrt350nv2-builder.c -o $(HOST_BUILD_DIR)/wrt350nv2-builder.o
  17. $(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $(HOST_BUILD_DIR)/wrt350nv2-builder \
  18. $(HOST_BUILD_DIR)/wrt350nv2-builder.o $(HOST_BUILD_DIR)/md5.o $(HOST_BUILD_DIR)/ioapi.o
  19. endef
  20. define Host/Install
  21. $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
  22. $(INSTALL_BIN) $(HOST_BUILD_DIR)/wrt350nv2-builder $(STAGING_DIR_HOST)/bin/
  23. # optionally the builder can add a u-boot binary to create a complete webupgrade image, but this is not mandatory
  24. # u-boot images from stock firmware are available at ftp://ftp.maddes.net/openwrt/trunk/orion/stock/binaries/
  25. [ ! -f "files/u-boot.bin" ] || ( \
  26. $(INSTALL_DIR) $(STAGING_DIR_HOST)/share/wrt350nv2-builder; \
  27. $(CP) files/u-boot.bin $(STAGING_DIR_HOST)/share/wrt350nv2-builder/; )
  28. endef
  29. define Host/Clean
  30. rm -f $(STAGING_DIR_HOST)/bin/wrt350nv2-builder
  31. rm -f $(STAGING_DIR_HOST)/share/wrt350nv2-builder
  32. endef
  33. $(eval $(call HostBuild))