Initial import
[pve-edk2-firmware.git] / debian / rules
1 #!/usr/bin/make -f
2 SHELL=/bin/bash
3
4 # this is a simplified version from the upstream package
5
6 DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
7
8 EDK2_TOOLCHAIN = GCC5 # for GCC5 and newer, LTO enabled
9 export $(EDK2_TOOLCHAIN)_AARCH64_PREFIX=aarch64-linux-gnu-
10
11 ifeq ($(DEB_BUILD_ARCH),amd64)
12 EDK2_BUILD_ARCH=X64
13 EDK2_HOST_ARCH=X64
14 endif
15 ifeq ($(DEB_BUILD_ARCH),arm64)
16 EDK2_BUILD_ARCH=AARCH64
17 endif
18
19 # Clear variables used internally by the edk2 build system
20 undefine WORKSPACE
21 undefine ECP_SOURCE
22 undefine EDK_SOURCE
23 undefine EFI_SOURCE
24 undefine EDK_TOOLS_PATH
25 undefine CONF_PATH
26
27 %:
28 dh $@
29
30 override_dh_auto_build: build-ovmf
31
32 setup-build:
33 cp -a debian/Logo.bmp MdeModulePkg/Logo/Logo.bmp
34 make -C BaseTools ARCH=$(EDK2_BUILD_ARCH)
35 # call this when building too, it modifies the shell environment
36 . ./edksetup.sh
37
38 build-ovmf: EDK2_ARCH_DIR=X64
39 build-ovmf: EDK2_HOST_ARCH=X64
40 build-ovmf: setup-build
41 set -e; . ./edksetup.sh; \
42 OvmfPkg/build.sh \
43 -b RELEASE \
44 -a $(EDK2_HOST_ARCH) \
45 -t $(EDK2_TOOLCHAIN) \
46 -DSECURE_BOOT_ENABLE=FALSE \
47 -DFD_SIZE_2MB \
48 -n $$(getconf _NPROCESSORS_ONLN)
49
50 override_dh_auto_clean:
51 set -e; \
52 if [ -d BaseTools/Source/C/bin ]; then \
53 . ./edksetup.sh; build clean; \
54 make -C BaseTools clean; \
55 fi
56 rm -rf Conf/.cache Build .pc-post
57
58 .PHONY: setup-build build-ovmf