File: rules

package info (click to toggle)
libcdk5 5.0.20161210-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,440 kB
  • ctags: 2,833
  • sloc: ansic: 32,375; sh: 4,732; makefile: 1,122; sed: 43; cpp: 41
file content (191 lines) | stat: -rwxr-xr-x 5,462 bytes parent folder | download
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#!/usr/bin/make -f
# $Id: rules,v 1.21 2016/02/01 00:45:45 tom Exp $

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

# packages
PACKAGES.indep = libcdk5-doc
PACKAGES.arch  = libcdk5-dev libcdk5

CFLAGS =

TARGET = $(CURDIR)/debian
P_SHARED = $(CURDIR)/t/shared
P_STATIC = $(CURDIR)/t/static

verbose = # -v

LOG = @echo "**"

configure = ../../configure \
		--disable-echo \
		--host=$(DEB_HOST_GNU_TYPE) \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--prefix=/usr \
		--mandir=\$${prefix}/share/man \
		--with-screen=ncursesw6 \
		--with-versioned-syms \
		--with-libname=cdk \
		--disable-rpath-hack

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
        CFLAGS += -O0
else
        CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
        INSTALL_PROGRAM += -s
endif

.PHONY: all config build install binary clean config-indep config-arch \
    build-indep build-arch install-indep install-arch binary-indep \
    binary-arch

all: build

config: config-indep config-arch
build: build-indep build-arch
install: install-indep install-arch
binary: binary-indep binary-arch
clean:
	dh_testdir
	dh_testroot
	dh_clean $(verbose)
	rm -rf t

config-indep: $(PACKAGES.indep:%=config-%-stamp)
config-arch: $(PACKAGES.arch:%=config-%-stamp)

build-indep: $(PACKAGES.indep:%=build-%-stamp)
build-arch: $(PACKAGES.arch:%=build-%-stamp)

install-indep: $(PACKAGES.indep:%=install-%-stamp)
install-arch: $(PACKAGES.arch:%=install-%-stamp)

binary-indep: install-indep
ifneq ($(PACKAGES.indep),)
	rm -f $(PACKAGES.indep:%=install-%-stamp)
	dh_testdir
	dh_testroot
	dh_installdocs       $(verbose) $(PACKAGES.indep:%=-p%)
	dh_installman        $(verbose) $(PACKAGES.indep:%=-p%)
	dh_installexamples   $(verbose) $(PACKAGES.indep:%=-p%)
	dh_installchangelogs $(verbose) $(PACKAGES.indep:%=-p%) -k CHANGES
	dh_compress          $(verbose) $(PACKAGES.indep:%=-p%)
	dh_fixperms          $(verbose) $(PACKAGES.indep:%=-p%)
	dh_installdeb        $(verbose) $(PACKAGES.indep:%=-p%)
	dh_gencontrol        $(verbose) $(PACKAGES.indep:%=-p%)
	dh_md5sums           $(verbose) $(PACKAGES.indep:%=-p%)
	dh_builddeb          $(verbose) $(PACKAGES.indep:%=-p%)
endif

binary-arch: install-arch
ifneq ($(PACKAGES.arch),)
	rm -f $(PACKAGES.arch:%=install-%-stamp)
	dh_testdir
	dh_testroot
	dh_link              $(verbose) $(PACKAGES.arch:%=-p%)
	dh_installdocs       $(verbose) $(PACKAGES.arch:%=-p%)
	dh_installchangelogs $(verbose) $(PACKAGES.arch:%=-p%) -k CHANGES
	dh_installmenu       $(verbose) $(PACKAGES.arch:%=-p%)
	dh_strip             $(verbose) $(PACKAGES.arch:%=-p%)
	dh_compress          $(verbose) $(PACKAGES.arch:%=-p%)
	dh_fixperms          $(verbose) $(PACKAGES.arch:%=-p%)
	dh_makeshlibs        $(verbose) $(PACKAGES.arch:%=-p%)
	dh_installdeb        $(verbose) $(PACKAGES.arch:%=-p%)
	dh_shlibdeps         $(verbose) $(PACKAGES.arch:%=-p%)
	dh_gencontrol        $(verbose) $(PACKAGES.arch:%=-p%)
	dh_md5sums           $(verbose) $(PACKAGES.arch:%=-p%)
	dh_builddeb          $(verbose) $(PACKAGES.arch:%=-p%)
endif

#------------------------------------------------------------------------------
config-libcdk5-stamp       :
	$(LOG) "configuring libcdk5"
	dh_testdir

	rm -rf $(P_SHARED)
	mkdir -p $(P_SHARED)

	cd $(P_SHARED); CFLAGS="$(CFLAGS)" \
	$(configure) --with-shared --with-versioned-syms

	rm -rf $(P_STATIC)
	mkdir -p $(P_STATIC)

	cd $(P_STATIC); CFLAGS="$(CFLAGS)" \
	$(configure)

	touch $@

build-libcdk5-stamp        : config-libcdk5-stamp
	$(LOG) "building libcdk5"
	dh_testdir

	$(MAKE) -C $(P_SHARED) all
	$(MAKE) -C $(P_STATIC) all

	touch $@

install-libcdk5-stamp      : build-libcdk5-stamp
	$(LOG) "installing libcdk5"
	dh_testdir
	dh_testroot
	dh_prep $(verbose) -plibcdk5
	dh_installdirs $(verbose) -plibcdk5

	$(MAKE) -C $(P_SHARED) DESTDIR=$(TARGET)/libcdk5 installCDKLibrary

	# remove -config file also in -dev package
	rm -rf $(TARGET)/libcdk5/usr/bin

	touch $@

#------------------------------------------------------------------------------
config-libcdk5-dev-stamp   : config-libcdk5-stamp
	touch $@

build-libcdk5-dev-stamp    : build-libcdk5-stamp
	touch $@

install-libcdk5-dev-stamp  : install-libcdk5-stamp
	$(LOG) "installing libcdk5-dev"
	dh_testdir
	dh_testroot
	dh_prep $(verbose) -plibcdk5-dev
	dh_installdirs $(verbose) -plibcdk5-dev

	$(MAKE) -C $(P_SHARED) DESTDIR=$(TARGET)/libcdk5-dev installCDKHeaderFiles
	$(MAKE) -C $(P_STATIC) DESTDIR=$(TARGET)/libcdk5-dev install.libs

	# get the symbolic link, but not the actual file
	$(MAKE) -C $(P_SHARED) DESTDIR=$(TARGET)/libcdk5-dev install.libs
	find $(TARGET)/libcdk5-dev/usr/lib -type f -name '*.so*' -exec rm -f {} \;

	touch $@

#------------------------------------------------------------------------------
config-libcdk5-doc-stamp   : config-libcdk5-stamp
	touch $@

build-libcdk5-doc-stamp    : build-libcdk5-stamp
	touch $@

install-libcdk5-doc-stamp  : install-libcdk5-stamp
	$(LOG) "installing libcdk5-doc"
	dh_testdir
	dh_testroot
	dh_prep $(verbose) -plibcdk5-doc
	dh_installdirs $(verbose) -plibcdk5-doc

	$(MAKE) -C $(P_SHARED) DESTDIR=$(TARGET)/libcdk5-doc installCDKManPages
	dh_installexamples $(verbose) -plibcdk5-doc examples demos

	touch $@