]> code.delx.au - refind/commitdiff
Significant reworking of Makefile structure. Added Apple Core Storage
authorsrs5694 <srs5694@users.sourceforge.net>
Sun, 6 Dec 2015 03:28:59 +0000 (22:28 -0500)
committersrs5694 <srs5694@users.sourceforge.net>
Sun, 6 Dec 2015 03:28:59 +0000 (22:28 -0500)
to type codes recognized by gptsync.

30 files changed:
BUILDING.txt
EfiLib/Make.tiano
EfiLib/Makefile
Make.common
Make.tiano [deleted file]
Makefile
NEWS.txt
debian/copyright
filesystems/Make.gnuefi
filesystems/Make.tiano
filesystems/fsw_base.h
filesystems/fsw_efi.c
filesystems/fsw_efi_base.h
filesystems/hfs_format.h
gptsync/Make.gnuefi
gptsync/Make.tiano
gptsync/Makefile
gptsync/gptsync.c
gptsync/gptsync.h
gptsync/lib.c
gptsync/os_efi.c
libeg/Make.tiano
libeg/Makefile
mok/Make.tiano
mok/Makefile
refind/Make.tiano
refind/Makefile
refind/driver_support.h
refind/legacy.c
refind/main.c

index 4f6519372ae59aba73433e707327cb09abe0b302..890e178df97822c61a31b3ad0dbcc235e23b26ba 100644 (file)
@@ -4,11 +4,12 @@ Requirements
 To compile rEFInd, you'll need the following:
 
 * A Linux installation. Note that this installation does NOT need to be
-  EFI-based. It can be 32- or 64-bit, but unless you use a cross-compiler
-  (which I've not tested), it must be the appropriate bit width for your
-  EFI implementation. (Normally that means 64-bit.) If you don't normally
-  run Linux, you can run it in a VirtualBox or similar virtual machine. (I
-  describe some unsupported non-Linux build options shortly.)
+  EFI-based. It can use IA32 (aka x86, i386, or other things), X64 (aka
+  x86-64, AMD64, or EM64T), or AA64 (aka AARCH64 or ARM64), but unless you
+  use a cross-compiler, it must use the same CPU type and bit depth as your
+  EFI implementation. (Normally that means 64-bit X64.) If you don't
+  normally run Linux, you can run it in a VirtualBox or similar virtual
+  machine. (I describe some unsupported non-Linux build options shortly.)
 
 * A standard set of Linux development tools, based on GCC.
 
@@ -19,9 +20,9 @@ To compile rEFInd, you'll need the following:
     UDK2010 package and others in that series, but beginning with rEFInd
     0.8.2, I've been using UDK2014
     (http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=UDK2014).
-    All of the UDK release are "frozen," rather than the main EDK2
-    development branch, which is changing as the developers add features,
-    fix bugs, and so on. See below for TianoCore setup instructions.
+    All of the UDK are "frozen," rather than the main EDK2 development
+    branch, which is changing as the developers add features, fix bugs, and
+    so on. See below for TianoCore setup instructions.
 
   * The GNU-EFI package (http://sourceforge.net/projects/gnu-efi/). You can
     install this from a package called "gnu-efi"; however, rEFInd relies on
@@ -33,15 +34,15 @@ To compile rEFInd, you'll need the following:
     source code, you may need to adjust those Makefiles' paths.
 
 Of the two toolkits, I prefer to use TianoCore because it produces binaries
-that are about 20-30KiB smaller than those made by GNU-EFI, and I can
-easily build 32-bit binaries on my 64-bit Linux installations. Also, I've
-had problems on a 32-bit Mac Mini with the drivers produced by GNU-EFI
-hanging the system if I try to load more than one of them. (I haven't
-encountered this problem on UEFI-based PCs.) That said, the TianoCore EDK2
-package is much harder to install, so you may prefer to use GNU-EFI unless
-you have a specific need for the TianoCore toolkit. Automated build tools
-like the OpenSUSE Build Service (OBS) and the Ubuntu Personal Package
-Archive (PPA) mechanism don't yet support TianoCore.
+that are about 5-30KiB smaller than those made by GNU-EFI, and I can easily
+build 32-bit binaries on my 64-bit Linux installations. Also, I've had
+problems on a 32-bit Mac Mini with the drivers produced by GNU-EFI hanging
+the system. (I haven't encountered this problem on UEFI-based PCs.) That
+said, the TianoCore EDK2 package is much harder to install, so you may
+prefer to use GNU-EFI unless you have a specific need for the TianoCore
+toolkit. Automated build tools like the OpenSUSE Build Service (OBS) and
+the Ubuntu Personal Package Archive (PPA) mechanism don't yet support
+TianoCore.
 
 It's possible to use a non-Linux platform to compile rEFInd. To the best of
 my knowledge, the rEFInd code doesn't rely on anything Linux-specific in
@@ -73,7 +74,7 @@ process is fairly typical of Linux packages. Read the GNU-EFI documentation
 if you need help. If you're using GNU-EFI, you can skip the rest of this
 section.
 
-You might also want to use the TianoCore toolkit if you have problems with
+You might want to use the TianoCore toolkit if you have problems with
 GNU-EFI or if you want to build rEFInd on a non-Linux platform.
 Unfortunately, the TianoCore toolkit is weird by Linux programming
 standards. It's also quite large -- it's intended as a means to develop a
@@ -86,11 +87,13 @@ is a bit unclear about others. Here's how I installed the toolkit:
 
 1) Download UDK2014.SR1.UP1.P1 from
    https://sourceforge.net/apps/mediawiki/tianocore/index.php?title=UDK2014.
+   Note that UDK2015 is now available, but I have not yet adapted rEFInd to
+   build with it. (UDK2015 has made changes that require matching changes
+   to rEFInd.)
 
 2) Type "mkdir /usr/local/UDK2014". You can use another directory, but the
-   Makefile for rEFInd's EFI drivers assumes this location. You'll need to
-   edit the EDK2BASE line in the Make.tiano file if you install somewhere
-   else.
+   rEFInd Makefile assumes this location. You'll need to edit the EDK2BASE
+   variable in the top-level Makefile if you install somewhere else.
 
 3) Type "cd /usr/local/UDK2014".
 
@@ -111,18 +114,21 @@ is a bit unclear about others. Here's how I installed the toolkit:
    however, a few changes are required, as detailed below....
 
 9) Type "source edksetup.sh BaseTools". This sets up some environment
-   variables, so subsequent steps (NOT including compiling the rEFInd EFI
+   variables, so subsequent steps (NOT including compiling rEFInd or its
    drivers) must be typed in the shell you use for this step.
 
 10) Edit Conf/target.txt and change the following:
     - ACTIVE_PLATFORM = MdePkg/MdePkg.dsc
     - TARGET = RELEASE (DEBUG might work, but I've not tested it).
-    - TARGET_ARCH = X64 (on x86-64; leave this as IA32 on x86). If you plan
-      to build both architectures on an x86-64 system, you can set this to
-      "IA32 X64".
-    - TOOL_CHAIN_TAG = GCC46 (or other value depending on your GCC version;
-      type "gcc -v" to learn your GCC version number). Note that GCC 4.7
-      and 4.8 don't have their own entries, so use GCC46 for them.
+    - TARGET_ARCH = X64 (on x86-64; leave this as IA32 on x86 or change it
+      to AARCH64 on ARM64). If you plan to build multiple architectures,
+      you can set this to "IA32 X64" or some other combination.
+    - TOOL_CHAIN_TAG = GCC48 (or other value depending on your GCC version;
+      type "gcc -v" to learn your GCC version number). Note that support
+      for the latest GCC version takes a while to make it into the
+      TianoCore toolkit, so if you're using a very recent GCC, you may need
+      to specify an earlier version and hope for the best or modify
+      Conf/target.txt, as described shortly.
     The TianoCore Makefiles read some of these variables from this file
     and use them when accessing directories, so be sure to type these
     entries in the case specified.
@@ -130,13 +136,15 @@ is a bit unclear about others. Here's how I installed the toolkit:
 11) The documentation refers to editing Conf/tools_def.txt in addition to
     Conf/target.txt, but doesn't specify what to change in
     Conf/tools_def.txt. I haven't found it necessary to make any changes in
-    Conf/tools_def.txt EXCEPT when using GCC 4.7 on a Fedora 17 system.
-    (I haven't used GCC 4.7 on other platforms, so this may well be
-    necessary on other systems, too.) With that setup, I found it
-    necessary to change the following line:
-    *_GCC46_X64_ASM_FLAGS            = DEF(GCC46_ASM_FLAGS) -m64 -melf_x86_64
-    to:
-    *_GCC46_X64_ASM_FLAGS            = DEF(GCC46_ASM_FLAGS) -m64
+    Conf/tools_def.txt EXCEPT when using GCC 4.7 on a Fedora 17 system with
+    the original UDK2014. With this setup, GCC 4.7 was newer than the most
+    recent GCC that TianoCore supported at that time. With that setup, I
+    found it necessary to change the following line:
+      *_GCC46_X64_ASM_FLAGS            = DEF(GCC46_ASM_FLAGS) -m64 -melf_x86_64
+      to:
+      *_GCC46_X64_ASM_FLAGS            = DEF(GCC46_ASM_FLAGS) -m64
+    Something similar may be necessary if you're using a very recent
+    GCC or some other compiler.
 
 12) Type "make -C /usr/local/UDK2014/MyWorkSpace/BaseTools/Source/C".
     (This step is not documented on the EDK Web page.) Note that this
