Makefile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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/depends.mk
  20. include $(TOPDIR)/include/toplevel.mk
  21. else
  22. include rules.mk
  23. include $(INCLUDE_DIR)/depends.mk
  24. include $(INCLUDE_DIR)/subdir.mk
  25. include target/Makefile
  26. include package/Makefile
  27. include tools/Makefile
  28. include toolchain/Makefile
  29. $(toolchain/stamp-compile): $(tools/stamp-compile)
  30. $(target/stamp-compile): $(toolchain/stamp-install) $(tools/stamp-install) $(BUILD_DIR)/.prepared
  31. $(package/stamp-compile): $(target/stamp-compile)
  32. $(target/stamp-install): $(package/stamp-compile) $(package/stamp-install)
  33. $(BUILD_DIR)/.prepared: Makefile
  34. @mkdir -p $$(dirname $@)
  35. @touch $@
  36. clean: FORCE
  37. rm -rf $(BUILD_DIR) $(BIN_DIR)
  38. $(MAKE) target/linux/clean
  39. rm -rf $(TMP_DIR)
  40. dirclean: clean
  41. rm -rf $(STAGING_DIR) $(STAGING_DIR_HOST) $(STAGING_DIR_TOOLCHAIN) $(TOOLCHAIN_DIR) $(BUILD_DIR_HOST)
  42. # check prerequisites before starting to build
  43. prereq: $(package/stamp-prereq) $(target/stamp-prereq) ;
  44. prepare: .config $(tools/stamp-install) $(toolchain/stamp-install)
  45. world: prepare $(target/stamp-compile) $(package/stamp-cleanup) $(package/stamp-compile) $(package/stamp-install) $(package/stamp-rootfs-prepare) $(target/stamp-install) FORCE
  46. $(MAKE) package/index
  47. package/symlinks:
  48. $(SCRIPT_DIR)/feeds.sh $(CONFIG_SOURCE_FEEDS) $(CONFIG_SOURCE_FEEDS_REV)
  49. .PHONY: clean dirclean prereq prepare world package/symlinks
  50. endif