Makefile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Makefile for OpenWrt
  2. #
  3. # Copyright (C) 2007 OpenWrt.org
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. TOPDIR:=${CURDIR}
  9. LC_ALL:=C
  10. LANG:=C
  11. IS_TTY:=${shell tty -s && echo 1 || echo 0}
  12. export TOPDIR LC_ALL LANG IS_TTY
  13. world:
  14. include $(TOPDIR)/include/host.mk
  15. ifneq ($(OPENWRT_BUILD),1)
  16. override OPENWRT_BUILD=1
  17. export OPENWRT_BUILD
  18. include $(TOPDIR)/include/debug.mk
  19. include $(TOPDIR)/include/toplevel.mk
  20. else
  21. include rules.mk
  22. include $(INCLUDE_DIR)/depends.mk
  23. include $(INCLUDE_DIR)/subdir.mk
  24. include target/Makefile
  25. include package/Makefile
  26. include tools/Makefile
  27. include toolchain/Makefile
  28. $(toolchain/stamp-compile): $(tools/stamp-compile)
  29. $(target/stamp-compile): $(toolchain/stamp-install) $(tools/stamp-install) $(BUILD_DIR)/.prepared
  30. $(package/stamp-compile): $(target/stamp-compile)
  31. $(target/stamp-install): $(package/stamp-compile) $(package/stamp-install)
  32. $(BUILD_DIR)/.prepared: Makefile
  33. @mkdir -p $$(dirname $@)
  34. @touch $@
  35. clean: FORCE
  36. rm -rf $(BUILD_DIR) $(BIN_DIR)
  37. $(MAKE) target/linux/clean
  38. rm -rf $(TMP_DIR)
  39. dirclean: clean
  40. rm -rf $(STAGING_DIR) $(STAGING_DIR_HOST) $(STAGING_DIR_TOOLCHAIN) $(TOOLCHAIN_DIR) $(BUILD_DIR_HOST)
  41. # check prerequisites before starting to build
  42. prereq: $(package/stamp-prereq) $(target/stamp-prereq) ;
  43. prepare: .config $(tools/stamp-install) $(toolchain/stamp-install)
  44. world: prepare $(target/stamp-compile) $(package/stamp-cleanup) $(package/stamp-compile) $(package/stamp-install) $(package/stamp-rootfs-prepare) $(target/stamp-install) FORCE
  45. $(MAKE) package/index
  46. package/symlinks:
  47. $(SCRIPT_DIR)/feeds.sh $(CONFIG_SOURCE_FEEDS) $(CONFIG_SOURCE_FEEDS_REV)
  48. .PHONY: clean dirclean prereq prepare world package/symlinks
  49. endif