toplevel.mk 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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:=Barrier Breaker
  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. ifeq ($(FORCE),)
  40. .config scripts/config/conf scripts/config/mconf: tmp/.prereq-build
  41. endif
  42. SCAN_COOKIE?=$(shell echo $$$$)
  43. export SCAN_COOKIE
  44. SUBMAKE:=umask 022; $(SUBMAKE)
  45. ULIMIT_FIX=_limit=`ulimit -n`; [ "$$_limit" = "unlimited" -o "$$_limit" -ge 1024 ] || ulimit -n 1024;
  46. FORCE: ;
  47. .PHONY: FORCE
  48. .NOTPARALLEL: