Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2 SHELL := sh -e
3 SOURCE := $(shell dpkg-parsechangelog -SSource)
4 VERSION := $(shell dpkg-parsechangelog -SVersion)
5 VERSION_UPSTREAM := $(shell echo "$(VERSION)" | sed -e 's,-[^-]*$$,,')
6 VERSION_BINNMU := $(shell echo "$(VERSION)" | sed -rne 's,.*\+b([0-9]+)$$,\1,p')
7 VERSION_SOURCE := $(patsubst %+b$(VERSION_BINNMU),%,$(VERSION))
8
9 GENCONTROL = debian/bin/gencontrol.py
10
11 binary binary-arch binary-indep build build-arch build-indep clean: debian/control
12 dh $@
13
14 override_dh_auto_build:
15 $(MAKE) -C av7110
16 $(MAKE) -C cis
17 $(MAKE) -C dsp56k
18 $(MAKE) -C isci
19 $(MAKE) -C keyspan_pda
20 $(MAKE) -C usbdux -f Makefile_dux
21 cp usbdux/usbdux*_firmware.bin .
22
23 override_dh_auto_test:
24 :
25
26 CLEAN_PATTERNS := debian/build debian/lib/python/__pycache__ debian/lib/python/debian_linux/__pycache__ $$(find debian -maxdepth 1 -type d -name 'firmware-*') debian/*.substvars
27
28 override_dh_auto_clean:
29 $(MAKE) -C av7110 clean
30 $(MAKE) -C cis clean
31 $(MAKE) -C dsp56k clean
32 $(MAKE) -C isci clean
33 $(MAKE) -C keyspan_pda clean
34 $(MAKE) -C usbdux -f Makefile_dux clean
35 rm -rf $(CLEAN_PATTERNS)
36
37 override_dh_auto_install:
38 ./copy-firmware.sh -v debian/build/install
39
40 override_dh_installdocs:
41 dh_installdocs -XTODO
42
43 execute_after_dh_install:
44 # Deduplicate firmware files within each binary package
45 cd debian/build && \
46 for dir in ../firmware-*/usr/lib/firmware; do \
47 ../../dedup-firmware.sh "$$dir"; \
48 done
49 # Check for any broken symlinks.
50 ! find debian/firmware-*/usr/lib/firmware -xtype l \
51 | grep .
52
53 CONTROL_FILES = debian/build/version-info $(wildcard debian/templates/*.in)
54 CONTROL_FILES += debian/bin/gencontrol.py debian/config/defines $(wildcard debian/config/*/defines) debian/modinfo.json
55
56 # debian/bin/gencontrol.py uses debian/changelog as input, but the
57 # output only depends on the source name and version. To avoid
58 # frequent changes to debian/control.md5sum, include only those fields
59 # in the checksum.
60 debian/build/version-info: debian/changelog
61 mkdir -p $(@D)
62 printf >$@ 'Source: %s\nVersion: %s\n' $(SOURCE) $(VERSION_SOURCE)
63
64 debian/control: $(GENCONTROL) $(CONTROL_FILES)
65 ifeq ($(wildcard debian/control.md5sum),)
66 $(MAKE) -f debian/rules debian/control-real
67 else
68 md5sum --check debian/control.md5sum --status || \
69 $(MAKE) -f debian/rules debian/control-real
70 endif
71
72 debian/control-real: $(GENCONTROL) $(CONTROL_FILES)
73 # We currently need to run copy-firmware.sh to get a complete list of
74 # files to be installed.
75 rm -rf debian/build/install
76 ./copy-firmware.sh debian/build/install
77 $(GENCONTROL)
78 md5sum $^ > debian/control.md5sum
79 @echo
80 @echo This target is made to fail intentionally, to make sure
81 @echo that it is NEVER run during the automated build. Please
82 @echo ignore the following error, the debian/control file has
83 @echo been generated SUCCESSFULLY.
84 @echo
85 exit 1
86
87 DIR_ORIG = ../orig/$(SOURCE)-$(VERSION_UPSTREAM)
88 TAR_ORIG_NAME = $(SOURCE)_$(VERSION_UPSTREAM).orig.tar.xz
89 TAR_ORIG = $(firstword $(wildcard ../$(TAR_ORIG_NAME)) $(wildcard ../orig/$(TAR_ORIG_NAME)))
90
91 orig: $(DIR_ORIG)
92 rsync --delete --exclude /debian --exclude /.git --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ .
93 QUILT_PATCHES='$(CURDIR)/debian/patches' QUILT_PC=.pc quilt push --quiltrc - -a -q --fuzz=0
94
95 $(DIR_ORIG):
96 ifeq ($(TAR_ORIG),)
97 $(error Cannot find orig tarball $(TAR_ORIG_NAME))
98 else
99 mkdir -p ../orig
100 tar -C ../orig -xaf $(TAR_ORIG)
101 endif
102
103 clean-generated:
104 rm -rf $(CLEAN_PATTERNS)
105 # We cannot use dh_clean here because it requires debian/control to exist
106 rm -rf debian/.debhelper debian/*.debhelper* debian/debhelper-build-stamp debian/files debian/generated.*
107 rm -f \
108 debian/control \
109 debian/control.md5sum \
110 debian/*.bug-presubj \
111 debian/*.install \
112 debian/*.metainfo.xml \
113 debian/*.postinst \
114 debian/*.postrm \
115 debian/*.preinst \
116 debian/*.prerm \
117 debian/*.templates
118
119 maintainerclean: clean-generated
120 rm -rf $(filter-out debian .git, $(wildcard * .[^.]*))
121
122 .PHONY: clean build-indep build-arch build binary-indep binary-arch binary \
123 clean-generated maintainerclean