File: rules

package info (click to toggle)
os-prober 1.76~deb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 232 kB
  • ctags: 58
  • sloc: sh: 1,696; makefile: 37; ansic: 21
file content (42 lines) | stat: -rwxr-xr-x 1,191 bytes parent folder | download | duplicates (4)
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
#! /usr/bin/make -f
# debhelper rules for os-prober
# (C) 2004 Joshua Kwan <joshk@triplehelix.org>

%:
	dh $@

ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
ifneq (,$(filter i386 amd64,$(ARCH)))
ARCH=x86
endif

DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
CC := gcc
else
CC := $(DEB_HOST_GNU_TYPE)-gcc
endif

export DEB_CFLAGS_MAINT_APPEND := -Os -Wall

CFLAGS := $(shell dpkg-buildflags --get CPPFLAGS; dpkg-buildflags --get CFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)

override_dh_auto_build:
	$(MAKE) CC=$(CC) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"

override_dh_install:
	dh_install
	for probes in os-probes os-probes/mounted os-probes/init \
	              linux-boot-probes linux-boot-probes/mounted; do \
		dh_install $$probes/common/* usr/lib/$$probes; \
		if [ -e "$$probes/$(ARCH)" ]; then \
			dh_install $$probes/$(ARCH)/* usr/lib/$$probes; \
		fi; \
	done
ifeq ($(ARCH),x86)
	dh_install os-probes/mounted/powerpc/20macosx usr/lib/os-probes/mounted
endif
	cp -a debian/os-prober-udeb/usr/lib debian/os-prober/usr/