Share common compilation flags

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-02-10 01:39:23 +01:00
parent c395ad834e
commit 5c2ee77128
12 changed files with 16 additions and 34 deletions

View file

@ -84,8 +84,8 @@ LDFLAGS = @LDFLAGS@ $(LIBS)
CPPFLAGS = @CPPFLAGS@ -I$(builddir) -I$(builddir)/include -I$(srcdir)/gnulib -I$(srcdir)/include -Wall -W \ CPPFLAGS = @CPPFLAGS@ -I$(builddir) -I$(builddir)/include -I$(srcdir)/gnulib -I$(srcdir)/include -Wall -W \
-DGRUB_LIBDIR=\"$(pkglibdir)\" -DLOCALEDIR=\"$(localedir)\" -DGRUB_LIBDIR=\"$(pkglibdir)\" -DLOCALEDIR=\"$(localedir)\"
TARGET_CC = @TARGET_CC@ TARGET_CC = @TARGET_CC@
TARGET_CFLAGS = @TARGET_CFLAGS@ TARGET_CFLAGS = -ffreestanding @TARGET_CFLAGS@
TARGET_ASFLAGS = @TARGET_ASFLAGS@ TARGET_ASFLAGS = -nostdinc -fno-builtin @TARGET_ASFLAGS@
TARGET_MODULE_FORMAT = @TARGET_MODULE_FORMAT@ TARGET_MODULE_FORMAT = @TARGET_MODULE_FORMAT@
TARGET_APPLE_CC = @TARGET_APPLE_CC@ TARGET_APPLE_CC = @TARGET_APPLE_CC@
OBJCONV = @OBJCONV@ OBJCONV = @OBJCONV@
@ -93,9 +93,9 @@ TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -I$(srcdir)/include -I$(builddir) -I$(buildd
ifneq ($(platform), emu) ifneq ($(platform), emu)
TARGET_CPPFLAGS += -nostdinc -isystem $(shell $(TARGET_CC) -print-file-name=include) TARGET_CPPFLAGS += -nostdinc -isystem $(shell $(TARGET_CC) -print-file-name=include)
endif endif
TARGET_LDFLAGS = @TARGET_LDFLAGS@ TARGET_LDFLAGS = -nostdlib @TARGET_LDFLAGS@
TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@ TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@
TARGET_IMG_LDFLAGS = @TARGET_IMG_LDFLAGS@ TARGET_IMG_LDFLAGS = -nostdlib @TARGET_IMG_LDFLAGS@
TARGET_IMG_CFLAGS = @TARGET_IMG_CFLAGS@ TARGET_IMG_CFLAGS = @TARGET_IMG_CFLAGS@
TARGET_OBJ2ELF = @TARGET_OBJ2ELF@ TARGET_OBJ2ELF = @TARGET_OBJ2ELF@
EXEEXT = @EXEEXT@ EXEEXT = @EXEEXT@

View file

@ -1,6 +1,5 @@
# -*- makefile -*- # -*- makefile -*-
COMMON_LDFLAGS += -nostdlib
COMMON_CFLAGS += -nostdinc -isystem $(shell $(TARGET_CC) -print-file-name=include) -fno-builtin COMMON_CFLAGS += -nostdinc -isystem $(shell $(TARGET_CC) -print-file-name=include) -fno-builtin
util/grub-emu.c_DEPENDENCIES = grub_emu_init.h util/grub-emu.c_DEPENDENCIES = grub_emu_init.h

View file

@ -1,8 +1,6 @@
# -*- makefile -*- # -*- makefile -*-
COMMON_ASFLAGS = -nostdinc -fno-builtin -m32 COMMON_CFLAGS = -mrtd -mregparm=3
COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32
COMMON_LDFLAGS = -m32 -nostdlib
# Images. # Images.

View file

@ -1,7 +1,5 @@
# -*- makefile -*- # -*- makefile -*-
COMMON_ASFLAGS = -nostdinc -fno-builtin -m32 COMMON_LDFLAGS = -melf_i386
COMMON_CFLAGS = -fno-builtin -m32
COMMON_LDFLAGS = -melf_i386 -nostdlib
include $(srcdir)/conf/x86-efi.mk include $(srcdir)/conf/x86-efi.mk

View file

@ -1,8 +1,6 @@
# -*- makefile -*- # -*- makefile -*-
COMMON_ASFLAGS = -m32 -nostdinc -fno-builtin COMMON_CFLAGS = -mrtd -mregparm=3
COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3
COMMON_LDFLAGS = -nostdlib
# Images. # Images.
pkglib_PROGRAMS = kernel.img pkglib_PROGRAMS = kernel.img

View file

@ -2,9 +2,7 @@
GRUB_KERNEL_MACHINE_LINK_ADDR = 0x8200 GRUB_KERNEL_MACHINE_LINK_ADDR = 0x8200
COMMON_ASFLAGS = -nostdinc -fno-builtin -m32 COMMON_CFLAGS = -mrtd -mregparm=3
COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32
COMMON_LDFLAGS = -m32 -nostdlib
# Images. # Images.
pkglib_IMAGES = boot.img cdboot.img diskboot.img kernel.img lnxboot.img \ pkglib_IMAGES = boot.img cdboot.img diskboot.img kernel.img lnxboot.img \

View file

@ -1,8 +1,6 @@
# -*- makefile -*- # -*- makefile -*-
COMMON_ASFLAGS = -nostdinc -fno-builtin -m32 COMMON_CFLAGS = -mrtd -mregparm=3
COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32
COMMON_LDFLAGS = -m32 -nostdlib
# Images. # Images.

View file

@ -1,9 +1,7 @@
# -*- makefile -*- # -*- makefile -*-
COMMON_ASFLAGS += -nostdinc COMMON_CFLAGS += -mexplicit-relocs -mflush-func=grub_cpu_flush_cache
COMMON_CFLAGS += -ffreestanding -mexplicit-relocs -mflush-func=grub_cpu_flush_cache
COMMON_LDFLAGS += -nostdlib
# Images. # Images.
kernel_img_HEADERS += cpu/libgcc.h cpu/cache.h kernel_img_HEADERS += cpu/libgcc.h cpu/cache.h

View file

@ -1,10 +1,6 @@
# -*- makefile -*- # -*- makefile -*-
COMMON_ASFLAGS = -nostdinc
COMMON_CFLAGS = -ffreestanding
COMMON_LDFLAGS += -nostdlib
# Images. # Images.
kernel_img_HEADERS += cpu/libgcc.h ieee1275/ieee1275.h kernel_img_HEADERS += cpu/libgcc.h ieee1275/ieee1275.h

View file

@ -1,9 +1,8 @@
# -*- makefile -*- # -*- makefile -*-
COMMON_ASFLAGS = -nostdinc -m64 COMMON_CFLAGS = -mno-app-regs
COMMON_CFLAGS = -ffreestanding -m64 -mno-app-regs COMMON_LDFLAGS = -melf64_sparc -mno-relax
COMMON_LDFLAGS = -melf64_sparc -nostdlib -mno-relax
# Images. # Images.
pkglib_IMAGES = boot.img diskboot.img kernel.img pkglib_IMAGES = boot.img diskboot.img kernel.img
@ -37,7 +36,7 @@ kernel_img_SOURCES = kern/sparc64/ieee1275/crt0.S kern/ieee1275/cmain.c \
symlist.c kern/$(target_cpu)/cache.S symlist.c kern/$(target_cpu)/cache.S
kernel_img_CFLAGS = $(COMMON_CFLAGS) kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS) kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc -static-libgcc -lgcc kernel_img_LDFLAGS = -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc -static-libgcc -lgcc
kernel_img_FORMAT = binary kernel_img_FORMAT = binary
# Utilities. # Utilities.

