rules 1.45 KB
Newer Older
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
#!/usr/bin/make -f
#
# debian/rules for Ubuntu linux-firmware
#
# Use this however you want, just give credit where credit is due.
#
# Copyright (c) 2008 Ben Collins <bcollins@ubuntu.com>
#
#

export LC_ALL=C
export SHELL=/bin/bash -e

#
# A list of the directories created by makefiles under fw_source.
#
GENERATED_DIRS=ea

binary-arch:

build-arch:
	$(MAKE) -C fw_source update

build-indep:

26 27 28
dest_dir = $(CURDIR)/debian/linux-firmware
firm_dir = $(dest_dir)/lib/firmware
doc_dir = $(dest_dir)/usr/share/doc/linux-firmware
29 30 31 32 33 34 35
license_dir = $(doc_dir)/licenses
nic_firm_dir = $(CURDIR)/debian/nic-firmware/lib/firmware
scsi_firm_dir = $(CURDIR)/debian/scsi-firmware/lib/firmware

install-indep: build-indep
	dh_testdir
	dh_testroot
36
	dh_prep -i
37 38 39

	install -d $(firm_dir)

40
	make install DESTDIR=$(dest_dir)
41 42

	for f in $$(cat debian/nic-firmware.lst); do \
43
		install -m644 -D $(firm_dir)/$$f $(nic_firm_dir)/$$f; \
44 45 46
	done

	for f in $$(cat debian/scsi-firmware.lst); do \
47
		install -m644 -D $(firm_dir)/$$f $(scsi_firm_dir)/$$f; \
48 49 50 51 52 53
	done

	install -d $(doc_dir)
	cp WHENCE $(doc_dir)/README

	install -d $(license_dir)
54
	cp LICEN[CS]E* GPL-[23] $(license_dir)
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76

binary-indep: install-indep
	dh_testdir
	dh_testroot

	dh_installchangelogs -i
	dh_installdocs -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary: binary-indep binary-arch
build: build-arch build-indep

clean:
	rm -rf $(GENERATED_DIRS)
	dh_testdir
	dh_testroot
	dh_clean