1
############################ -*- Mode: Makefile -*- ###########################
3
## Author : Manoj Srivastava ( srivasta@golden-gryphon.com )
4
## Created On : Sat Nov 15 02:40:56 2003
5
## Created On Node : glaurung.green-gryphon.com
6
## Last Modified By : Manoj Srivastava
7
## Last Modified On : Tue Nov 16 23:36:15 2004
8
## Last Machine Used: glaurung.internal.golden-gryphon.com
10
## Status : Unknown, Use with caution!
12
## Description : calls dpkg-architecture and sets up various arch
15
## arch-tag: e16dd848-0fd6-4c0e-ae66-bef20d1f7c63
17
## This program is free software; you can redistribute it and/or modify
18
## it under the terms of the GNU General Public License as published by
19
## the Free Software Foundation; either version 2 of the License, or
20
## (at your option) any later version.
22
## This program is distributed in the hope that it will be useful,
23
## but WITHOUT ANY WARRANTY; without even the implied warranty of
24
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
## GNU General Public License for more details.
27
## You should have received a copy of the GNU General Public License
28
## along with this program; if not, write to the Free Software
29
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31
###############################################################################
34
DPKG_ARCH := dpkg-architecture
36
ifeq ($(strip $(KPKG_ARCH)),um)
37
MAKING_VIRTUAL_IMAGE:=YES
39
ifeq ($(strip $(KPKG_ARCH)),xen)
40
MAKING_VIRTUAL_IMAGE:=YES
43
ifneq ($(strip $(CONFIG_UM)),)
44
MAKING_VIRTUAL_IMAGE:=YES
48
ifneq ($(strip $(CONFIG_XEN)),)
49
MAKING_VIRTUAL_IMAGE:=YES
50
ifneq ($(strip $(CONFIG_X86_XEN)$(CONFIG_X86_64_XEN)),)
54
ifeq ($(strip $(CONFIG_XEN_PRIVILEGED_GUEST)),)
63
ifeq ($(strip $(MAKING_VIRTUAL_IMAGE)),)
64
ifneq ($(CROSS_COMPILE),-)
70
# set the dpkg-architecture vars
71
export DEB_BUILD_ARCH := $(shell $(DPKG_ARCH) -qDEB_BUILD_ARCH)
72
export DEB_BUILD_GNU_CPU := $(shell $(DPKG_ARCH) -qDEB_BUILD_GNU_CPU)
73
export DEB_BUILD_GNU_SYSTEM:= $(shell $(DPKG_ARCH) -qDEB_BUILD_GNU_SYSTEM)
74
export DEB_BUILD_GNU_TYPE := $(shell $(DPKG_ARCH) -qDEB_BUILD_GNU_TYPE)
75
export DEB_HOST_ARCH := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_ARCH)
76
export DEB_HOST_ARCH_OS := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_ARCH_OS \
78
export DEB_HOST_ARCH_CPU := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_ARCH_CPU \
80
export DEB_HOST_GNU_CPU := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_GNU_CPU)
81
export DEB_HOST_GNU_SYSTEM := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_GNU_SYSTEM)
82
export DEB_HOST_GNU_TYPE := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_GNU_TYPE)
84
# arrgh. future proofing
85
ifeq ($(DEB_HOST_GNU_SYSTEM), linux)
86
DEB_HOST_GNU_SYSTEM=linux-gnu
88
ifeq ($(DEB_HOST_ARCH_OS),)
89
ifeq ($(DEB_HOST_GNU_SYSTEM), linux-gnu)
90
DEB_HOST_ARCH_OS := linux
92
ifeq ($(DEB_HOST_GNU_SYSTEM), kfreebsd-gnu)
93
DEB_HOST_ARCH_OS := kfreebsd
97
REASON = @if [ -f $@ ]; then \
98
echo "====== making $(notdir $@) because of $(notdir $?) ======";\
100
echo "====== making target $@ [new prereqs: $(notdir $?)]======"; \
103
OLDREASON = @if [ -f $@ ]; then \
104
echo "====== making $(notdir $@) because of $(notdir $?) ======";\
106
echo "====== making (creating) $(notdir $@) ======"; \
109
LIBREASON = @echo "====== making $(notdir $@)($(notdir $%))because of $(notdir $?)======"
112
# macro outputing $(1) if DEBUG_DEBIAN_RULES is set, and resolving it
113
# in all cases usage $(call doit,some shell command)
114
doit = $(if $(DEBUG_DEBIAN_RULES),$(warning DEBUG: $(1)))$(shell $(1))