Makefile 722 B

12345678910111213141516171819202122232425262728293031323334
  1. #
  2. # Copyright (C) 2007 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:=patch-cmdline
  9. PKG_BUILD_DIR:=$(TOOL_BUILD_DIR)/$(PKG_NAME)
  10. include $(INCLUDE_DIR)/host-build.mk
  11. OS:=$(shell uname)
  12. ifeq ($(HOST_OS),Darwin)
  13. CFLAGS += -I./include
  14. endif
  15. CFLAGS += -I $(TOPDIR)/tools/include -include endian.h
  16. define Build/Compile
  17. $(CC) $(CFLAGS) -o $(PKG_BUILD_DIR)/$(PKG_NAME) src/$(PKG_NAME).c
  18. endef
  19. define Build/Install
  20. mkdir -p $(STAGING_DIR)/bin
  21. $(CP) $(PKG_BUILD_DIR)/patch-cmdline $(STAGING_DIR)/bin/
  22. endef
  23. define Build/Clean
  24. -rm -f $(STAGING_DIR)/bin/patch-cmdline
  25. endef
  26. $(eval $(call HostBuild))