From 9208367d3f2d3852a0903739e08cef703efe4777 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Tue, 26 Nov 2013 11:38:12 +0100 Subject: [PATCH] * grub-core/Makefile.am: Reduce gratuituous differences between Apple and non-Apple variants of efiemu compile. --- ChangeLog | 5 +++++ grub-core/Makefile.am | 34 ++++++++++++++-------------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index d59c46f5e..edb86307e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-11-26 Vladimir Serbinenko + + * grub-core/Makefile.am: Reduce gratuituous differences between Apple + and non-Apple variants of efiemu compile. + 2013-11-25 Andrey Borzenkov * configure.ac: Add explicit check for linking format of diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am index c096098d1..20f00a3c2 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -388,41 +388,35 @@ CLEANFILES += $(MOD_FILES) if COND_ENABLE_EFIEMU efiemu32.o: efiemu/runtime/efiemu.c $(TARGET_OBJ2ELF) - -rm -f $@; \ + -rm -f $@ + -rm -f $@.bin + $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m32 -Wall -Werror -nostdlib -static -O2 -c -o $@.bin $< if test "x$(TARGET_APPLE_LINKER)" = x1; then \ - $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m32 -Wall -Werror -nostdlib -O2 -c -o $@.bin $< || exit 1; \ $(TARGET_OBJCONV) -felf32 -nu -nd $@.bin $@ || exit 1; \ - rm -f $@.bin; \ + rm -f $@.bin ; \ + elif test ! -z "$(TARGET_OBJ2ELF)"; then \ + $(TARGET_OBJ2ELF) $@.bin || (rm -f $@.bin; exit 1); \ + mv $@.bin $@ ; \ else \ - $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m32 -Wall -Werror -nostdlib -O2 -c -o $@ $< || exit 1; \ - if test ! -z "$(TARGET_OBJ2ELF)"; then $(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi; \ + mv $@.bin $@ ; \ fi # Link format -arch,x86_64 means Apple linker efiemu64_c.o: efiemu/runtime/efiemu.c - if test "x$(EFIEMU64_LINK_FORMAT)" = x-arch,x86_64; then \ - $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m64 -nostdlib -Wall -Werror -mno-red-zone -c -o $@ $< || exit 1; \ - else \ - $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m64 -nostdlib -Wall -Werror -O2 -mcmodel=large -mno-red-zone -c -o $@ $< || exit 1; \ - fi + $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m64 -nostdlib -Wall -Werror -O2 -mcmodel=large -mno-red-zone -c -o $@ $< efiemu64_s.o: efiemu/runtime/efiemu.S - -rm -f $@ - if test "x$(EFIEMU64_LINK_FORMAT)" = x-arch,x86_64; then \ - $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m64 -Wall -Werror -nostdlib -O2 -mno-red-zone -c -o $@ $< || exit 1; \ - else \ - $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m64 -Wall -Werror -nostdlib -O2 -mcmodel=large -mno-red-zone -c -o $@ $< || exit 1; \ - fi + $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m64 -Wall -Werror -nostdlib -O2 -mcmodel=large -mno-red-zone -c -o $@ $< efiemu64.o: efiemu64_c.o efiemu64_s.o $(TARGET_OBJ2ELEF) - -rm -f $@; \ + -rm -f $@ + -rm -f $@.bin + $(TARGET_CC) -m64 $(EFIEMU64_LINK_FORMAT) -nostdlib -static -Wl,-r -o $@.bin $^ if test "x$(EFIEMU64_LINK_FORMAT)" = x-arch,x86_64; then \ - rm -f $@.bin; \ - $(TARGET_CC) -m64 -Wl,-r -nostdlib -o $@.bin $^ || exit 1; \ $(TARGET_OBJCONV) -felf64 -nu -nd $@.bin $@ || exit 1; \ rm -f $@.bin; \ else \ - $(TARGET_CC) -m64 $(EFIEMU64_LINK_FORMAT) -nostdlib -Wl,-r -o $@ $^ || exit 1; \ + mv $@.bin $@ ; \ fi platform_DATA += efiemu32.o efiemu64.o -- 2.39.5