Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. export TOPDIR LC_ALL LANG
  12. world:
  13. include $(TOPDIR)/include/host.mk
  14. ifneq ($(OPENWRT_BUILD),1)
  15. override OPENWRT_BUILD=1
  16. export OPENWRT_BUILD
  17. include $(TOPDIR)/include/debug.mk
  18. include $(TOPDIR)/include/depends.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-install): $(tools/stamp-install)
  29. $(target/stamp-compile): $(toolchain/stamp-install) $(tools/stamp-install) $(BUILD_DIR)/.prepared
  30. $(package/stamp-cleanup): $(target/stamp-compile)
  31. $(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup)
  32. $(package/stamp-install): $(package/stamp-compile)
  33. $(package/stamp-rootfs-prepare): $(package/stamp-install)
  34. $(target/stamp-install): $(package/stamp-compile) $(package/stamp-install) $(package/stamp-rootfs-prepare)
  35. $(BUILD_DIR)/.prepared: Makefile
  36. @mkdir -p $$(dirname $@)
  37. @touch $@
  38. clean: FORCE
  39. rm -rf $(BUILD_DIR) $(BIN_DIR)
  40. $(MAKE) target/linux/clean
  41. dirclean: clean
  42. rm -rf $(STAGING_DIR) $(STAGING_DIR_HOST) $(STAGING_DIR_TOOLCHAIN) $(TOOLCHAIN_DIR) $(BUILD_DIR_HOST)
  43. rm -rf $(TMP_DIR)
  44. # check prerequisites before starting to build
  45. prereq: $(package/stamp-prereq) $(target/stamp-prereq) ;
  46. prepare: .config $(tools/stamp-install) $(toolchain/stamp-install)
  47. world: prepare $(target/stamp-compile) $(package/stamp-cleanup) $(package/stamp-compile) $(package/stamp-install) $(package/stamp-rootfs-prepare) $(target/stamp-install) FORCE
  48. $(MAKE) package/index
  49. package/symlinks:
  50. $(SCRIPT_DIR)/feeds update
  51. cd package; ln -sf ../feeds/packages openwrt-packages
  52. .PHONY: clean dirclean prereq prepare world package/symlinks
  53. endif