summaryrefslogtreecommitdiffstats
path: root/debian/rules.d/binary-objc.mk
blob: e476a33f864f96ea8a6c3c6d84c9a5e49d3bdda6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
ifneq ($(DEB_STAGE),rtlibs)
  ifneq (,$(filter yes, $(biarch64) $(biarch32) $(biarchn32) $(biarchx32)))
    arch_binaries  := $(arch_binaries) objc-multi
  endif
  arch_binaries := $(arch_binaries) objc-nat objc-host
  ifeq ($(unprefixed_names),yes)
    arch_binaries := $(arch_binaries) objc
    indep_binaries := $(indep_binaries) objc-build
  endif
endif

p_objc_n = gobjc$(pkg_ver)-$(subst _,-,$(TARGET_ALIAS))
d_objc_n = debian/$(p_objc_n)

p_objc_h = gobjc$(pkg_ver)-for-host
d_objc_h = debian/$(p_objc_h)

p_objc_b = gobjc$(pkg_ver)-for-build
d_objc_b = debian/$(p_objc_b)

p_objc	= gobjc$(pkg_ver)
d_objc	= debian/$(p_objc)

p_objc_m= gobjc$(pkg_ver)-multilib$(cross_bin_arch)
d_objc_m= debian/$(p_objc_m)

dirs_objc_n = \
	$(gcc_lexec_dir) \
	usr/share/lintian/overrides

dirs_objc = \
	$(docdir)/$(p_xbase)/ObjC

files_objc_n = \
	$(gcc_lexec_dir)/cc1obj

$(binary_stamp)-objc-nat: $(install_stamp)
	dh_testdir
	dh_testroot
	mv $(install_stamp) $(install_stamp)-tmp

	rm -rf $(d_objc_n)
	dh_installdirs -p$(p_objc_n) $(dirs_objc_n)
	$(dh_compat2) dh_movefiles -p$(p_objc_n) $(files_objc_n)

	echo '$(p_objc_n) binary: hardening-no-pie' \
	  > $(d_objc_n)/usr/share/lintian/overrides/$(p_objc_n)

	debian/dh_doclink -p$(p_objc_n) $(p_xbase)

	debian/dh_rmemptydirs -p$(p_objc_n)

ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTONS)))
	$(DWZ) \
	  $(d_objc_n)/$(gcc_lexec_dir)/cc1obj
endif
	dh_strip -p$(p_objc_n) \
	  $(if $(unstripped_exe),-X/cc1obj)
	dh_shlibdeps -p$(p_objc_n)
	echo $(p_objc_n) >> debian/arch_binaries

	trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)

$(binary_stamp)-objc-host: $(install_stamp)
	dh_testdir
	dh_testroot
	mv $(install_stamp) $(install_stamp)-tmp
	rm -rf $(d_objc_h)
	debian/dh_doclink -p$(p_objc_h) $(p_xbase)
	echo $(p_objc_h) >> debian/arch_binaries
	trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)

$(binary_stamp)-objc-build: $(install_stamp)
	dh_testdir
	dh_testroot
	mv $(install_stamp) $(install_stamp)-tmp
	rm -rf $(d_objc_b)
	debian/dh_doclink -p$(p_objc_b) $(p_cpp_b)
	echo $(p_objc_b) >> debian/indep_binaries
	trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)

$(binary_stamp)-objc: $(install_stamp)
	dh_testdir
	dh_testroot
	mv $(install_stamp) $(install_stamp)-tmp

	rm -rf $(d_objc)
	dh_installdirs -p$(p_objc) $(dirs_objc)

	cp -p $(srcdir)/libobjc/{README*,THREADS*} \
		$(d_objc)/$(docdir)/$(p_xbase)/ObjC/.

	cp -p $(srcdir)/libobjc/ChangeLog \
		$(d_objc)/$(docdir)/$(p_xbase)/ObjC/changelog.libobjc

	debian/dh_doclink -p$(p_objc) $(p_xbase)

	debian/dh_rmemptydirs -p$(p_objc)

	echo $(p_objc) >> debian/arch_binaries

	trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)

$(binary_stamp)-objc-multi: $(install_stamp)
	dh_testdir
	dh_testroot
	mv $(install_stamp) $(install_stamp)-tmp

	rm -rf $(d_objc_m)
	dh_installdirs -p$(p_objc_m) $(docdir)

	debian/dh_doclink -p$(p_objc_m) $(p_xbase)

	dh_strip -p$(p_objc_m)
	dh_shlibdeps -p$(p_objc_m)
	echo $(p_objc_m) >> debian/arch_binaries

	trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)