@@ -149,9 +157,9 @@ is a bit unclear about others. Here's how I installed the toolkit:
     Gentoo).
 
 If you installed in a location other than the one I've specified, you must
-edit the EDK2BASE variable in the Make.tiano and filesystems/Make.tiano
-files in the rEFInd source package. Once the toolkit is installed, you can
-build the filesystem drivers or rEFInd, as described below.
+edit the EDK2BASE variable in the top-level Makefile in the rEFInd source
+package. Once the toolkit is installed, you can build the filesystem
+drivers or rEFInd, as described below.
 
 
 Compiling rEFInd
@@ -168,36 +176,45 @@ With your development system set up, you can compile rEFInd as follows:
    including this BUILDING.txt file and several subdirectories such as
    "refind", "libeg", "mok", "filesystems", and "include".
 
-4) Type "make gnuefi" to build with GNU-EFI, or either "make" alone or
-   "make tiano" to build with TianoCore EDK2. With any luck, rEFInd will
-   compile without error, leaving the "refind_ia32.efi" or "refind_x64.efi"
-   file, depending on your platform, in the "refind" subdirectory. This same
-   step builds the "gptsync_x64.efi" or "gptsync_ia32.efi" program file, in
-   the "gptsync" subdirectory. If you want to build IA32 binaries on an
-   x86-64 (X64) system, type "ARCH=ia32 make". This works only if you're
-   using the TianoCore build kit, and only if you set TARGET_ARCH to either
-   "IA32" or "IA32 X64" in target.txt when you set up the TianoCore toolkit.
-   If you plan to build both architectures, be sure to copy the .efi file
-   for the first build out of the refind subdirectory before building the
-   second architecture.
+4) Type "make" to build rEFInd. The Makefile checks for the TianoCore
+   toolkit and tries to use it if it's present. If both toolkits are
+   installed, you can specify the toolkit name -- "make gnuefi" to build
+   with GNU-EFI, or either "make tiano" to build with TianoCore. With any
+   luck, rEFInd will compile without error, leaving the "refind_ia32.efi",
+   "refind_x64.efi", or "refind_aa64.efi" file, depending on your platform,
+   in the "refind" subdirectory. This same step builds the
+   "gptsync_ia32.efi", "gptsync_x64.efi", or "gptsync_aa64.efi" program
+   file, in the "gptsync" subdirectory. (When cross-compiling with
+   TianoCore, "gptsync_aa64.efi" is not built because the cross-compiler
+   failed for me. Since gptsync is likely to be useless on ARM64, this is
+   no great loss.) If you want to build IA32 binaries on an x86-64 (X64)
+   system, type "ARCH=ia32 make". Similarly, you can specify "ARCH=aarch64"
+   to cross-compile for ARM64. This works only if you're using the
+   TianoCore build kit, and only if you set TARGET_ARCH to the appropriate
+   value in target.txt when you set up the TianoCore toolkit. If you plan
+   to build multiple architectures, be sure to copy the .efi file for the
+   first build out of the refind subdirectory before building the second
+   architecture.
 
 5) The default build process does NOT build the filesystem drivers. If you
    want to build them, you must type "make fs" in the main rEFInd source
-   directory to build with the TianoCore EDK2, or "make fs_gnuefi" to build
-   with GNU-EFI. (Typing "ARCH=ia32 make fs" builds IA32 filesystem drivers
-   on an x86-64 system, provided TianoCore is properly configured, as
-   described earlier.) The result is filesystem drivers in the filesystems
+   directory. This command builds with the TianoCore toolkit if it's
+   available and with GNU-EFI if it's not. Alternatively, you can type
+   "make fs_gnuefi" to build with GNU-EFI or "make fs_tiano" to build with
+   TianoCore. (You can prepend "ARCH=ia32" or "ARCH=aarch64" to
+   cross-compile for those architectures, as when building the main rEFInd
+   binary.) The result is filesystem drivers in the filesystems
    subdirectory, and also copies placed in the drivers_{arch} subdirectory.
 
 If rEFInd doesn't compile correctly, you'll need to track down the source
 of the problem. Double-check that you've got all the necessary development
 tools installed, including GCC, make, and either GNU-EFI or TianoCore EDK2.
-You may also need to adjust the Makefile, Make.common file, or Make.tiano
-file for your system. (The main Makefile controls the process for both
-toolkits, while Make.common holds GNU-EFI options and Make.tiano holds
-TianoCore options.) The most likely thing you'll need to change is the path
-to the various GNU-EFI include files and libraries. Since rEFInd 0.6.2, the
-default Make.common file includes the following definitions:
+You may also need to adjust the Makefile or Make.common file; or possibly
+Make* files in code subdirectories. (The main Makefile controls the process
+for both toolkits, while Make.common holds most common options.) The most
+likely thing you'll need to change is the path to the various GNU-EFI
+include files and libraries. Since rEFInd 0.6.2, the default Make.common
+file includes the following definitions:
 
 EFIINC          = /usr/include/efi
 GNUEFILIB       = /usr/lib
@@ -211,7 +228,7 @@ need at least GNU-EFI version 3.0l to build rEFInd, and until very
 recently, most distributions provided out-of-date versions of this package.
 
 If you're using TianoCore's EDK2, as noted earlier, you may need to adjust
-the EDK2BASE variable in Make.tiano and filesystems/Make.tiano.
+the EDK2BASE variable in Makefile.
 
 When I tried to compile rEFInd under Ubuntu 12.04 (i386) using GNU-EFI,
 even with a locally-compiled GNU-EFI 3.0p or 3.0q, I got errors like this:
@@ -234,8 +251,9 @@ with the refind-install script, which works on both Linux and Mac OS X.
 Alternatively, you can type "make install" to install using this script.
 Note that this script copies files to the ESP and uses "efibootmgr" (on
 Linux) or "bless" (on OS X) to add rEFInd to the firmware's boot loader
-list. The docs/refind/installing.html file provides more details on this
-script and its use.
+list. The docs/man/refind-install.8 file (and its HTML conversion,
+docs/refind/refind-install.html) provides more details on this script and
+its use.
 
 If refind-install doesn't work for you or if you prefer to do the job
 manually, you may. On a UEFI-based system, you'll want to copy files on the
@@ -270,14 +288,9 @@ way to go, but this assumes that the ESP is mounted at /boot/efi.
 Compiling the EFI Filesystem Drivers
 ====================================
 
-To build all the drivers, you can type "make fs" or "make fs_gnuefi" from
-the main directory, which builds the drivers and places copies in both the
-filesystems and drivers_{arch} subdirectories. If you want to build just
-one driver, you can change into the "filesystems" directory and type "make
-{fsname}" or "make {fsname}_gnuefi", where {fsname} is a filesystem name --
-"ext2", "ext4", "reiserfs", "iso9660", or "hfs". In all cases, the build
-target that appends "_gnuefi" builds with GNU-EFI and the one that doesn't
-builds with TianoCore.
+To build all the drivers, you can type "make fs", "make fs_tiano", or "make
+fs_gnuefi" from the main directory, which builds the drivers and places
+copies in both the filesystems and drivers_{arch} subdirectories.
 
 To install drivers, you can type "make install" in the "filesystems"
 directory. This copies all the drivers to the
index 3be7522e98955acc9d18db38bfbcf6b765a002ce..6b0a3b09f272f84b4b200bed88d260507e5e74fb 100644 (file)
@@ -8,12 +8,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
 
-include ../Make.tiano
+include ../Make.common
 
 SOURCE_NAMES     = legacy BmLib BdsConnect DevicePath BdsHelper BdsTianoCore
 OBJS             = $(SOURCE_NAMES:=.obj)
-#DRIVERNAME      = ext2
-#BUILDME          = $(DRIVERNAME)_$(FILENAME_CODE).efi
 
 all: $(AR_TARGET)
 
index 00e6f5860801fa716c353f5b03aaff24ca7566e7..39d6be67290af44f064b625c99e49fddd623958a 100644 (file)
@@ -11,7 +11,7 @@ SRCDIR = .
 
 VPATH = $(SRCDIR)
 
-LOCAL_CPPFLAGS  = -I$(SRCDIR) -I$(SRCDIR)/../include
+LOCAL_GNUEFI_CFLAGS  = -I$(SRCDIR) -I$(SRCDIR)/../include
 
 OBJS            = gnuefi-helper.o legacy.o BdsHelper.o BdsTianoCore.o
 TARGET          = libEfiLib.a
index cb5d181181b46b247bc24f06ed0efb43eaf067da..563cdbf97890313ffd7302e84f6b2b48c992b5f6 100644 (file)
@@ -8,6 +8,15 @@
 # You should have received a copy of the GNU General Public License
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
 
+# This file contains make definitions common to several (or all) of the make
+# files in the rEFInd code subdirectories. Some options are specific to
+# particular architectures or build systems and others are more universal.
+
+#
+# Environment definitions -- where stuff is and what sort of system is being
+# used to compile rEFInd....
+#
+
 EFIINC          = /usr/include/efi
 GNUEFILIB       = /usr/lib
 EFILIB          = /usr/lib
@@ -20,93 +29,179 @@ EFICRT0         = /usr/lib
 #EFICRT0         = /usr/local/lib
 
 HOSTARCH        = $(shell uname -m | sed s,i[3456789]86,ia32,)
-ARCH            := $(HOSTARCH)
-OS             = $(shell uname -s)
-CPPFLAGS        = -I$(EFIINC) -I$(EFIINC)/$(ARCH) -I$(EFIINC)/protocol -I../include -I../refind -I../libeg -DCONFIG_$(ARCH) -D__MAKEWITH_GNUEFI
-
-OPTIMFLAGS      = -O2 -fno-strict-aliasing
-DEBUGFLAGS      = -Wall
-#CFLAGS          = $(ARCH3264) $(OPTIMFLAGS) -fpic -fshort-wchar $(DEBUGFLAGS)
-CFLAGS          = $(ARCH3264) $(OPTIMFLAGS) -fno-stack-protector -fpic -fshort-wchar $(DEBUGFLAGS)
-ASFLAGS         = $(ARCH3264)
-LDFLAGS         = -nostdlib
-DRV_LDFLAGS     =
+ARCH            ?= $(HOSTARCH)
 
+# Note: EDK2BASE is definted in master Makefile and exported
+#EDK2BASE        = /usr/local/UDK2014/MyWorkSpace
+GENFW           = $(EDK2BASE)/BaseTools/Source/C/bin/GenFw
 prefix          = /usr/bin/
-CC              = $(prefix)gcc
-AS              = $(prefix)as
-LD              = $(prefix)ld
-AR              = $(prefix)ar
-RANLIB          = $(prefix)ranlib
-OBJCOPY         = $(prefix)objcopy
-
-ifeq ($(ARCH),ia64)
-  # EFI specs allows only lower floating point partition to be used
-  CFLAGS       += -frename-registers -mfixed-range=f32-f127
+ifeq ($(ARCH),aarch64)
+  CC            = $(prefix)aarch64-linux-gnu-gcc
+  AS            = $(prefix)aarch64-linux-gnu-as
+  LD            = $(prefix)aarch64-linux-gnu-ld
+  AR            = $(prefix)aarch64-linux-gnu-ar
+  RANLIB        = $(prefix)aarch64-linux-gnu-ranlib
+  OBJCOPY       = $(prefix)aarch64-linux-gnu-objcopy
+else
+  CC            = $(prefix)gcc
+  AS            = $(prefix)as
+  LD            = $(prefix)ld
+  AR            = $(prefix)ar
+  RANLIB        = $(prefix)ranlib
+  OBJCOPY       = $(prefix)objcopy
 endif
 
