Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Makefile for OpenWrt
  2. #
  3. # Copyright (C) 2007-2015 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. SDK:=1
  12. export TOPDIR LC_ALL LANG SDK
  13. world:
  14. DISTRO_PKG_CONFIG:=$(shell $(TOPDIR)/scripts/command_all.sh pkg-config | grep '/usr' -m 1)
  15. export ORIG_PATH:=$(if $(ORIG_PATH),$(ORIG_PATH),$(PATH))
  16. export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
  17. ifneq ($(OPENWRT_BUILD),1)
  18. override OPENWRT_BUILD=1
  19. export OPENWRT_BUILD
  20. empty:=
  21. space:= $(empty) $(empty)
  22. _SINGLE=export MAKEFLAGS=$(space);
  23. include $(TOPDIR)/include/debug.mk
  24. include $(TOPDIR)/include/depends.mk
  25. include $(TOPDIR)/include/toplevel.mk
  26. else
  27. include rules.mk
  28. include $(INCLUDE_DIR)/depends.mk
  29. include $(INCLUDE_DIR)/subdir.mk
  30. include package/Makefile
  31. $(package/stamp-compile): $(BUILD_DIR)/.prepared
  32. $(BUILD_DIR)/.prepared: Makefile
  33. @mkdir -p $$(dirname $@)
  34. @touch $@
  35. clean: FORCE
  36. git clean -f -d $(STAGING_DIR); true
  37. git clean -f -d $(BUILD_DIR); true
  38. git clean -f -d $(BIN_DIR); true
  39. dirclean: clean
  40. git reset --hard HEAD
  41. git clean -f -d
  42. rm -rf feeds/
  43. # check prerequisites before starting to build
  44. prereq: $(package/stamp-prereq) ;
  45. world: prepare $(package/stamp-compile) FORCE
  46. @$(MAKE) package/index
  47. .PHONY: clean dirclean prereq prepare world
  48. endif