OLD | NEW |
(Empty) | |
| 1 # |
| 2 # The source package name will be the first token from $(DEBIAN)/changelog |
| 3 # |
| 4 src_pkg_name=$(shell sed -n '1s/^\(.*\) (.*).*$$/\1/p' $(DEBIAN)/changelog) |
| 5 |
| 6 # Get some version info |
| 7 release := $(shell sed -n '1s/^$(src_pkg_name).*(\(.*\)-.*).*$$/\1/p' $(DEBIAN)/
changelog) |
| 8 revisions := $(shell sed -n 's/^$(src_pkg_name)\ .*($(release)-\(.*\)).*$$/\1/p'
$(DEBIAN)/changelog | tac) |
| 9 revision ?= $(word $(words $(revisions)),$(revisions)) |
| 10 prev_revisions := $(filter-out $(revision),0.0 $(revisions)) |
| 11 prev_revision := $(word $(words $(prev_revisions)),$(prev_revisions)) |
| 12 |
| 13 family=chromeos |
| 14 |
| 15 # This is an internally used mechanism for the daily kernel builds. It |
| 16 # creates packages whose ABI is suffixed with a minimal representation of |
| 17 # the current git HEAD sha. If .git/HEAD is not present, then it uses the |
| 18 # uuidgen program, |
| 19 # |
| 20 # AUTOBUILD can also be used by anyone wanting to build a custom kernel |
| 21 # image, or rebuild the entire set of Ubuntu packages using custom patches |
| 22 # or configs. |
| 23 AUTOBUILD= |
| 24 |
| 25 # |
| 26 # This is a way to support some external variables. A good example is |
| 27 # a local setup for ccache and distcc See LOCAL_ENV_CC and |
| 28 # LOCAL_ENV_DISTCC_HOSTS in the definition of kmake. |
| 29 # For example: |
| 30 # LOCAL_ENV_CC="ccache distcc" |
| 31 # LOCAL_ENV_DISTCC_HOSTS="localhost 10.0.2.5 10.0.2.221" |
| 32 # |
| 33 -include $(CURDIR)/../.karmic-env |
| 34 |
| 35 ifneq ($(AUTOBUILD),) |
| 36 skipabi = true |
| 37 skipmodule = true |
| 38 skipdbg = true |
| 39 gitver=$(shell if test -f .git/HEAD; then cat .git/HEAD; else uuidgen; fi) |
| 40 gitverpre=$(shell echo $(gitver) | cut -b -3) |
| 41 gitverpost=$(shell echo $(gitver) | cut -b 38-40) |
| 42 abi_suffix = -$(gitverpre)$(gitverpost) |
| 43 endif |
| 44 |
| 45 ifneq ($(NOKERNLOG),) |
| 46 ubuntu_log_opts += --no-kern-log |
| 47 endif |
| 48 ifneq ($(PRINTSHAS),) |
| 49 ubuntu_log_opts += --print-shas |
| 50 endif |
| 51 |
| 52 # |
| 53 # The debug packages are ginormous, so you probably want to skip |
| 54 # building them (as a developer). |
| 55 # |
| 56 ifeq ($(wildcard /CurrentlyBuilding),) |
| 57 skipdbg=true |
| 58 endif |
| 59 |
| 60 abinum := $(shell echo $(revision) | sed -e 's/\..*//')$(abi_suffix) |
| 61 prev_abinum := $(shell echo $(prev_revision) | sed -e 's/\..*//')$(abi_suffi
x) |
| 62 abi_release := $(release)-$(abinum) |
| 63 |
| 64 uploadnum := $(shell echo $(revision) | sed -e 's/.*\.//') |
| 65 ifneq ($(wildcard /CurrentlyBuilding),) |
| 66 uploadnum := $(uploadnum)-Ubuntu |
| 67 endif |
| 68 |
| 69 # We force the sublevel to be exactly what we want. The actual source may |
| 70 # be an in development git tree. We want to force it here instead of |
| 71 # committing changes to the top level Makefile |
| 72 SUBLEVEL := $(shell echo $(release) | awk -F. '{print $$3}') |
| 73 |
| 74 arch := $(shell dpkg-architecture -qDEB_HOST_ARCH) |
| 75 abidir := $(CURDIR)/$(DEBIAN)/abi/$(release)-$(revision)/$(arch) |
| 76 prev_abidir := $(CURDIR)/$(DEBIAN)/abi/$(release)-$(prev_revision)/$(arch) |
| 77 commonconfdir := $(CURDIR)/$(DEBIAN)/config |
| 78 archconfdir := $(CURDIR)/$(DEBIAN)/config/$(arch) |
| 79 builddir := $(CURDIR)/debian/build |
| 80 stampdir := $(CURDIR)/debian/stamps |
| 81 |
| 82 # |
| 83 # The binary package name always starts with linux-image-$KVER-$ABI.$UPLOAD_NUM.
There |
| 84 # are places that you'll find linux-image hard coded, but I guess thats OK since
the |
| 85 # assumption that the binary package always starts with linux-image will never c
hange. |
| 86 # |
| 87 bin_base_pkg_name=linux-image |
| 88 bin_pkg_name=$(bin_base_pkg_name)-$(abi_release) |
| 89 dbg_pkg_name=$(bin_base_pkg_name)-debug-$(abi_release) |
| 90 hdrs_pkg_name=$(src_pkg_name)-headers-$(abi_release) |
| 91 # |
| 92 # The generation of content in the doc package depends on both 'AUTOBUILD=' and |
| 93 # 'do_doc_package_content=true'. There are usually build errors during the devel
opment |
| 94 # cycle, so its OK to leave 'do_doc_package_content=false' until those build |
| 95 # failures get sorted out. Finally, the doc package doesn't really need to be bu
ilt |
| 96 # for developer testing (its kind of slow), so only do it if on a buildd. |
| 97 ifeq ($(wildcard /CurrentlyBuilding),) |
| 98 do_doc_package_content=false |
| 99 endif |
| 100 doc_pkg_name=$(src_pkg_name)-doc |
| 101 |
| 102 # |
| 103 # Similarly with the linux-source package, you need not build it as a developer.
Its |
| 104 # somewhat I/O intensive and utterly useless. |
| 105 # |
| 106 ifneq ($(wildcard /CurrentlyBuilding),) |
| 107 do_linux_source_content=true |
| 108 endif |
| 109 |
| 110 # Support parallel=<n> in DEB_BUILD_OPTIONS (see #209008) |
| 111 # |
| 112 # These 2 environment variables set the -j value of the kernel build. For exampl
e, |
| 113 # CONCURRENCY_LEVEL=16 fakeroot $(DEBIAN)/rules binary-debs |
| 114 # or |
| 115 # DEB_BUILD_OPTIONS=parallel=16 fakeroot $(DEBIAN)/rules binary-debs |
| 116 # |
| 117 # The default is to use the number of CPUs. |
| 118 # |
| 119 COMMA=, |
| 120 DEB_BUILD_OPTIONS_PARA = $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA)
, ,$(DEB_BUILD_OPTIONS)))) |
| 121 ifneq (,$(DEB_BUILD_OPTIONS_PARA)) |
| 122 CONCURRENCY_LEVEL := $(DEB_BUILD_OPTIONS_PARA) |
| 123 endif |
| 124 |
| 125 ifeq ($(CONCURRENCY_LEVEL),) |
| 126 # Check the environment |
| 127 CONCURRENCY_LEVEL := $(shell echo $$CONCURRENCY_LEVEL) |
| 128 # No? Then build with the number of CPUs on the host. |
| 129 ifeq ($(CONCURRENCY_LEVEL),) |
| 130 CONCURRENCY_LEVEL := $(shell expr `getconf _NPROCESSORS_ONLN` \* 1) |
| 131 endif |
| 132 # Oh hell, give 'em one |
| 133 ifeq ($(CONCURRENCY_LEVEL),) |
| 134 CONCURRENCY_LEVEL := 1 |
| 135 endif |
| 136 endif |
| 137 |
| 138 conc_level = -j$(CONCURRENCY_LEVEL) |
| 139 |
| 140 # target_flavour is filled in for each step |
| 141 kmake = make ARCH=$(build_arch) \ |
| 142 EXTRAVERSION=-$(abinum)-$(target_flavour) \ |
| 143 CONFIG_DEBUG_SECTION_MISMATCH=y SUBLEVEL=$(SUBLEVEL) \ |
| 144 KBUILD_BUILD_VERSION="$(uploadnum)" |
| 145 ifneq ($(LOCAL_ENV_CC),) |
| 146 kmake += CC=$(LOCAL_ENV_CC) DISTCC_HOSTS=$(LOCAL_ENV_DISTCC_HOSTS) |
| 147 endif |
OLD | NEW |