View file

@ -1,7 +1,5 @@
# -*- makefile -*- # -*- makefile -*-
COMMON_ASFLAGS = -nostdinc -fno-builtin -m64 COMMON_LDFLAGS = -melf_x86_64
COMMON_CFLAGS = -fno-builtin -m64
COMMON_LDFLAGS = -melf_x86_64 -nostdlib
include $(srcdir)/conf/x86-efi.mk include $(srcdir)/conf/x86-efi.mk

View file

@ -353,6 +353,7 @@ AC_MSG_RESULT([$TARGET_OBJ2ELF])
if test "x$target_m32" = x1; then if test "x$target_m32" = x1; then
# Force 32-bit mode. # Force 32-bit mode.
TARGET_CFLAGS="$TARGET_CFLAGS -m32" TARGET_CFLAGS="$TARGET_CFLAGS -m32"
TARGET_ASFLAGS="$TARGET_CFLAGS -m32"
TARGET_LDFLAGS="$TARGET_LDFLAGS -m32" TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
TARGET_MODULE_FORMAT="elf32" TARGET_MODULE_FORMAT="elf32"
fi fi
@ -360,6 +361,7 @@ fi
if test "x$target_m64" = x1; then if test "x$target_m64" = x1; then
# Force 64-bit mode. # Force 64-bit mode.
TARGET_CFLAGS="$TARGET_CFLAGS -m64" TARGET_CFLAGS="$TARGET_CFLAGS -m64"
TARGET_ASFLAGS="$TARGET_ASFLAGS -m64"
TARGET_LDFLAGS="$TARGET_LDFLAGS -m64" TARGET_LDFLAGS="$TARGET_LDFLAGS -m64"
TARGET_MODULE_FORMAT="elf64" TARGET_MODULE_FORMAT="elf64"
fi fi