toplevel.mk 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Makefile for OpenWrt
  2. #
  3. # Copyright (C) 2007-2012 OpenWrt.org
  4. # Copyright (C) 2013-2014 Project Gluon
  5. #
  6. # This is free software, licensed under the GNU General Public License v2.
  7. # See /LICENSE for more information.
  8. #
  9. RELEASE:=Chaos Calmer
  10. PREP_MK= OPENWRT_BUILD= QUIET=0
  11. export IS_TTY=$(shell tty -s && echo 1 || echo 0)
  12. include $(GLUONDIR)/include/verbose.mk
  13. REVISION:=$(shell [ -d $(TOPDIR) ] && cd $(TOPDIR) && ./scripts/getver.sh 2>/dev/null)
  14. HOSTCC ?= gcc
  15. OPENWRTVERSION:=$(RELEASE)$(if $(REVISION), ($(REVISION)))
  16. export RELEASE
  17. export REVISION
  18. export OPENWRTVERSION
  19. export IS_TTY=$(shell tty -s && echo 1 || echo 0)
  20. export LD_LIBRARY_PATH:=$(subst ::,:,$(if $(LD_LIBRARY_PATH),$(LD_LIBRARY_PATH):)$(STAGING_DIR_HOST)/lib)
  21. export DYLD_LIBRARY_PATH:=$(subst ::,:,$(if $(DYLD_LIBRARY_PATH),$(DYLD_LIBRARY_PATH):)$(STAGING_DIR_HOST)/lib)
  22. export GIT_CONFIG_PARAMETERS='core.autocrlf=false'
  23. export MAKE_JOBSERVER=$(filter --jobserver%,$(MAKEFLAGS))
  24. # prevent perforce from messing with the patch utility
  25. unexport P4PORT P4USER P4CONFIG P4CLIENT
  26. # prevent user defaults for quilt from interfering
  27. unexport QUILT_PATCHES QUILT_PATCH_OPTS
  28. unexport C_INCLUDE_PATH CROSS_COMPILE ARCH
  29. # prevent distro default LPATH from interfering
  30. unexport LPATH
  31. # make sure that a predefined CFLAGS variable does not disturb packages
  32. export CFLAGS=
  33. ifneq ($(shell $(HOSTCC) 2>&1 | grep clang),)
  34. export HOSTCC_REAL?=$(HOSTCC)
  35. export HOSTCC_WRAPPER:=$(TOPDIR)/scripts/clang-gcc-wrapper
  36. else
  37. export HOSTCC_WRAPPER:=$(HOSTCC)
  38. endif
  39. SCAN_COOKIE?=$(shell echo $$$$)
  40. export SCAN_COOKIE
  41. SUBMAKE:=umask 022; $(SUBMAKE)
  42. ULIMIT_FIX=_limit=`ulimit -n`; [ "$$_limit" = "unlimited" -o "$$_limit" -ge 1024 ] || ulimit -n 1024;
  43. FORCE: ;
  44. .PHONY: FORCE
  45. .NOTPARALLEL: