summaryrefslogtreecommitdiff
path: root/diag/mbr/Makefile
diff options
context:
space:
mode:
authorchandramouli narayanan <mouli@linux.intel.com>2012-06-25 12:45:26 -0700
committerchandramouli narayanan <mouli@linux.intel.com>2012-06-25 12:45:26 -0700
commit38e58635d3868c23537fc5dce87b152a52df34ad (patch)
treef5677ef70b952068e8ebcd0f20daf06f50f8c178 /diag/mbr/Makefile
parentd8eede3f2a360163235fad222a0190cd7c5bef38 (diff)
downloadsyslinux-38e58635d3868c23537fc5dce87b152a52df34ad.tar.gz
The make files have undergone changes to support both i386 and x86_64 platforms.
Pertinent changes are sprinkled through *.mk and Makefile in the syslinux tree. Build architecture is specified at the command line via ARCH macro. This is to enable whether one is building for the native platform or cross-building for a different architecture. Currently, the only supported architectures via ARCH macro are i386 and x86_64. There are some modules (e.g. memdump) that don't build under the EFI environment. To go forward with efi boot support, a separate EFI_BUILD=1 macro has been added and is required to be specified while building. This is a temporary solution for the current build environment. example build: On a x86_64 platform, the following cross-builds syslinux for i386 To build for i386: make EFI_BUILD=1 ARCH=i386 On a x86_64 platform, the following builds syslinux for x86_64 To build natively: make EFI_BUILD=1 Changes specific to GCC and LD options: Architecture specific flags and include/search directories are set up for GCC and LD commands. Internally, GCC options such as stack-boundary, PIC and machine architecture are set up based on ARCH macro. While stack-boundary=2 is fine for i386, it does not work for x86_64 and so it is left to the default value. Using -fPIE with gcc does not work with ld on x86_64, but -fPIC works fine. Similarly, target and elf options are set up for linking as approrpriate for architecture. Assumption about gnu-efi install path: Since the EFI build supports both EFI32 and EFI64, the following assumptions are made with regard to the installed location of gnu-efi on the build platform. 1. gnu-efi-ia32: assumed installed in /usr/local [ EFI-32 include files in /usr/local/include/efi and gnu-efi library in /usr/local/lib/ ] 2. gnu-efi-x86_64: assumed installed in /usr [ EFI-64 include files in /usr/include/efi and gnu-efi library in /usr/lib64/ ] Remanants of the unused old i386-only files, if any, need to be pruned.
Diffstat (limited to 'diag/mbr/Makefile')
-rw-r--r--diag/mbr/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/diag/mbr/Makefile b/diag/mbr/Makefile
index 79ff9f01..f8582053 100644
--- a/diag/mbr/Makefile
+++ b/diag/mbr/Makefile
@@ -27,7 +27,7 @@ all: handoff.bin
.PRECIOUS: %.elf
%.elf: %.o $(mbrdir)/mbr.ld
- $(LD) $(LDFLAGS) -T $(mbrdir)/mbr.ld -e _start -o $@ $<
+ $(LD) $(LDFLAGS) -T $(mbrdir)/$(ARCH)/mbr.ld -e _start -o $@ $<
%.bin: %.elf $(mbrdir)/checksize.pl
$(OBJCOPY) -O binary $< $@