+ifeq ($(MAKEWITH),TIANO)
+# Below file defines TARGET (RELEASE or DEBUG) and TOOL_CHAIN_TAG (GCC44, GCC45, GCC46, or GCC47)
+include $(EDK2BASE)/Conf/target.txt
+endif
+
+#
+# C compiler flags
+#
+
+# ...for both GNU-EFI and TianoCore....
+OPTIMFLAGS      = -Os -fno-strict-aliasing
+CFLAGS          = $(OPTIMFLAGS) -fno-stack-protector -fshort-wchar -Wall
+
+# ...for GNU-EFI....
+GNUEFI_CFLAGS   = -I$(EFIINC) -I$(EFIINC)/$(ARCH) -I$(EFIINC)/protocol -I../include -I../refind -I../libeg -I../mok
+#GNUEFI_CFLAGS   = -I$(EFIINC) -I$(EFIINC)/$(ARCH) -I$(EFIINC)/protocol -I. -I./../include -I./../libeg -I./../mok -I../include -I../refind -I../libeg
+
+# ...and for TianoCore....
+TIANO_INCLUDE_DIRS = -I $(EDK2BASE)/MdePkg \
+                     -I $(EDK2BASE)/MdePkg/Include \
+                     -I $(EDK2BASE)/MdeModulePkg/ \
+                     -I $(EDK2BASE)/MdeModulePkg/Include \
+                     -I $(EDK2BASE)/IntelFrameworkPkg/Include \
+                     -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \
+                     -I .. \
+                     -I ../refind \
+                     -I ../libeg \
+                     -I ../include \
+                     -I ../mok
+#
+# Linker flags
+#
+
+# for GNU-EFI....
+SUBSYSTEM_LDFLAG  =
+GNUEFI_LDSCRIPT   = $(EFICRT0)/elf_$(ARCH)_efi.lds
+CRTOBJS           = $(EFICRT0)/crt0-efi-$(ARCH).o
+GNUEFI_LDFLAGS    = -T $(GNUEFI_LDSCRIPT) -shared -Bsymbolic -nostdlib -L$(EFILIB) -L$(GNUEFILIB) $(CRTOBJS)
+GNUEFI_LIBS       = -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name)
+#LIBS            = -lefi -lgnuefi $(shell $(CC) $(ARCH3264) -print-libgcc-file-name)
+
+# ...and for TianoCore....
+ENTRYPOINT=efi_main
+TIANO_LDSCRIPT   = $(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script
+TIANO_LDFLAGS   = -nostdlib -n -q --gc-sections --script=$(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script \
+                  --entry $(ENTRYPOINT) -u $(ENTRYPOINT) -m $(LD_CODE)
+
+
+
+#
+# objcopy flags for GNU-EFI
+#
+
 FORMAT          = --target=efi-app-$(ARCH)
 FORMAT_DRIVER   = --target=efi-bsdrv-$(ARCH)
 
-ifeq ($(ARCH),x86_64)
-  CFLAGS += -DEFI_FUNCTION_WRAPPER -mno-red-zone 
-  CPPFLAGS += -DEFIX64
-  LDFLAGS += -znocombreloc -zdefs
-  DRV_LDFLAGS += -znocombreloc -zdefs
 
-  ifeq ($(HOSTARCH),ia32)
-    ARCH3264 = -m64
+#
+# Modifications on a per-architecture basis....
+#
 
-    GNUEFILIB := $(GNUEFILIB)64
-    EFILIB    := $(EFILIB)64
-    EFICRT0   := $(EFICRT0)64
-  endif
+ifeq ($(ARCH),x86_64)
+#  CFLAGS += -DEFI_FUNCTION_WRAPPER
+#  GNUEFI_CFLAGS += -DEFIX64
+  GNUEFI_LDFLAGS += -znocombreloc -zdefs
+
+  ARCH_CFLAGS = -DEFIX64 -DEFI_FUNCTION_WRAPPER -m64 -mno-red-zone 
+ifeq ($(MAKEWITH),TIANO)
+  ARCH_CFLAGS += -mcmodel=large "-DEFIAPI=__attribute__((ms_abi))" 
+endif
+ifeq ($(MAKEWITH),GNUEFI)
+  ARCH_CFLAGS += -fpic
+endif
+  ARCHDIR = X64
+  UC_ARCH = X64
+  FILENAME_CODE = x64
+  LD_CODE = elf_x86_64
+
+#   ifeq ($(HOSTARCH),ia32)
+#     ARCH3264 = -m64
+# 
+#     GNUEFILIB := $(GNUEFILIB)64
+#     EFILIB    := $(EFILIB)64
+#     EFICRT0   := $(EFICRT0)64
+#   endif
 endif
 
 ifeq ($(ARCH),ia32)
-  CPPFLAGS += -DEFI32 -malign-double
-  LDFLAGS += -znocombreloc -zdefs
-  DRV_LDFLAGS += -znocombreloc -zdefs
+#  GNUEFI_CFLAGS += -DEFI32 -malign-double
+  GNUEFI_LDFLAGS += -znocombreloc -zdefs
 
   ifeq ($(HOSTARCH),x86_64)
-    ARCH3264 = -m32
+#    ARCH3264 = -m32
 
     GNUEFILIB := $(GNUEFILIB)32
     EFILIB    := $(EFILIB)32
     EFICRT0   := $(EFICRT0)32
   endif
+
+  ARCH_CFLAGS = -m32 -DEFI32 -malign-double
+ifeq ($(MAKEWITH),GNUEFI)
+  ARCH_CFLAGS += -fpic
+endif
+  ARCHDIR = Ia32
+  UC_ARCH = IA32
+  FILENAME_CODE = ia32
+  LD_CODE = elf_i386
 endif
 
 ifeq ($(ARCH), aarch64)
-  CFLAGS += -fno-stack-check -g -fno-merge-constants -ffreestanding -fno-stack-check 
-  CPPFLAGS += -DEFIAARCH64
+#  CFLAGS += -fno-stack-check 
+  GNUEFI_CFLAGS += -DEFIAARCH64
   FORMAT          = -O binary
   FORMAT_DRIVER   = -O binary
-  LDFLAGS         += --defsym=EFI_SUBSYSTEM=0xa --warn-common --no-undefined --fatal-warnings
-  DRV_LDFLAGS     += --defsym=EFI_SUBSYSTEM=0xb --warn-common --no-undefined --fatal-warnings
-endif
-
-CRTOBJS         = $(EFICRT0)/crt0-efi-$(ARCH).o
+  SUBSYSTEM_LDFLAG = -defsym=EFI_SUBSYSTEM=0xa
+  LDFLAGS         += --warn-common --no-undefined --fatal-warnings
 
-ifneq (,$(findstring FreeBSD,$(OS)))
- ifeq ($(ARCH),x86_64)
-       LDSCRIPT = $(EFICRT0)/elf_$(ARCH)_fbsd_efi.lds
- else
-       LDSCRIPT = $(EFICRT0)/elf_$(ARCH)_efi.lds
- endif
-else
-       LDSCRIPT = $(EFICRT0)/elf_$(ARCH)_efi.lds
+  ARCH_CFLAGS = -fno-merge-constants -ffreestanding -DEFIAARCH64
+  ifeq ($(MAKEWITH),TIANO)
+    ARCH_CFLAGS += -mcmodel=large -Wno-address -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections
+  endif
+  ifeq ($(MAKEWITH),GNUEFI)
+    ARCH_CFLAGS += -fno-stack-check
+  endif
+  ARCHDIR = AArch64
+  UC_ARCH = AARCH64
+  FILENAME_CODE = aa64
+  LD_CODE = aarch64elf
 endif
 
-LDFLAGS        += -T $(LDSCRIPT) -shared -Bsymbolic -L$(EFILIB) -L$(GNUEFILIB) $(CRTOBJS)
-DRV_LDFLAGS    += -T $(LDSCRIPT) -shared -Bsymbolic -L$(EFILIB) -L$(GNUEFILIB) $(CRTOBJS)
-LIBS            = -lefi -lgnuefi $(shell $(CC) $(ARCH3264) -print-libgcc-file-name)
-
+# ifneq (,$(findstring FreeBSD,$(OS)))
+#  ifeq ($(ARCH),x86_64)
+#      LDSCRIPT = $(EFICRT0)/elf_$(ARCH)_fbsd_efi.lds
+#  else
+#      LDSCRIPT = $(EFICRT0)/elf_$(ARCH)_efi.lds
+#  endif
+# else
+#      LDSCRIPT = $(EFICRT0)/elf_$(ARCH)_efi.lds
+# endif
 
+#
 # general rules
+#
 
-%.o: %.c 
-       $(CC) $(LOCAL_CPPFLAGS) $(CPPFLAGS) $(LOCAL_CFLAGS) $(CFLAGS) -c $< -o $@
+%.o: %.c
+       $(CC) $(CFLAGS) $(ARCH_CFLAGS) $(GNUEFI_CFLAGS) $(LOCAL_GNUEFI_CFLAGS) \
+             -D__MAKEWITH_GNUEFI -DREFIND_VERSION=$(REFIND_VERSION) -c $< -o $@
+
+%.obj: %.c
+       $(CC) $(CFLAGS) $(ARCH_CFLAGS) $(TIANO_INCLUDE_DIRS) -DNO_BUILTIN_VA_FUNCS \
+             -D__MAKEWITH_TIANO -DREFIND_VERSION=$(REFIND_VERSION) -c $< -o $@
 
 # rules for EFI applications
 
@@ -116,6 +211,7 @@ SHLIB_TARGET = $(subst .efi,.so,$(TARGET))
 
 endif
 
+
 # rules for libraries
 
 ifneq (,$(filter %.a,$(TARGET)))
@@ -127,7 +223,7 @@ endif
 
 # utility rules
 
-clean:
-       rm -f $(TARGET) *~ *.so $(OBJS) *.efi *.obj refind_*.txt refind_*.dll *.lib
+#clean:
+#      rm -f $(TARGET) *~ *.so $(OBJS) *.efi *.obj refind_*.txt refind_*.dll *.lib
 
 # EOF
diff --git a/Make.tiano b/Make.tiano
deleted file mode 100644 (file)
index 84fba95..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#
-# Make.tiano
-# Common Makefile options for rEFInd using TianoCore EDK2
-#
-
-# 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 <http://www.gnu.org/licenses/>.
-
-HOSTARCH        = $(shell uname -m | sed s,i[3456789]86,ia32,)
-ARCH            ?= $(HOSTARCH)
-
-# Note: IA64 options are untested; taken from Debian's rEFIt package.
-ifeq ($(ARCH),ia64)
-  # EFI specs allows only lower floating point partition to be used
-  ARCH_C_CFLAGS  = -frename-registers -mfixed-range=f32-f127
-  # TODO: Add ARCHDIR and FILENAME_CODE as appropriate
-endif
-
-ifeq ($(ARCH),ia32)
-  ARCH_C_FLAGS = -m32 -DEFI32 -malign-double
-  ARCHDIR = Ia32
-  UC_ARCH = IA32
-  FILENAME_CODE = ia32
-  LD_CODE = elf_i386
-endif
-
-ifeq ($(ARCH),x86_64)
-  ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -DEFIX64 -mcmodel=large -m64 -mno-red-zone 
-  ARCHDIR = X64
-  UC_ARCH = X64
-  FILENAME_CODE = x64
-  LD_CODE = elf_x86_64
-endif
-
-ifeq ($(ARCH),aarch64)
-  ARCH_C_FLAGS = -DEFIAARCH64 -mcmodel=large
-  ARCHDIR = AArch64
-  UC_ARCH = AARCH64
-  FILENAME_CODE = aa64
-  LD_CODE = aarch64elf
-endif
-
-#EDK2BASE = /usr/local/UDK2014/MyWorkSpace
-#EDK2BASE = /usr/local/EDK2/tianocore-edk2
-#ENTRYPOINT=_ModuleEntryPoint
-ENTRYPOINT=efi_main
-
-# Below file defines TARGET (RELEASE or DEBUG) and TOOL_CHAIN_TAG (GCC44, GCC45, GCC46, or GCC47)
-include $(EDK2BASE)/Conf/target.txt
-
-INCLUDE_DIRS    = -I $(EDK2BASE)/MdePkg \
-                  -I $(EDK2BASE)/MdePkg/Include \
-                 -I $(EDK2BASE)/MdeModulePkg/ \
-                  -I $(EDK2BASE)/MdeModulePkg/Include \
-                  -I $(EDK2BASE)/IntelFrameworkPkg/Include \
-                  -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \
-                 -I .. \
-                 -I ../refind \
-                 -I ../libeg \
-                 -I ../include \
-                 -I ../mok
-
-OPTIMFLAGS      += -fno-strict-aliasing -Wno-address -Os
-DEBUGFLAGS      = -Wall -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections
-CFLAGS          = $(OPTIMFLAGS) -g -fshort-wchar -fno-stack-protector $(DEBUGFLAGS) -c
-
-LDSCRIPT = $(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script
-
-LDFLAGS         = -nostdlib -n -q --gc-sections --script=$(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script \
-                  --entry $(ENTRYPOINT) -u $(ENTRYPOINT) -m $(LD_CODE)
-
-%.obj: %.c
-       $(CC) $(ARCH_C_FLAGS) $(CFLAGS) $(INCLUDE_DIRS) -DNO_BUILTIN_VA_FUNCS -D__MAKEWITH_TIANO -c $< -o $@
-
-
index 2292c51c4df87160ba0516ebe981b4a75df419b8..6426e8dd6380ccbe4fff27f752739bd9df3590b8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,69 +5,80 @@
 # You should have received a copy of the GNU General Public License
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
 
-CXXFLAGS=-O2 -fpic -D_REENTRANT -D_GNU_SOURCE -Wall -g
-NAMES=refind
-SRCS=$(NAMES:=.c)
-OBJS=$(NAMES:=.o)
-HEADERS=$(NAMES:=.h)
 LOADER_DIR=refind
 FS_DIR=filesystems
 LIBEG_DIR=libeg
 MOK_DIR=mok
 GPTSYNC_DIR=gptsync
 EFILIB_DIR=EfiLib
+export EDK2BASE=/usr/local/UDK2014/MyWorkSpace
+export REFIND_VERSION='L"0.10.0.10"'
 
-export EDK2BASE        = /usr/local/UDK2014/MyWorkSpace
-export GENFW           = $(EDK2BASE)/BaseTools/Source/C/bin/GenFw
-export prefix          = /usr/bin/
-ifeq ($(ARCH),aarch64)
-  export CC            = $(prefix)aarch64-linux-gnu-gcc
-  export AS            = $(prefix)aarch64-linux-gnu-as
-  export LD            = $(prefix)aarch64-linux-gnu-ld
-  export AR            = $(prefix)aarch64-linux-gnu-ar
-  export RANLIB        = $(prefix)aarch64-linux-gnu-ranlib
-  export OBJCOPY       = $(prefix)aarch64-linux-gnu-objcopy
+# 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:
+ifneq ($(wildcard $(EDK2BASE)/*),)
+       @echo "Found $(EDK2BASE); building with TianoCore"
+       +make tiano
 else
-  export CC            = $(prefix)gcc
-  export AS            = $(prefix)as
-  export LD            = $(prefix)ld
-  export AR            = $(prefix)ar
-  export RANLIB        = $(prefix)ranlib
-  export OBJCOPY       = $(prefix)objcopy
+       @echo "Did not find $(EDK2BASE); building with GNU-EFI"
+       +make gnuefi
 endif
 
-# Build rEFInd, including libeg
-all:   tiano
-
-gnuefi:
-       +make -C $(LIBEG_DIR)
-       +make -C $(MOK_DIR)
-       +make -C $(EFILIB_DIR)
-       +make -C $(LOADER_DIR)
-       +make -C $(GPTSYNC_DIR) gnuefi
-#      +make -C $(FS_DIR) all_gnuefi
-
+# The "fs" target, like "all," attempts to build with TianoCore but falls
+# back to GNU-EFI.
 fs:
-       +make -C $(FS_DIR)
+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
 
-fs_gnuefi:
-       +make -C $(FS_DIR) all_gnuefi
+# 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 AR_TARGET=EfiLib -C $(EFILIB_DIR) -f Make.tiano
-       +make AR_TARGET=libeg -C $(LIBEG_DIR) -f Make.tiano
-       +make AR_TARGET=mok -C $(MOK_DIR) -f Make.tiano
-       +make BUILDME=refind DLL_TARGET=refind -C $(LOADER_DIR) -f Make.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 -C $(GPTSYNC_DIR) -f Make.tiano
+       +make MAKEWITH=TIANO -C $(GPTSYNC_DIR) -f Make.tiano
 endif
-#      +make -C $(FS_DIR)
+#      +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:
-       +make -C $(GPTSYNC_DIR) -f Make.tiano
+gptsync_tiano:
+       +make MAKEWITH=TIANO -C $(GPTSYNC_DIR) -f Make.tiano
 
 gptsync_gnuefi:
-       +make -C $(GPTSYNC_DIR) gnuefi
+       +make MAKEWITH=GNUEFI -C $(GPTSYNC_DIR) gnuefi
 
 clean:
        make -C $(LIBEG_DIR) clean
index 73ecbceb55d4dec10137566ebd75ce06538e48fc..d39db5f85544ba4dcb704f746ce1c5386c9ca089 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,6 +1,14 @@
 0.10.1 (??/??/201?):
 --------------------
 
+- Significantly reworked the project's Makefiles. This should have no
+  impact on ordinary users, and even most developers should barely notice
+  it; but it should make future extensions to additional platforms or
+  building in different environments easier.
+
+- Added type code 53746F72-6167-11AA-AA11-00306543ECAC (Apple Core Storage,
+  gdisk type AF05) to list of partition types recognized by gptsync.
+
 - Removed Luxi Sans Mono font, since I discovered it was not open source;
   and changed the default font from Nimbus Mono to Liberation Mono.
 
index 3efb35b488eb9fe2dbb16240ce67767186218079..7ac2912c5f2dc862f4c92d5bbf47c90630ad0459 100644 (file)
@@ -16,7 +16,7 @@ License: GPL-3+
 Files: */Make*
 Copyright: 2012-2015 Roderick W. Smith
 License: GPL-3+
-Comment: Except for gptsync/Make* and net/Makefile; see below
+Comment: Except for gptsync/Make.unix and net/Makefile; see below
 
 Files: */AutoGen.[ch]
 Copyright: 2004-2011 Intel Corporation
@@ -138,6 +138,7 @@ License: Apple-BSD
  POSSIBILITY OF SUCH DAMAGE.
 
 Files: gptsync/*
+       gptsync/Make.unix
 Copyright: 2006 Christoph Pfisterer
 License: BSD-2-clause
 
index 6eab253332b6d5e79dd3fb168df5713cc2081bae..cfa669500305a184aa5b7ea5a15ee6094000f742 100644 (file)
 SRCDIR = .
 
 VPATH = $(SRCDIR)
-
 HOSTARCH        = $(shell uname -m | sed s,i[3456789]86,ia32,)
-ARCH            ?= $(HOSTARCH)
 
 # Note: IA64 options are untested; taken from Debian's rEFIt package.
-ifeq ($(ARCH),ia64)
-  # EFI specs allows only lower floating point partition to be used
-  ARCH_C_CFLAGS  = -frename-registers -mfixed-range=f32-f127
-  # TODO: Add FILENAME_CODE as appropriate
-endif
-
-ifeq ($(ARCH),ia32)
-  LIBEG = build32
-  ARCH_C_FLAGS = -m32 
-  FILENAME_CODE = ia32
-  LD_CODE = elf_i386
-endif
-
-ifeq ($(ARCH),x86_64)
-  LIBEG = build64
-  ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -m64
-  FILENAME_CODE = x64
-  LD_CODE = elf_x86_64
-endif
 
-ifeq ($(ARCH),aarch64)
-  LIBEG = build64
-  ARCH_C_FLAGS = 
-  FILENAME_CODE = aa64
-  LD_CODE = elf_aarch64
-  FORMAT_DRIVER = -O binary
+LOCAL_GNUEFI_CFLAGS   = -DFSTYPE=$(DRIVERNAME) -I$(SRCDIR) 
+ifeq ($(HOSTARCH),x86_64)
+  LOCAL_GNUEFI_CFLAGS += "-DEFIAPI=__attribute__((ms_abi))" 
 endif
 
-LOCAL_CPPFLAGS   = -DFSTYPE=$(DRIVERNAME) $(ARCH_C_FLAGS) -I$(SRCDIR) -I$(SRCDIR)/../include -I$(SRCDIR)/../libeg
-
 OBJS            = fsw_core.o fsw_efi.o fsw_efi_lib.o fsw_lib.o fsw_$(DRIVERNAME).o
 TARGET          = $(DRIVERNAME)_$(FILENAME_CODE).efi
 
+include $(SRCDIR)/../Make.common
+
 all: $(TARGET)
 
-include $(SRCDIR)/../Make.common
+ifeq ($(HOSTARCH),aarch64)
+  # Set symbol for driver
+  SUBSYSTEM_LDFLAG = -defsym=EFI_SUBSYSTEM=0xb
+endif
 
 $(SHLIB_TARGET): $(OBJS)
-       $(LD) $(LOCAL_LDFLAGS) $(DRV_LDFLAGS) $(OBJS) -o $@ $(LOCAL_LIBS) $(LIBS)
+       $(LD) $(GNUEFI_LDFLAGS) $(SUBSYSTEM_LDFLAG) $(OBJS) -o $@ $(LOCAL_LIBS) $(GNUEFI_LIBS)
 
 $(TARGET): $(SHLIB_TARGET)
        $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
index b435c9df56ec6adfc79f41a400893e6eff1f54e2..2c30d54b8a08d4fcc9410ef96fedf0135f8ad4d0 100644 (file)
@@ -8,45 +8,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
 
-HOSTARCH        = $(shell uname -m | sed s,i[3456789]86,ia32,)
-ARCH            ?= $(HOSTARCH)
-
-# Note: IA64 options are untested; taken from Debian's rEFIt package.
-ifeq ($(ARCH),ia64)
-  # EFI specs allows only lower floating point partition to be used
-  ARCH_C_CFLAGS  = -frename-registers -mfixed-range=f32-f127
-  # TODO: Add ARCHDIR and FILENAME_CODE as appropriate
-endif
-
-ifeq ($(ARCH),ia32)
-  ARCH_C_FLAGS = -m32 -malign-double -g
-  ARCHDIR = Ia32
-  UC_ARCH = IA32
-  FILENAME_CODE = ia32
-  LD_CODE = elf_i386
-endif
-
-ifeq ($(ARCH),x86_64)
-  ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -mcmodel=large -m64 -mno-red-zone
-  ARCHDIR = X64
-  UC_ARCH = X64
-  FILENAME_CODE = x64
-  LD_CODE = elf_x86_64
-endif
-
-ifeq ($(ARCH),aarch64)
-  ARCH_C_FLAGS = -DEFIAARCH64 -mcmodel=large
-  ARCHDIR = AArch64
-  UC_ARCH = AARCH64
-  FILENAME_CODE = aa64
-  LD_CODE = aarch64elf
-endif
-
-EDK2BASE = /usr/local/UDK2014/MyWorkSpace
-#EDK2BASE = /usr/local/edk2
+include ../Make.common
 
 # Below file defines TARGET (RELEASE or DEBUG) and TOOL_CHAIN_TAG (GCC44, GCC45, or GCC46)
-include $(EDK2BASE)/Conf/target.txt
+#include $(EDK2BASE)/Conf/target.txt
 
 EFILIB          = $(EDK2BASE)/Build/Mde/$(TARGET)_$(TOOL_CHAIN_TAG)/$(UC_ARCH)/MdePkg/Library
 ALL_EFILIBS     = $(EFILIB)/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib/OUTPUT/BaseDebugPrintErrorLevelLib.lib \
@@ -66,38 +31,21 @@ ifeq ($(ARCH),aarch64)
   ALL_EFILIBS +=  $(EFILIB)/BaseStackCheckLib/BaseStackCheckLib/OUTPUT/BaseStackCheckLib.lib
 endif
 
-INCLUDE_DIRS    = -I $(EDK2BASE)/MdePkg \
-                  -I $(EDK2BASE)/MdePkg/Include \
-                  -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \
-                 -I $(EDK2BASE)/EdkCompatibilityPkg/Foundation/Framework/Include \
-                 -I $(EDK2BASE)/EdkCompatibilityPkg/Foundation/Library/Dxe/Include
+TIANO_INCLUDE_DIRS = -I $(EDK2BASE)/MdePkg \
+                     -I $(EDK2BASE)/MdePkg/Include \
+                     -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \
+                    -I $(EDK2BASE)/EdkCompatibilityPkg/Foundation/Framework/Include \
+                    -I $(EDK2BASE)/EdkCompatibilityPkg/Foundation/Library/Dxe/Include
 
 FSW_NAMES       = fsw_efi fsw_core fsw_efi_lib fsw_lib AutoGen
 OBJS            = $(FSW_NAMES:=.obj)
 #DRIVERNAME      = ext2
 BUILDME          = $(DRIVERNAME)_$(FILENAME_CODE).efi
 
-OPTIMFLAGS      = -fno-strict-aliasing -Wno-address -Os
-DEBUGFLAGS      = -Wall -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections
-CFLAGS          = $(OPTIMFLAGS) -g -fshort-wchar -fno-stack-protector $(DEBUGFLAGS) -c -include AutoGen.h -DHOST_EFI_EDK2
-
-prefix          ?= /usr/bin/
-CC              ?= $(prefix)gcc
-AS              ?= $(prefix)as
-LD              ?= $(prefix)ld
-AR              ?= $(prefix)ar
-RANLIB          ?= $(prefix)ranlib
-OBJCOPY         ?= $(prefix)objcopy
-GENFW           ?= $(EDK2BASE)/BaseTools/Source/C/bin/GenFw
-
-
-LDSCRIPT = $(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script
-
-LDFLAGS         = -nostdlib -n -q --gc-sections --script=$(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script \
-                  --entry _ModuleEntryPoint -u _ModuleEntryPoint -m $(LD_CODE)
+ENTRYPOINT = _ModuleEntryPoint
 
 %.obj: %.c
-       $(CC) $(ARCH_C_FLAGS) $(CFLAGS) $(INCLUDE_DIRS) -DFSTYPE=$(DRIVERNAME) -DNO_BUILTIN_VA_FUNCS -c $< -o $@
+       $(CC) $(ARCH_CFLAGS) $(CFLAGS) $(TIANO_INCLUDE_DIRS) -DFSTYPE=$(DRIVERNAME) -DNO_BUILTIN_VA_FUNCS -D__MAKEWITH_TIANO -c $< -o $@
 
 ifneq (,$(filter %.efi,$(BUILDME)))
 
@@ -106,13 +54,11 @@ DLL_TARGET = $(subst .efi,.dll,$(BUILDME))
 all: $(BUILDME)
 
 $(DLL_TARGET): $(OBJS) fsw_$(DRIVERNAME).obj
-       $(LD) -o $(DRIVERNAME)_$(FILENAME_CODE).dll $(LDFLAGS) --start-group $(ALL_EFILIBS) $(OBJS) fsw_$(DRIVERNAME).obj --end-group
+       $(LD) -o $(DRIVERNAME)_$(FILENAME_CODE).dll $(TIANO_LDFLAGS) --start-group $(ALL_EFILIBS) $(OBJS) fsw_$(DRIVERNAME).obj --end-group
 
 $(BUILDME): $(DLL_TARGET)
        $(OBJCOPY) --strip-unneeded -R .eh_frame $(DLL_TARGET)
        $(GENFW) -e UEFI_DRIVER -o $(BUILDME) $(DLL_TARGET)
-#      $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
-#                 -j .rela -j .reloc --rename-section .data=.hii --target=efi-bsdrv-$(ARCH) $< $@
        mkdir -p ../drivers_$(FILENAME_CODE)
        cp $(BUILDME) ../drivers_$(FILENAME_CODE)
 
index 2f6dc5ff3eefe5e75c87ec2521f8d7a9872747de..aab5b39abc2d32a27c69af837e4e7331a8c3998c 100644 (file)
 #ifndef _FSW_BASE_H_
 #define _FSW_BASE_H_
 
-#ifdef HOST_EFI_EDK2
-#define HOST_EFI
-#endif
-
-#ifdef HOST_EFI
+#ifdef __MAKEWITH_TIANO
 #include "fsw_efi_base.h"
 #endif
 
index 878d106d72716be719e8b206a6c975df8007b243..897dddeffe11a73ed7d927acb29390da7fe43f66 100644 (file)
@@ -78,7 +78,7 @@ EFI_GUID gEfiFileSystemVolumeLabelInfoIdGuid = EFI_FILE_SYSTEM_VOLUME_LABEL_INFO
 /** Helper macro for stringification. */
 #define FSW_EFI_STRINGIFY(x) #x
 /** Expands to the EFI driver name given the file system type name. */
-#define FSW_EFI_DRIVER_NAME(t) L"rEFInd 0.9.1 " FSW_EFI_STRINGIFY(t) L" File System Driver"
+#define FSW_EFI_DRIVER_NAME(t) L"rEFInd 0.10.1 " FSW_EFI_STRINGIFY(t) L" File System Driver"
 
 // function prototypes
 
@@ -221,7 +221,7 @@ EFI_STATUS EFIAPI fsw_efi_main(IN EFI_HANDLE         ImageHandle,
 {
     EFI_STATUS  Status;
 
-#ifndef HOST_EFI_EDK2
+#ifndef __MAKEWITH_TIANO
     // Not available in EDK2 toolkit
     InitializeLib(ImageHandle, SystemTable);
 #endif
index f9d732dd81418a9d6142951aa009a8060fa4a31b..44daebb81fe5380e90200527db3cae294a01b5a4 100644 (file)
@@ -39,7 +39,7 @@
 #define _FSW_EFI_BASE_H_
 
 // If its EDK2 EFI Toolkit
-#ifdef HOST_EFI_EDK2
+#ifdef __MAKEWITH_TIANO
 #include "fsw_efi_edk2_base.h"
 #else
 // Intel EFI Toolkit
index c36272ff98a8d516ded41eb7c9dc6acd0a5b712e..edc5913a5aeef03ff57a48379e8b474f39388880 100644 (file)
@@ -47,7 +47,7 @@
 #ifndef __HFS_FORMAT__
 #define __HFS_FORMAT__
 
-// #if !defined(HOST_EFI_EDK2) && !defined(HOST_POSIX)
+// #if !defined(__MAKEWITH_TIANO) && !defined(HOST_POSIX)
 // // Only available on Mac? and Intel EFI Toolkit?
 // #include <sys/types.h>
 // #include <sys/appleapiopts.h>
index ad92564226464a294694c3ad945115bcd557871e..30f4ed2ddbf0cf87a0bbfe0e0f1a821fcf2817e4 100644 (file)
@@ -3,40 +3,38 @@
 # Build control file for the gptsync tool, built with GNU-EFI
 #
 
-LOCAL_CPPFLAGS  = -I. -I../include
-LOCAL_LDFLAGS   = 
+#LOCAL_GNUEFI_CFLAGS  = -I. -I../include
 LOCAL_LIBS      = 
 
 OBJS            = gptsync.o lib.o os_efi.o
-TARGET          = gptsync.efi
+#TARGET          = gptsync.efi
 
 include ../Make.common
 
 ifeq ($(ARCH),ia32)
-  ARCHNAME = gptsync_ia32.efi
+  TARGET = gptsync_ia32.efi
 endif
 
 ifeq ($(ARCH),x86_64)
-  ARCHNAME = gptsync_x64.efi
+  TARGET = gptsync_x64.efi
 endif
 
 ifeq ($(ARCH),aarch64)
-  ARCHNAME = gptsync_aa64.efi
+  TARGET = gptsync_aa64.efi
 endif
 
 all: $(TARGET)
 
-#SHLIB_TARGET = $(subst .efi,.so,$(TARGET))
+SHLIB_TARGET = $(subst .efi,.so,$(TARGET))
 
 $(SHLIB_TARGET): $(OBJS)
-       $(LD) $(LOCAL_LDFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(LOCAL_LIBS) $(LIBS)
+       $(LD) $(GNUEFI_LDFLAGS) $(SUBSYSTEM_LDFLAG) $(OBJS) -o $@ $(LOCAL_LIBS) $(GNUEFI_LIBS)
 
 $(TARGET): $(SHLIB_TARGET)
        $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
                   -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \
                   -j .reloc $(FORMAT) $< $@
        chmod a-x $(TARGET)
-       mv $(TARGET) $(ARCHNAME)
 
 
 # EOF
index 49e7787ef4c83af2cda40fc2791e280378fa2ccf..b67c1705cd1ad73c30f29c397af4f7efc1756ee4 100644 (file)
@@ -3,45 +3,10 @@
 # Build control file for gptsync utility, built with TianoCore EDK2
 #
 
-HOSTARCH        = $(shell uname -m | sed s,i[3456789]86,ia32,)
-ARCH            ?= $(HOSTARCH)
-
-# Note: IA64 options are untested; taken from Debian's rEFIt package.
-ifeq ($(ARCH),ia64)
-  # EFI specs allows only lower floating point partition to be used
-  ARCH_C_CFLAGS  = -frename-registers -mfixed-range=f32-f127
-  # TODO: Add ARCHDIR and FILENAME_CODE as appropriate
-endif
-
-ifeq ($(ARCH),ia32)
-  ARCH_C_FLAGS = -m32 -malign-double -DEFI32
-  ARCHDIR = Ia32
-  UC_ARCH = IA32
-  FILENAME_CODE = ia32
-  LD_CODE = elf_i386
-endif
-
-ifeq ($(ARCH),x86_64)
-  ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -mcmodel=large -m64 -mno-red-zone -DEFIX64
-  ARCHDIR = X64
-  UC_ARCH = X64
-  FILENAME_CODE = x64
-  LD_CODE = elf_x86_64
-endif
-
-ifeq ($(ARCH),aarch64)
-  ARCH_C_FLAGS = -DEFIAARCH64 -mcmodel=large
-  ARCHDIR = AArch64
-  UC_ARCH = AARCH64
-  FILENAME_CODE = aa64
-  LD_CODE = aarch64elf
-endif
-
-export EDK2BASE = /usr/local/UDK2014/MyWorkSpace
-#EDK2BASE = /usr/local/edk2
+include ../Make.common
 
 # Below file defines TARGET (RELEASE or DEBUG) and TOOL_CHAIN_TAG (GCC44, GCC45, or GCC46)
-include $(EDK2BASE)/Conf/target.txt
+#include $(EDK2BASE)/Conf/target.txt
 
 EFILIB          = $(EDK2BASE)/Build/Mde/$(TARGET)_$(TOOL_CHAIN_TAG)/$(UC_ARCH)/MdePkg/Library
 ALL_EFILIBS     = $(EFILIB)/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib/OUTPUT/BaseDebugPrintErrorLevelLib.lib \
@@ -61,47 +26,23 @@ ifeq ($(ARCH),aarch64)
   ALL_EFILIBS +=  $(EFILIB)/BaseStackCheckLib/BaseStackCheckLib/OUTPUT/BaseStackCheckLib.lib
 endif
 
-INCLUDE_DIRS    = -I $(EDK2BASE)/MdePkg \
-                  -I $(EDK2BASE)/MdePkg/Include \
-                  -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \
-                 -I $(EDK2BASE)/EdkCompatibilityPkg/Foundation/Framework/Include \
-                 -I $(EDK2BASE)/EdkCompatibilityPkg/Foundation/Library/Dxe/Include \
-                 -I $(EDK2BASE)/MdeModulePkg/ \
-                  -I $(EDK2BASE)/MdeModulePkg/Include \
-                  -I $(EDK2BASE)/IntelFrameworkPkg/Include \
-                  -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \
-                 -I ../libeg \
-                 -I ../include \
-                 -I ..
+TIANO_INCLUDE_DIRS = -I $(EDK2BASE)/MdePkg \
+                     -I $(EDK2BASE)/MdePkg/Include \
+                     -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \
+                    -I $(EDK2BASE)/EdkCompatibilityPkg/Foundation/Framework/Include \
+                    -I $(EDK2BASE)/EdkCompatibilityPkg/Foundation/Library/Dxe/Include \
+                    -I $(EDK2BASE)/MdeModulePkg/ \
+                     -I $(EDK2BASE)/MdeModulePkg/Include \
+                     -I $(EDK2BASE)/IntelFrameworkPkg/Include \
+                     -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \
+                    -I ../libeg \
+                    -I ../include \
+                    -I ..
 
 GPTSYNC_NAMES    = gptsync lib os_efi AutoGen ../EfiLib/BmLib
 OBJS             = $(GPTSYNC_NAMES:=.obj)
 BUILDME          = gptsync_$(FILENAME_CODE).efi
 
-OPTIMFLAGS      = -fno-strict-aliasing -Wno-address -Os
-DEBUGFLAGS      = -Wall -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections
-CFLAGS          = $(OPTIMFLAGS) -g -fshort-wchar -fno-stack-protector $(DEBUGFLAGS) -c -DHOST_EFI_EDK2 -D__MAKEWITH_TIANO
-#CFLAGS          = $(OPTIMFLAGS) -g -fshort-wchar -fno-stack-protector $(DEBUGFLAGS) -c -include AutoGen.h -DHOST_EFI_EDK2
-
-prefix          ?= /usr/bin/
-CC              ?= $(prefix)gcc
-AS              ?= $(prefix)as
-LD              ?= $(prefix)ld
-AR              ?= $(prefix)ar
-RANLIB          ?= $(prefix)ranlib
-OBJCOPY         ?= $(prefix)objcopy
-GENFW           ?= $(EDK2BASE)/BaseTools/Source/C/bin/GenFw
-
-
-LDSCRIPT = $(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script
-
-LDFLAGS         = -nostdlib -n -q --gc-sections --script=$(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script \
-                  --entry efi_main -u efi_main -m $(LD_CODE)
-
-%.obj: %.c
-       $(CC) $(ARCH_C_FLAGS) $(CFLAGS) $(INCLUDE_DIRS) -DNO_BUILTIN_VA_FUNCS -c $< -o $@
-       +make -C ../EfiLib -f Make.tiano
-
 ifneq (,$(filter %.efi,$(BUILDME)))
 
 DLL_TARGET = $(subst .efi,.dll,$(BUILDME))
@@ -109,7 +50,7 @@ DLL_TARGET = $(subst .efi,.dll,$(BUILDME))
 all: $(BUILDME)
 
 $(DLL_TARGET): $(OBJS)
-       $(LD) -o gptsync_$(FILENAME_CODE).dll $(LDFLAGS) --start-group $(ALL_EFILIBS) $(OBJS) --end-group
+       $(LD) -o gptsync_$(FILENAME_CODE).dll $(TIANO_LDFLAGS) --start-group $(ALL_EFILIBS) $(OBJS) --end-group
 
 $(BUILDME): $(DLL_TARGET)
        $(OBJCOPY) --strip-unneeded -R .eh_frame $(DLL_TARGET)
index 8987534b8513697aeb8c7a0e98bdd80a6e94a0ce..9e2b05fdd60e592a1f2504f0af82d44fb0b59082 100644 (file)
@@ -12,11 +12,12 @@ TARGET = tiano
 all:   $(TARGET)
 
 gnuefi:
-       +make -f Make.gnuefi gptsync.efi
+       +make -f Make.gnuefi
 
 tiano:
        +make -f Make.tiano
 
+# TODO: Fix Make.unix; currently broken....
 unix:
        +make -f Make.unix
 
index 2696e66d0a336b308b1fabfd5d597d89d73e30dc..c711186c97fc02115f44bee4fd50a8ccafea291c 100644 (file)
@@ -494,7 +494,7 @@ UINTN gptsync(VOID)
     UINTN   status_gpt, status_mbr;
     BOOLEAN proceed = FALSE;
 
-    Print(L"gptsync version %s\ncopyright (c) 2006-2007 Christoph Pfisterer & 2013 Roderick W. Smith\n", VERSION);
+    Print(L"gptsync version %s\ncopyright (c) 2006-2007 Christoph Pfisterer & 2013 Roderick W. Smith\n", REFIND_VERSION);
 
     // get full information from disk
     status_gpt = read_gpt();
index 11714720ad79ef0028e7558ec92e9cb31e99aed2..54576fa6b89b4784511fd855f621bbedad0b384d 100644 (file)
@@ -35,7 +35,7 @@
  */
 /* Changes copyright (c) 2013 Roderick W. Smith */
 
-#define VERSION L"0.9.1"
+//#define VERSION L"0.9.1"
 
 //
 // config
index 9a3ad459f797cd21a6422d128f07c16cabb3491d..7e64290cb6274fc6c4895236c60d17683175108b 100644 (file)
@@ -130,6 +130,7 @@ GPT_PARTTYPE    gpt_types[] = {
     // From http://developer.apple.com/mac/library/technotes/tn2006/tn2166.html
 //    { "\x00\x53\x46\x48\x00\x00\xAA\x11\xAA\x11\x00\x30\x65\x43\xEC\xAC", 0x00, STR("Mac OS X HFS+"), GPT_KIND_SYSTEM },
     { "\x00\x53\x46\x48\x00\x00\xAA\x11\xAA\x11\x00\x30\x65\x43\xEC\xAC", 0xaf, STR("Mac OS X HFS+"), GPT_KIND_DATA },
+    { "\x72\x6F\x74\x53\x67\x61\xAA\x11\xAA\x11\x00\x30\x65\x43\xEC\xAC", 0xaf, STR("Mac OS X Core Storage"), GPT_KIND_DATA },
     { "\x00\x53\x46\x55\x00\x00\xAA\x11\xAA\x11\x00\x30\x65\x43\xEC\xAC", 0xa8, STR("Mac OS X UFS"), GPT_KIND_DATA },
     { "\x74\x6F\x6F\x42\x00\x00\xAA\x11\xAA\x11\x00\x30\x65\x43\xEC\xAC", 0xab, STR("Mac OS X Boot"), GPT_KIND_DATA },
     { "\x44\x49\x41\x52\x00\x00\xAA\x11\xAA\x11\x00\x30\x65\x43\xEC\xAC", 0xac, STR("Apple RAID"), GPT_KIND_DATA },
index 9559014e4a2ee9f2373172eb43fa2a9d27700f83..51293d80f00e309a7c0bc8a99623602d5974ea0f 100644 (file)
@@ -191,7 +191,7 @@ static BOOLEAN VerifyGoOn(VOID) {
    BOOLEAN GoOn = TRUE;
    UINTN invalid;
 
-   if (MyStriCmp(L"Apple", ST->FirmwareVendor)) {
+   if (!MyStriCmp(L"Apple", ST->FirmwareVendor)) {
       Print(L"Your firmware is made by %s.\n", ST->FirmwareVendor);
       Print(L"Ordinarily, a hybrid MBR (which this program creates) should be used ONLY on\n");
       Print(L"Apple Macs that dual-boot with Windows or some other BIOS-mode OS. Are you\n");
index 21dc0262ea3816f2cac8996a4151fbe1c66df235..3553b6cceccfed740d83f0d59d8d8a38c09ab568 100644 (file)
@@ -8,12 +8,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
 
-include ../Make.tiano
+include ../Make.common
 
 SOURCE_NAMES     = image load_bmp load_icns lodepng lodepng_xtra screen text
 OBJS             = $(SOURCE_NAMES:=.obj)
-#DRIVERNAME      = ext2
-#BUILDME          = $(DRIVERNAME)_$(FILENAME_CODE).efi
 
 all: $(AR_TARGET)
 
index 6b564d4d24be166c90baa9b63ea601e76d3bd09b..e0ca107f92eb2c299cf29fa57519065ef1ee87ea 100644 (file)
@@ -12,7 +12,7 @@ SRCDIR = .
 
 VPATH = $(SRCDIR)
 
-LOCAL_CPPFLAGS  = -I$(SRCDIR) -I$(SRCDIR)/../include
+LOCAL_GNUEFI_CFLAGS  = -I$(SRCDIR) -I$(SRCDIR)/../include
 
 OBJS            = screen.o image.o text.o load_bmp.o load_icns.o lodepng.o lodepng_xtra.o
 TARGET          = libeg.a
@@ -21,4 +21,7 @@ all: $(TARGET)
 
 include $(SRCDIR)/../Make.common
 
+clean:
+       rm -f $(TARGET) *~ *.so $(OBJS) *.efi *.obj refind_*.txt refind_*.dll *.lib
+
 # EOF
index ee2c52c47b3bb61ff2e95dba5ecf2cdffc118054..b595b49f606ae3c285fe8deb48f640193d2e6a04 100644 (file)
@@ -7,7 +7,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
 
-include ../Make.tiano
+include ../Make.common
 
 SOURCE_NAMES     = guid mok security_policy simple_file
 OBJS             = $(SOURCE_NAMES:=.obj)
index a30b0e1cd75257f7351554f20d30f648859f332d..1d01cf560ba283d2b2e04e392060279852281fa7 100644 (file)
@@ -12,7 +12,7 @@ SRCDIR = .
 
 VPATH = $(SRCDIR)
 
-LOCAL_CPPFLAGS  = -I$(SRCDIR) -I$(SRCDIR)/../include
+LOCAL_GNUEFI_CFLAGS  = -I$(SRCDIR) -I$(SRCDIR)/../include
 
 OBJS            = guid.o mok.o security_policy.o simple_file.o
 TARGET          = libmok.a
@@ -21,4 +21,7 @@ all: $(TARGET)
 
 include $(SRCDIR)/../Make.common
 
+clean:
+       rm -f $(TARGET) *~ *.so $(OBJS) *.efi *.obj refind_*.txt refind_*.dll *.lib
+
 # EOF
index 075c4a7b7c3cd76725a7570e1907c80ffca292ef..6120c2f31f68123a36e161a283b3845e63ed4a4b 100644 (file)
@@ -10,7 +10,7 @@
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 
-include ../Make.tiano
+include ../Make.common
 
 EFILIB          = $(EDK2BASE)/Build/Mde/$(TARGET)_$(TOOL_CHAIN_TAG)/$(UC_ARCH)/MdePkg/Library
 ALL_EFILIBS     = $(EFILIB)/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib/OUTPUT/BaseDebugPrintErrorLevelLib.lib \
@@ -30,19 +30,13 @@ ALL_EFILIBS     = $(EFILIB)/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevel
                   $(EFILIB)/DxeServicesTableLib/DxeServicesTableLib/OUTPUT/DxeServicesTableLib.lib \
                   $(EFILIB)/DxeHobLib/DxeHobLib/OUTPUT/DxeHobLib.lib \
                   $(EFILIB)/BasePeCoffLib/BasePeCoffLib/OUTPUT/BasePeCoffLib.lib
-#                $(EFILIB)/BasePerformanceLibNull/BasePerformanceLibNull/OUTPUT/BasePerformanceLibNull.lib \
-#                /usr/local/UDK2010/MyWorkSpace/Build/Mde/RELEASE_GCC46/X64/MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu/OUTPUT/SecPeiDxeTimerLibCpu.lib \
-#                /usr/local/UDK2010/MyWorkSpace/Build/MdeModule/RELEASE_GCC46/X64/MdeModulePkg/Core/Dxe/DxeMain/OUTPUT/DxeCore.lib \
-#                /usr/local/UDK2010/MyWorkSpace/Build/Mde/RELEASE_GCC46/X64/MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib/OUTPUT/BaseCacheMaintenanceLib.lib \
-#                /usr/local/UDK2010/MyWorkSpace/Build/Mde/RELEASE_GCC46/X64/MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull/OUTPUT/BasePerformanceLibNull.lib
-#                  $(EFILIB)/../../MdeModulePkg/Core/Dxe/DxeMain/OUTPUT/DxeCore.lib
-#                /usr/local/UDK2010/MyWorkSpace/Build/MdeModule/RELEASE_GCC46/X64/MdeModulePkg/Core/Dxe/DxeMain/OUTPUT/DxeMain/DxeMain.obj
 
 ifeq ($(ARCH),aarch64)
   ALL_EFILIBS +=    $(EFILIB)/BaseStackCheckLib/BaseStackCheckLib/OUTPUT/BaseStackCheckLib.lib
 endif
 
-SOURCE_NAMES     = apple config mystrings line_edit driver_support icns lib main menu screen gpt crc32 legacy AutoGen
+SOURCE_NAMES     = apple config mystrings line_edit driver_support icns \
+                  lib main menu screen gpt crc32 legacy AutoGen
 OBJS             = $(SOURCE_NAMES:=.obj)
 
 all: $(BUILDME)
@@ -51,11 +45,14 @@ $(AR_TARGET): $(OBJS)
        $(AR) -cr $(AR_TARGET).lib $(OBJS)
 
 $(DLL_TARGET)_$(FILENAME_CODE).dll: $(OBJS) ../libeg/libeg.lib ../EfiLib/EfiLib.lib ../mok/mok.lib
-       $(LD) -o $(DLL_TARGET)_$(FILENAME_CODE).dll $(LDFLAGS) --start-group $(ALL_EFILIBS) $(OBJS) ../libeg/libeg.lib ../EfiLib/EfiLib.lib ../mok/mok.lib --end-group
+       $(LD) -o $(DLL_TARGET)_$(FILENAME_CODE).dll $(TIANO_LDFLAGS) \
+         --start-group $(ALL_EFILIBS) $(OBJS) ../libeg/libeg.lib \
+         ../EfiLib/EfiLib.lib ../mok/mok.lib --end-group
 
 $(BUILDME): $(DLL_TARGET)_$(FILENAME_CODE).dll
        $(OBJCOPY) --strip-unneeded -R .eh_frame $(DLL_TARGET)_$(FILENAME_CODE).dll
-       $(GENFW) -e UEFI_APPLICATION -o $(BUILDME)_$(FILENAME_CODE).efi $(DLL_TARGET)_$(FILENAME_CODE).dll
+       $(GENFW) -e UEFI_APPLICATION -o $(BUILDME)_$(FILENAME_CODE).efi \
+         $(DLL_TARGET)_$(FILENAME_CODE).dll
 
 clean:
        make clean
index 6fe0b5bcd4790e9efc5e443e0c57c2fc6a2b2e99..afda38abef3a60b8b012ccd10734e094cd0420eb 100644 (file)
@@ -30,18 +30,18 @@ ifeq ($(ARCH),aarch64)
   TARGET = refind_aa64.efi
 endif
 
-LOCAL_CPPFLAGS  = -I$(SRCDIR) -I$(SRCDIR)/../include -I$(SRCDIR)/../libeg -I$(SRCDIR)/../mok
+LOCAL_GNUEFI_CFLAGS  = -I$(SRCDIR) -I$(SRCDIR)/../include -I$(SRCDIR)/../libeg -I$(SRCDIR)/../mok
 LOCAL_LDFLAGS   = -L$(SRCDIR)/../libeg/ -L$(SRCDIR)/../mok/ -L$(SRCDIR)/../EfiLib/
 LOCAL_LIBS      = -leg -lmok -lEfiLib
 
 OBJS            = main.o mystrings.o apple.o line_edit.o config.o menu.o screen.o icns.o gpt.o crc32.o lib.o driver_support.o legacy.o
 
-all: $(TARGET)
-
 include $(SRCDIR)/../Make.common
 
+all: $(TARGET)
+
 $(SHLIB_TARGET): $(OBJS)
-       $(LD) $(LOCAL_LDFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(LOCAL_LIBS) $(LIBS)
+       $(LD) $(LOCAL_LDFLAGS) $(GNUEFI_LDFLAGS) $(SUBSYSTEM_LDFLAG) $(OBJS) -o $@ $(LOCAL_LIBS) $(GNUEFI_LIBS)
 
 $(TARGET): $(SHLIB_TARGET)
        $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
@@ -49,5 +49,8 @@ $(TARGET): $(SHLIB_TARGET)
                   -j .reloc $(FORMAT) $< $@
        chmod a-x $(TARGET)
 
+clean:
+       rm -f $(TARGET) *~ *.so $(OBJS) *.efi *.obj refind_*.txt refind_*.dll *.lib
+
 # EOF
 # DO NOT DELETE
index 08405ebdb2f4c56b0fc708cb4003458e563d8046..bf4c0e73941fdf7009a0d979dd643e26d0b873da 100644 (file)
@@ -19,7 +19,7 @@
 
 #ifdef __MAKEWITH_GNUEFI
 #include <efi.h>
-#include <efi/efilib.h>
+//#include <efi/efilib.h>
 #else
 #include "../include/tiano_includes.h"
 #endif
index 9ac7ce229af64a59317a996bed4fa654fb40295f..aead4213b53d7034af30df66622b13d5f899c4ed 100644 (file)
@@ -173,7 +173,7 @@ static EFI_STATUS ActivateMbrPartition(IN EFI_BLOCK_IO *BlockIO, IN UINTN Partit
     return EFI_SUCCESS;
 } /* static EFI_STATUS ActivateMbrPartition() */
 
-static EFI_GUID AppleVariableVendorID = { 0x7C436110, 0xAB2A, 0x4BBB, 0xA8, 0x80, 0xFE, 0x41, 0x99, 0x5C, 0x9F, 0x82 };
+static EFI_GUID AppleVariableVendorID = { 0x7C436110, 0xAB2A, 0x4BBB, { 0xA8, 0x80, 0xFE, 0x41, 0x99, 0x5C, 0x9F, 0x82 } };
 
 static EFI_STATUS WriteBootDiskHint(IN EFI_DEVICE_PATH *WholeDiskDevicePath)
 {
index e96f35b71f9611324003fb1c4384f78cb2519b4c..6b574edf1c4eca99dfe2b38d9dcc2cba8eb02e9e 100644 (file)
@@ -204,7 +204,7 @@ static VOID AboutrEFInd(VOID)
 
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.10.0.6");
+        AddMenuInfoLine(&AboutMenu, PoolPrint(L"rEFInd Version %s", REFIND_VERSION));
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2015 Roderick W. Smith");