File: rules

package info (click to toggle)
debian-installer-utils 1.133
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 916 kB
  • sloc: sh: 985; ansic: 160; makefile: 61
file content (51 lines) | stat: -rwxr-xr-x 1,447 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
43
44
45
46
47
48
49
50
51
#! /usr/bin/make -f
%:
	dh $@

DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
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 := -Wall -W -Os -fomit-frame-pointer

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

TERMNAMES = a/ansi d/dumb s/screen

ifeq ($(DEB_HOST_ARCH_OS),linux)
TERMNAMES += l/linux
endif

ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
TERMNAMES += c/cons25 x/xterm
endif

ifeq ($(DEB_HOST_ARCH_OS),hurd)
TERMNAMES += h/hurd m/mach-gnu-color
endif

TERMS = $(foreach term,$(TERMNAMES),\
          $(firstword $(wildcard /lib/terminfo/$(term)) \
                      $(wildcard /usr/share/terminfo/$(term))))

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

override_dh_auto_install:
	for file in $(TERMS); do \
		mkdir -p debian/di-utils-terminfo/`dirname $$file`; \
		cp -pL $$file debian/di-utils-terminfo/$$file; \
		chmod 644 debian/di-utils-terminfo/$$file; \
	done
	tic vt102-di -o debian/di-utils-terminfo/lib/terminfo

	mkdir -p debian/di-utils/bin
	cp -pL list-devices-$(DEB_HOST_ARCH_OS) debian/di-utils/bin/list-devices
	chmod 755 debian/di-utils/bin/list-devices