Modified SIP/CSR feature to work ON MACS when the csr-active-config
[refind] / Makefile
1 # Makefile for rEFInd
2
3 # This program is licensed under the terms of the GNU GPL, version 3,
4 # or (at your option) any later version.
5 # You should have received a copy of the GNU General Public License
6 # along with this program. If not, see <http://www.gnu.org/licenses/>.
7
8 LOADER_DIR=refind
9 FS_DIR=filesystems
10 LIBEG_DIR=libeg
11 MOK_DIR=mok
12 GPTSYNC_DIR=gptsync
13 EFILIB_DIR=EfiLib
14 export EDK2BASE=/usr/local/UDK2014/MyWorkSpace
15 export REFIND_VERSION='L"0.10.2.1"'
16
17 # The "all" target builds with the TianoCore library if possible, but falls
18 # back on the more easily-installed GNU-EFI library if TianoCore isn't
19 # installed at $(EDK2BASE)
20 all:
21 ifneq ($(wildcard $(EDK2BASE)/*),)
22 @echo "Found $(EDK2BASE); building with TianoCore"
23 +make tiano
24 else
25 @echo "Did not find $(EDK2BASE); building with GNU-EFI"
26 +make gnuefi
27 endif
28
29 # The "fs" target, like "all," attempts to build with TianoCore but falls
30 # back to GNU-EFI.
31 fs:
32 ifneq ($(wildcard $(EDK2BASE)/*),)
33 @echo "Found $(EDK2BASE); building with TianoCore"
34 +make fs_tiano
35 else
36 @echo "Did not find $(EDK2BASE); building with GNU-EFI"
37 +make fs_gnuefi
38 endif
39
40 # Likewise for GPTsync....
41 GPTsync:
42 ifneq ($(wildcard $(EDK2BASE)/*),)
43 @echo "Found $(EDK2BASE); building with TianoCore"
44 +make gptsync_tiano
45 else
46 @echo "Did not find $(EDK2BASE); building with GNU-EFI"
47 +make gptsync_gnuefi
48 endif
49
50 # Don't build gptsync under TianoCore by default because it errors out when
51 # using a cross-compiler on an x86-64 system. Because gptsync is pretty
52 # useless on ARM64, skipping it is no big deal....
53 tiano:
54 +make MAKEWITH=TIANO AR_TARGET=EfiLib -C $(EFILIB_DIR) -f Make.tiano
55 +make MAKEWITH=TIANO AR_TARGET=libeg -C $(LIBEG_DIR) -f Make.tiano
56 +make MAKEWITH=TIANO AR_TARGET=mok -C $(MOK_DIR) -f Make.tiano
57 +make MAKEWITH=TIANO BUILDME=refind DLL_TARGET=refind -C $(LOADER_DIR) -f Make.tiano
58 ifneq ($(ARCH),aarch64)
59 +make MAKEWITH=TIANO -C $(GPTSYNC_DIR) -f Make.tiano
60 endif
61 # +make MAKEWITH=TIANO -C $(FS_DIR)
62
63 gnuefi:
64 +make MAKEWITH=GNUEFI -C $(LIBEG_DIR)
65 +make MAKEWITH=GNUEFI -C $(MOK_DIR)
66 +make MAKEWITH=GNUEFI -C $(EFILIB_DIR)
67 +make MAKEWITH=GNUEFI -C $(LOADER_DIR)
68 +make MAKEWITH=GNUEFI -C $(GPTSYNC_DIR) gnuefi
69 # +make MAKEWITH=GNUEFI -C $(FS_DIR) all_gnuefi
70
71 fs_tiano:
72 +make MAKEWITH=TIANO -C $(FS_DIR)
73
74 fs_gnuefi:
75 +make MAKEWITH=GNUEFI -C $(FS_DIR) all_gnuefi
76
77 gptsync_tiano:
78 +make MAKEWITH=TIANO -C $(GPTSYNC_DIR) -f Make.tiano
79
80 gptsync_gnuefi:
81 +make MAKEWITH=GNUEFI -C $(GPTSYNC_DIR) gnuefi
82
83 clean:
84 make -C $(LIBEG_DIR) clean
85 make -C $(MOK_DIR) clean
86 make -C $(LOADER_DIR) clean
87 make -C $(EFILIB_DIR) clean
88 make -C $(FS_DIR) clean
89 make -C $(GPTSYNC_DIR) clean
90 rm -f include/*~
91
92 # NOTE TO DISTRIBUTION MAINTAINERS:
93 # The "install" target installs the program directly to the ESP
94 # and it modifies the *CURRENT COMPUTER's* NVRAM. Thus, you should
95 # *NOT* use this target as part of the build process for your
96 # binary packages (RPMs, Debian packages, etc.). (Gentoo could
97 # use it in an ebuild, though....) You COULD, however, copy the
98 # files to a directory somewhere (/usr/share/refind or whatever)
99 # and then call refind-install as part of the binary package
100 # installation process.
101
102 install:
103 ./refind-install
104
105 # DO NOT DELETE