File: rules

package info (click to toggle)
openbios 1.1.git20161120-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,120 kB
  • ctags: 13,545
  • sloc: ansic: 63,915; asm: 3,530; xml: 1,145; cpp: 414; sh: 388; makefile: 234
file content (54 lines) | stat: -rwxr-xr-x 2,499 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

UPSTREAM_VERSION=$(shell dpkg-parsechangelog | sed -e '/^Version/!d' -e 's/^Version: //g' -e 's/-.*//g')
UPSTREAM_REVISION=$(shell echo $(UPSTREAM_VERSION) | sed -e 's/.*svn/-r/')
UPSTREAM_SVN=svn://openbios.org/openbios/trunk/openbios-devel
UPSTREAM_CHECKOUT=openbios-sparc-$(UPSTREAM_VERSION)

get-orig-source:
	svn export $(UPSTREAM_REVISION) $(UPSTREAM_SVN) $(UPSTREAM_CHECKOUT)
	rm -fr openbios-$(UPSTREAM_VERSION)/utils/iso
	tar --owner=root --group=root -Jcf ../openbios_$(UPSTREAM_VERSION).orig.tar.xz $(UPSTREAM_CHECKOUT)
	rm -rf $(UPSTREAM_CHECKOUT)

# We build a minimalistic cross powerpc-elf toolchain in order to be able
# to build the firmware on all architectures. It might be possible to
# use the native toolchain when building on a powerpc machine, but we don't
# that to make debian/rules simpler, but also because we want the build to
# be reproducible.
include debian/cross-toolchain.mk
export PATH=$(toolchain_dir)/bin:/usr/bin:/bin

# We build a firmware, so we do not link to the ssp libraries
export DEB_BUILD_MAINT_OPTIONS = hardening=-stackprotector

%:
	dh $@ --parallel

override_dh_auto_configure: $(stamp)gcc_powerpc-elf $(stamp)gcc_sparc-elf $(stamp)gcc_sparc64-elf
	config/scripts/switch-arch builtin-ppc builtin-sparc32 builtin-sparc64

override_dh_auto_build-indep:
	$(MAKE) -C obj-ppc V=1 EXTRACFLAGS="-ffreestanding"
	$(MAKE) -C obj-sparc32 V=1 EXTRACFLAGS="-ffreestanding"
	$(MAKE) -C obj-sparc64 V=1 EXTRACFLAGS="-ffreestanding"

override_dh_auto_clean:
	dh_clean
	rm -rf $(toolchain_dir)
	rm -rf obj-*
	rm -f config-host.mak config.xml rules.xml

override_dh_auto_install-indep:
	mkdir -p $(CURDIR)/debian/openbios-ppc/usr/share/openbios
	install -m644 obj-ppc/openbios-qemu.elf $(CURDIR)/debian/openbios-ppc/usr/share/openbios/openbios-ppc

	mkdir -p $(CURDIR)/debian/openbios-sparc/usr/share/openbios
	install -m644 obj-sparc32/openbios-builtin.elf $(CURDIR)/debian/openbios-sparc/usr/share/openbios/openbios-sparc32
	install -m644 obj-sparc32/QEMU,tcx.bin $(CURDIR)/debian/openbios-sparc/usr/share/openbios/QEMU,tcx.bin
	install -m644 obj-sparc32/QEMU,cgthree.bin $(CURDIR)/debian/openbios-sparc/usr/share/openbios/QEMU,cgthree.bin
	install -m644 obj-sparc64/openbios-builtin.elf $(CURDIR)/debian/openbios-sparc/usr/share/openbios/openbios-sparc64
	install -m644 obj-sparc64/QEMU,VGA.bin $(CURDIR)/debian/openbios-sparc/usr/share/openbios/QEMU,VGA.bin

override_dh_installchangelogs:
	dh_installchangelogs Documentation/ChangeLog.arch