1 # This Makefile fragment (since dpkg 1.19.0) defines the following variables
4 # AS: assembler (since dpkg 1.19.1).
8 # OBJC: Objective C compiler.
9 # OBJCXX: Objective C++ compiler.
10 # F77: Fortran 77 compiler.
11 # FC: Fortran 9x compiler.
13 # STRIP: strip objects (since dpkg 1.19.1).
14 # OBJCOPY: copy objects (since dpkg 1.19.1).
15 # OBJDUMP: dump objects (since dpkg 1.19.1).
16 # NM: names lister (since dpkg 1.19.1).
17 # AR: archiver (since dpkg 1.19.1).
18 # RANLIB: archive index generator (since dpkg 1.19.1).
19 # PKG_CONFIG: pkg-config tool.
20 # QMAKE: Qt build system generator (since dpkg 1.20.0).
22 # All the above variables have a counterpart variable for the build tool,
23 # as in CC → CC_FOR_BUILD.
25 # The variables are not exported by default. This can be changed by
26 # defining DPKG_EXPORT_BUILDTOOLS.
28 ifndef dpkg_buildtools_mk_included
29 dpkg_buildtools_mk_included
= yes
31 dpkg_datadir
= $(srcdir)/mk
32 include $(dpkg_datadir
)/architecture.mk
34 # We set the TOOL_FOR_BUILD variables to the specified value, and the TOOL
35 # variables (for the host) to their triplet-prefixed form iff they are
36 # not defined or contain the make built-in defaults. On native builds if
37 # TOOL is defined and TOOL_FOR_BUILD is not, we fallback to use TOOL.
38 define dpkg_buildtool_setvar
39 ifeq (,$(filter $(3),$(DEB_BUILD_OPTIONS
)))
40 ifeq ($(origin $(1)),default
)
41 $(1) = $(DEB_HOST_GNU_TYPE
)-$(2)
43 $(1) ?
= $(DEB_HOST_GNU_TYPE
)-$(2)
46 # On native build fallback to use TOOL if that's defined.
47 ifeq ($(DEB_BUILD_GNU_TYPE
),$(DEB_HOST_GNU_TYPE
))
48 $(1)_FOR_BUILD ?
= $$($(1))
50 $(1)_FOR_BUILD ?
= $(DEB_BUILD_GNU_TYPE
)-$(2)
57 ifdef DPKG_EXPORT_BUILDTOOLS
63 $(eval
$(call dpkg_buildtool_setvar
,AS
,as))
64 $(eval
$(call dpkg_buildtool_setvar
,CPP
,gcc
-E
))
65 $(eval
$(call dpkg_buildtool_setvar
,CC
,gcc
))
66 $(eval
$(call dpkg_buildtool_setvar
,CXX
,g
++))
67 $(eval
$(call dpkg_buildtool_setvar
,OBJC
,gcc
))
68 $(eval
$(call dpkg_buildtool_setvar
,OBJCXX
,g
++))
69 $(eval
$(call dpkg_buildtool_setvar
,F77
,gfortran
))
70 $(eval
$(call dpkg_buildtool_setvar
,FC
,gfortran
))
71 $(eval
$(call dpkg_buildtool_setvar
,LD
,ld))
72 $(eval
$(call dpkg_buildtool_setvar
,STRIP
,strip,nostrip
))
73 $(eval
$(call dpkg_buildtool_setvar
,OBJCOPY
,objcopy
))
74 $(eval
$(call dpkg_buildtool_setvar
,OBJDUMP
,objdump
))
75 $(eval
$(call dpkg_buildtool_setvar
,NM
,nm
))
76 $(eval
$(call dpkg_buildtool_setvar
,AR
,ar))
77 $(eval
$(call dpkg_buildtool_setvar
,RANLIB
,ranlib
))
78 $(eval
$(call dpkg_buildtool_setvar
,PKG_CONFIG
,pkgconf
))
79 $(eval
$(call dpkg_buildtool_setvar
,QMAKE
,qmake
))
81 endif # dpkg_buildtools_mk_included