X-Git-Url: https://code.delx.au/refind/blobdiff_plain/78f985eef930274b4363ae504b9f95e598c15ca4..6720031b85a48ad6f6a651efb6bb5030c41b610d:/Makefile diff --git a/Makefile b/Makefile index 9b6ee10..d1158ef 100644 --- a/Makefile +++ b/Makefile @@ -1,28 +1,93 @@ # Makefile for rEFInd -CC=gcc -CXX=g++ -CXXFLAGS=-O2 -fpic -D_REENTRANT -D_GNU_SOURCE -Wall -g -NAMES=prefit -SRCS=$(NAMES:=.c) -OBJS=$(NAMES:=.o) -HEADERS=$(NAMES:=.h) + +# This program is licensed under the terms of the GNU GPL, version 3, +# or (at your option) any later version. +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + LOADER_DIR=refind FS_DIR=filesystems -LIB_DIR=libeg +LIBEG_DIR=libeg +MOK_DIR=mok +GPTSYNC_DIR=gptsync +EFILIB_DIR=EfiLib +export EDK2BASE=/usr/local/UDK2014/MyWorkSpace +export REFIND_VERSION='L"0.10.2.1"' -# Build the Symbiote library itself. +# The "all" target builds with the TianoCore library if possible, but falls +# back on the more easily-installed GNU-EFI library if TianoCore isn't +# installed at $(EDK2BASE) all: - make -C $(LIB_DIR) - make -C $(LOADER_DIR) -# make -C $(FS_DIR) +ifneq ($(wildcard $(EDK2BASE)/*),) + @echo "Found $(EDK2BASE); building with TianoCore" + +make tiano +else + @echo "Did not find $(EDK2BASE); building with GNU-EFI" + +make gnuefi +endif + +# The "fs" target, like "all," attempts to build with TianoCore but falls +# back to GNU-EFI. +fs: +ifneq ($(wildcard $(EDK2BASE)/*),) + @echo "Found $(EDK2BASE); building with TianoCore" + +make fs_tiano +else + @echo "Did not find $(EDK2BASE); building with GNU-EFI" + +make fs_gnuefi +endif + +# Likewise for GPTsync.... +GPTsync: +ifneq ($(wildcard $(EDK2BASE)/*),) + @echo "Found $(EDK2BASE); building with TianoCore" + +make gptsync_tiano +else + @echo "Did not find $(EDK2BASE); building with GNU-EFI" + +make gptsync_gnuefi +endif + +# Don't build gptsync under TianoCore by default because it errors out when +# using a cross-compiler on an x86-64 system. Because gptsync is pretty +# useless on ARM64, skipping it is no big deal.... +tiano: + +make MAKEWITH=TIANO AR_TARGET=EfiLib -C $(EFILIB_DIR) -f Make.tiano + +make MAKEWITH=TIANO AR_TARGET=libeg -C $(LIBEG_DIR) -f Make.tiano + +make MAKEWITH=TIANO AR_TARGET=mok -C $(MOK_DIR) -f Make.tiano + +make MAKEWITH=TIANO BUILDME=refind DLL_TARGET=refind -C $(LOADER_DIR) -f Make.tiano +ifneq ($(ARCH),aarch64) + +make MAKEWITH=TIANO -C $(GPTSYNC_DIR) -f Make.tiano +endif +# +make MAKEWITH=TIANO -C $(FS_DIR) + +gnuefi: + +make MAKEWITH=GNUEFI -C $(LIBEG_DIR) + +make MAKEWITH=GNUEFI -C $(MOK_DIR) + +make MAKEWITH=GNUEFI -C $(EFILIB_DIR) + +make MAKEWITH=GNUEFI -C $(LOADER_DIR) + +make MAKEWITH=GNUEFI -C $(GPTSYNC_DIR) gnuefi +# +make MAKEWITH=GNUEFI -C $(FS_DIR) all_gnuefi + +fs_tiano: + +make MAKEWITH=TIANO -C $(FS_DIR) + +fs_gnuefi: + +make MAKEWITH=GNUEFI -C $(FS_DIR) all_gnuefi + +gptsync_tiano: + +make MAKEWITH=TIANO -C $(GPTSYNC_DIR) -f Make.tiano -filesystems: - make -C $(FS_DIR) +gptsync_gnuefi: + +make MAKEWITH=GNUEFI -C $(GPTSYNC_DIR) gnuefi clean: - make -C $(LIB_DIR) clean + make -C $(LIBEG_DIR) clean + make -C $(MOK_DIR) clean make -C $(LOADER_DIR) clean -# make -C $(FS_DIR) clean + make -C $(EFILIB_DIR) clean + make -C $(FS_DIR) clean + make -C $(GPTSYNC_DIR) clean + rm -f include/*~ # NOTE TO DISTRIBUTION MAINTAINERS: # The "install" target installs the program directly to the ESP @@ -31,10 +96,10 @@ clean: # binary packages (RPMs, Debian packages, etc.). (Gentoo could # use it in an ebuild, though....) You COULD, however, copy the # files to a directory somewhere (/usr/share/refind or whatever) -# and then call install.sh as part of the binary package +# and then call refind-install as part of the binary package # installation process. install: - ./install.sh + ./refind-install # DO NOT DELETE