]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2006-05-29 Yoshinori K. Okuji <okuji@enbug.org>
authorokuji <okuji@localhost>
Sun, 28 May 2006 23:01:43 +0000 (23:01 +0000)
committerokuji <okuji@localhost>
Sun, 28 May 2006 23:01:43 +0000 (23:01 +0000)
        * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed.
        (target_cpu): New variable.
        (pkglibdir): Use target_cpu instead of host_cpu.

        * util/i386/pc/grub-install.in (host_cpu): Removed.
        (target_cpu): New variable.
        (pkglibdir): Use target_cpu instead of host_cpu.

        * util/genmoddep.c: Removed.

        * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P
        instead of GRUB_HOST_SIZEOF_VOID_P.
        * kern/dl.c: Likewise.

        * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to
        ...
        (GRUB_TARGET_SIZEOF_VOID_P): ... this.
        (GRUB_HOST_SIZEOF_LONG): Renamed to ...
        (GRUB_TARGET_SIZEOF_LONG): ... this.
        (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ...
        (GRUB_TARGET_WORDS_BIGENDIAN): ... this.
        * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed
        to ...
        (GRUB_TARGET_SIZEOF_VOID_P): ... this.
        (GRUB_HOST_SIZEOF_LONG): Renamed to ...
        (GRUB_TARGET_SIZEOF_LONG): ... this.
        (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ...
        (GRUB_TARGET_WORDS_BIGENDIAN): ... this.
        * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed
        to ...
        (GRUB_TARGET_SIZEOF_VOID_P): ... this.
        (GRUB_HOST_SIZEOF_LONG): Renamed to ...
        (GRUB_TARGET_SIZEOF_LONG): ... this.
        (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ...
        (GRUB_TARGET_WORDS_BIGENDIAN): ... this.

        * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use
        GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P.
        [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG
        instead of GRUB_HOST_SIZEOF_LONG.
        [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of
        GRUB_HOST_WORDS_BIGENDIAN to define or undefine
        GRUB_CPU_WORDS_BIGENDIAN.
        Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to
        define grub_host_addr_t, grub_host_off_t, grub_host_size_t and
        grub_host_ssize_t.

        * conf/i386-efi.rmk (noinst_UTILITIES): Removed.
        (genmoddep_SOURCES): Likewise.
        * conf/i386-pc.rmk (noinst_UTILITIES): Likewise.
        (genmoddep_SOURCES): Likewise.
        * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise.
        (genmoddep_SOURCES): Likewise.
        * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES):
        Likewise.
        (genmoddep_SOURCES): Likewise.

        * genmoddep.awk: New file.

        * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS,
        TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC,
        CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively.
        (PModule::rule): Likewise.
        (Program::rule): Likewise.
        (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of
        BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS,
        respectively.

        * configure.ac: Rewritten intensively to use host and target
        instead of build and host, respectively.

        * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu.
        (host_cpu): Removed.
        (target_cpu): New variable.
        (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\".
        (BUILD_CC): Removed.
        (BUILD_CFLAGS): Likewise.
        (BUILD_CPPFLAGS): Likewise.
        (TARGET_CC): New variable.
        (TARGET_CFLAGS): Likewise.
        (TARGET_CPPFLAGS): Likewise.
        (TARGET_LDFLAGS): Likewise.
        (AWK): Likewise.
        (include): Use target_cpu instead of host_cpu.
        (moddep.lst:): Use genmoddep.awk instead of genmoddep.

        * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.

25 files changed:
ChangeLog
DISTLIST
Makefile.in
conf/common.mk
conf/i386-efi.mk
conf/i386-efi.rmk
conf/i386-pc.mk
conf/i386-pc.rmk
conf/powerpc-ieee1275.mk
conf/powerpc-ieee1275.rmk
conf/sparc64-ieee1275.mk
conf/sparc64-ieee1275.rmk
configure
configure.ac
genmk.rb
genmoddep.awk [new file with mode: 0644]
include/grub/i386/types.h
include/grub/powerpc/types.h
include/grub/sparc64/types.h
include/grub/types.h
kern/dl.c
kern/efi/mm.c
util/genmoddep.c [deleted file]
util/i386/pc/grub-install.in
util/powerpc/ieee1275/grub-install.in

index f6c20402bfba78772b22edbd55ee3a862bd9b49b..c87460dc2b8d1663d465f15589878ae005798f10 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,93 @@
+2006-05-29  Yoshinori K. Okuji  <okuji@enbug.org>
+
+       * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed.
+       (target_cpu): New variable.
+       (pkglibdir): Use target_cpu instead of host_cpu.
+       
+       * util/i386/pc/grub-install.in (host_cpu): Removed.
+       (target_cpu): New variable.
+       (pkglibdir): Use target_cpu instead of host_cpu.
+
+       * util/genmoddep.c: Removed.
+       
+       * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P
+       instead of GRUB_HOST_SIZEOF_VOID_P.
+       * kern/dl.c: Likewise.
+
+       * include/grub/i386/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed to
+       ...
+       (GRUB_TARGET_SIZEOF_VOID_P): ... this.
+       (GRUB_HOST_SIZEOF_LONG): Renamed to ...
+       (GRUB_TARGET_SIZEOF_LONG): ... this.
+       (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ...
+       (GRUB_TARGET_WORDS_BIGENDIAN): ... this.
+       * include/grub/powerpc/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed
+       to ...
+       (GRUB_TARGET_SIZEOF_VOID_P): ... this.
+       (GRUB_HOST_SIZEOF_LONG): Renamed to ...
+       (GRUB_TARGET_SIZEOF_LONG): ... this.
+       (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ...
+       (GRUB_TARGET_WORDS_BIGENDIAN): ... this.
+       * include/grub/sparc64/types.h (GRUB_HOST_SIZEOF_VOID_P): Renamed
+       to ...
+       (GRUB_TARGET_SIZEOF_VOID_P): ... this.
+       (GRUB_HOST_SIZEOF_LONG): Renamed to ...
+       (GRUB_TARGET_SIZEOF_LONG): ... this.
+       (GRUB_HOST_WORDS_BIGENDIAN): Renamed to ...
+       (GRUB_TARGET_WORDS_BIGENDIAN): ... this.
+
+       * include/grub/types.h [!GRUB_UTIL] (GRUB_CPU_SIZEOF_VOID_P): Use
+       GRUB_TARGET_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P.
+       [!GRUB_UTIL] (GRUB_CPU_SIZEOF_LONG): Use GRUB_TARGET_SIZEOF_LONG
+       instead of GRUB_HOST_SIZEOF_LONG.
+       [!GRUB_UTIL]: Refer to GRUB_TARGET_WORDS_BIGENDIAN instead of
+       GRUB_HOST_WORDS_BIGENDIAN to define or undefine
+       GRUB_CPU_WORDS_BIGENDIAN.
+       Refer to SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P to
+       define grub_host_addr_t, grub_host_off_t, grub_host_size_t and
+       grub_host_ssize_t.
+
+       * conf/i386-efi.rmk (noinst_UTILITIES): Removed.
+       (genmoddep_SOURCES): Likewise.
+       * conf/i386-pc.rmk (noinst_UTILITIES): Likewise.
+       (genmoddep_SOURCES): Likewise.
+       * conf/conf/powerpc-ieee1275.rmk (noinst_UTILITIES): Likewise.
+       (genmoddep_SOURCES): Likewise.
+       * conf/conf/conf/sparc64-ieee1275.rmk (noinst_UTILITIES):
+       Likewise.
+       (genmoddep_SOURCES): Likewise.
+
+       * genmoddep.awk: New file.
+
+       * genmk.rb (Image::rule): Use TARGET_CC, TARGET_CPPFLAGS,
+       TARGET_CFLAGS, TARGET_ASFLAGS and TARGET_LDFLAGS instead of CC,
+       CPPFLAGS, CFLAGS, ASFLAGS and LDFLAGS, respectively.
+       (PModule::rule): Likewise.
+       (Program::rule): Likewise.
+       (Utility::rule): Use CC, CPPFLAGS, CFLAGS and LDFLAGS instead of
+       BUILD_CC, BUILD_CPPFLAGS, BUILD_CFLAGS and BUILD_LDFLAGS,
+       respectively.
+
+       * configure.ac: Rewritten intensively to use host and target
+       instead of build and host, respectively.
+
+       * Makefile.in (pkglibdir): Use target_cpu instead of host_cpu.
+       (host_cpu): Removed.
+       (target_cpu): New variable.
+       (CPPFLAGS): Added @CPPFLAGS@ and -DGRUB_LIBDIR=\"$(pkglibdir)\".
+       (BUILD_CC): Removed.
+       (BUILD_CFLAGS): Likewise.
+       (BUILD_CPPFLAGS): Likewise.
+       (TARGET_CC): New variable.
+       (TARGET_CFLAGS): Likewise.
+       (TARGET_CPPFLAGS): Likewise.
+       (TARGET_LDFLAGS): Likewise.
+       (AWK): Likewise.
+       (include): Use target_cpu instead of host_cpu.
+       (moddep.lst:): Use genmoddep.awk instead of genmoddep.
+       
+       * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c.
+
 2006-05-29  Vesa Jaaskelainen  <chaac@nic.fi>
 
        * include/grub/script.h (grub_script_cmdif): Renamed field 'bool' to
index f17038c9f5f772ab80c1cd4ee9b102f98837f969..f823b3b4b8490a98cf50284aefce7ea7fb774b2f 100644 (file)
--- a/DISTLIST
+++ b/DISTLIST
@@ -22,6 +22,7 @@ geninitheader.sh
 geninit.sh
 genkernsyms.sh.in
 genmk.rb
+genmoddep.awk
 genmodsrc.sh
 gensymlist.sh.in
 install-sh
@@ -242,7 +243,6 @@ term/i386/pc/vesafb.c
 term/i386/pc/vga.c
 term/ieee1275/ofconsole.c
 util/console.c
-util/genmoddep.c
 util/grub-emu.c
 util/misc.c
 util/resolve.c
index 964826656d5f462e30d45ae9f7b6689e689a3dce..e2ddbb2a1d15d74a2a87928f6112acbf55c1d8a1 100644 (file)
@@ -1,6 +1,6 @@
 # -*- makefile -*-
 #
-# Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005 Free Software Foundation, Inc.
+# Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005,2006 Free Software Foundation, Inc.
 #
 # This Makefile.in is free software; the author
 # gives unlimited permission to copy and/or distribute it,
@@ -35,7 +35,7 @@ infodir = @infodir@
 mandir = @mandir@
 includedir = @includedir@
 pkgdatadir = $(datadir)/@PACKAGE_TARNAME@
-pkglibdir = $(libdir)/@PACKAGE_TARNAME@/$(host_cpu)-$(platform)
+pkglibdir = $(libdir)/@PACKAGE_TARNAME@/$(target_cpu)-$(platform)
 
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_TARNAME = @PACKAGE_TARNAME@
@@ -43,7 +43,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
 PACKAGE_STRING = @PACKAGE_STRING@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 
-host_cpu = @host_cpu@
+target_cpu = @target_cpu@
 platform = @platform@
 
 INSTALL = @INSTALL@
@@ -57,15 +57,18 @@ mkinstalldirs = $(srcdir)/mkinstalldirs
 CC = @CC@
 CFLAGS = @CFLAGS@
 LDFLAGS = @LDFLAGS@
-CPPFLAGS = -I. -Iinclude -I$(srcdir)/include -Wall -W
-BUILD_CC = @BUILD_CC@
-BUILD_CFLAGS = -g -O2
-BUILD_CPPFLAGS = -I. -Iinclude -I$(srcdir)/include -Wall -W \
-       -DGRUB_LIBDIR=\"$(pkglibdir)\"
+CPPFLAGS = @CPPFLAGS@ -I. -Iinclude -I$(srcdir)/include -Wall -W \
+        -DGRUB_LIBDIR=\"$(pkglibdir)\"
+TARGET_CC = @TARGET_CC@
+TARGET_CFLAGS = @TARGET_CFLAGS@
+TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -I. -Iinclude -I$(srcdir)/include \
+       -Wall -W
+TARGET_LDFLAGS = @TARGET_LDFLAGS@
 OBJCOPY = @OBJCOPY@
 STRIP = @STRIP@
 NM = @NM@
 RUBY = @RUBY@
+AWK = @AWK@
 LIBCURSES = @LIBCURSES@
 LIBLZO = @LIBLZO@
 YACC = @YACC@
@@ -99,14 +102,15 @@ $(addprefix $(srcdir)/,$(MKFILES)): %.mk: %.rmk genmk.rb
          $(RUBY) $(srcdir)/genmk.rb < $< > $@; \
        fi
 
-include $(srcdir)/conf/$(host_cpu)-$(platform).mk
+include $(srcdir)/conf/$(target_cpu)-$(platform).mk
 
 ### General targets.
 
 CLEANFILES += moddep.lst command.lst fs.lst
 pkgdata_DATA += moddep.lst command.lst fs.lst
-moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep
-       cat $(DEFSYMFILES) /dev/null | ./genmoddep $(UNDSYMFILES) > $@ \
+moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep.awk
+       cat $(DEFSYMFILES) /dev/null \
+         | $(AWK) -f $(srcdir)/genmoddep.awk $(UNDSYMFILES) > $@ \
          || (rm -f $@; exit 1)
 
 command.lst: $(COMMANDFILES)
index 3d2bb5f1d7952cb56454030f0cbb22112c07164b..f3b26672eb327d1deaf09a73563c5971021537d8 100644 (file)
@@ -36,15 +36,15 @@ UNDSYMFILES += und-fshelp.lst
 
 fshelp.mod: pre-fshelp.o mod-fshelp.o
        -rm -f $@
-       $(CC) $(fshelp_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-fshelp.o: fshelp_mod-fs_fshelp.o
        -rm -f $@
-       $(CC) $(fshelp_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-fshelp.o: mod-fshelp.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -c -o $@ $<
 
 mod-fshelp.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'fshelp' $< > $@ || (rm -f $@; exit 1)
@@ -59,10 +59,10 @@ und-fshelp.lst: pre-fshelp.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 fshelp_mod-fs_fshelp.o: fs/fshelp.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_TARGET_CFLAGS) -c -o $@ $<
 
 fshelp_mod-fs_fshelp.d: fs/fshelp.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -M $<      | sed 's,fshelp\.o[ :]*,fshelp_mod-fs_fshelp.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_TARGET_CFLAGS) -M $<          | sed 's,fshelp\.o[ :]*,fshelp_mod-fs_fshelp.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include fshelp_mod-fs_fshelp.d
 
@@ -71,10 +71,10 @@ COMMANDFILES += cmd-fshelp_mod-fs_fshelp.lst
 FSFILES += fs-fshelp_mod-fs_fshelp.lst
 
 cmd-fshelp_mod-fs_fshelp.lst: fs/fshelp.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh fshelp > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh fshelp > $@ || (rm -f $@; exit 1)
 
 fs-fshelp_mod-fs_fshelp.lst: fs/fshelp.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh fshelp > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh fshelp > $@ || (rm -f $@; exit 1)
 
 
 fshelp_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -92,15 +92,15 @@ UNDSYMFILES += und-fat.lst
 
 fat.mod: pre-fat.o mod-fat.o
        -rm -f $@
-       $(CC) $(fat_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-fat.o: fat_mod-fs_fat.o
        -rm -f $@
-       $(CC) $(fat_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-fat.o: mod-fat.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $<
 
 mod-fat.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'fat' $< > $@ || (rm -f $@; exit 1)
@@ -115,10 +115,10 @@ und-fat.lst: pre-fat.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 fat_mod-fs_fat.o: fs/fat.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_TARGET_CFLAGS) -c -o $@ $<
 
 fat_mod-fs_fat.d: fs/fat.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -M $<         | sed 's,fat\.o[ :]*,fat_mod-fs_fat.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_TARGET_CFLAGS) -M $<     | sed 's,fat\.o[ :]*,fat_mod-fs_fat.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include fat_mod-fs_fat.d
 
@@ -127,10 +127,10 @@ COMMANDFILES += cmd-fat_mod-fs_fat.lst
 FSFILES += fs-fat_mod-fs_fat.lst
 
 cmd-fat_mod-fs_fat.lst: fs/fat.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh fat > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh fat > $@ || (rm -f $@; exit 1)
 
 fs-fat_mod-fs_fat.lst: fs/fat.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh fat > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh fat > $@ || (rm -f $@; exit 1)
 
 
 fat_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -148,15 +148,15 @@ UNDSYMFILES += und-ufs.lst
 
 ufs.mod: pre-ufs.o mod-ufs.o
        -rm -f $@
-       $(CC) $(ufs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-ufs.o: ufs_mod-fs_ufs.o
        -rm -f $@
-       $(CC) $(ufs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-ufs.o: mod-ufs.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -c -o $@ $<
 
 mod-ufs.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'ufs' $< > $@ || (rm -f $@; exit 1)
@@ -171,10 +171,10 @@ und-ufs.lst: pre-ufs.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 ufs_mod-fs_ufs.o: fs/ufs.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_TARGET_CFLAGS) -c -o $@ $<
 
 ufs_mod-fs_ufs.d: fs/ufs.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -M $<         | sed 's,ufs\.o[ :]*,ufs_mod-fs_ufs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_TARGET_CFLAGS) -M $<     | sed 's,ufs\.o[ :]*,ufs_mod-fs_ufs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include ufs_mod-fs_ufs.d
 
@@ -183,10 +183,10 @@ COMMANDFILES += cmd-ufs_mod-fs_ufs.lst
 FSFILES += fs-ufs_mod-fs_ufs.lst
 
 cmd-ufs_mod-fs_ufs.lst: fs/ufs.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh ufs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh ufs > $@ || (rm -f $@; exit 1)
 
 fs-ufs_mod-fs_ufs.lst: fs/ufs.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh ufs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh ufs > $@ || (rm -f $@; exit 1)
 
 
 ufs_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -204,15 +204,15 @@ UNDSYMFILES += und-ext2.lst
 
 ext2.mod: pre-ext2.o mod-ext2.o
        -rm -f $@
-       $(CC) $(ext2_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-ext2.o: ext2_mod-fs_ext2.o
        -rm -f $@
-       $(CC) $(ext2_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-ext2.o: mod-ext2.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $<
 
 mod-ext2.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'ext2' $< > $@ || (rm -f $@; exit 1)
@@ -227,10 +227,10 @@ und-ext2.lst: pre-ext2.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 ext2_mod-fs_ext2.o: fs/ext2.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_TARGET_CFLAGS) -c -o $@ $<
 
 ext2_mod-fs_ext2.d: fs/ext2.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -M $<        | sed 's,ext2\.o[ :]*,ext2_mod-fs_ext2.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_TARGET_CFLAGS) -M $<    | sed 's,ext2\.o[ :]*,ext2_mod-fs_ext2.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include ext2_mod-fs_ext2.d
 
@@ -239,10 +239,10 @@ COMMANDFILES += cmd-ext2_mod-fs_ext2.lst
 FSFILES += fs-ext2_mod-fs_ext2.lst
 
 cmd-ext2_mod-fs_ext2.lst: fs/ext2.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh ext2 > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh ext2 > $@ || (rm -f $@; exit 1)
 
 fs-ext2_mod-fs_ext2.lst: fs/ext2.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh ext2 > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh ext2 > $@ || (rm -f $@; exit 1)
 
 
 ext2_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -260,15 +260,15 @@ UNDSYMFILES += und-minix.lst
 
 minix.mod: pre-minix.o mod-minix.o
        -rm -f $@
-       $(CC) $(minix_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-minix.o: minix_mod-fs_minix.o
        -rm -f $@
-       $(CC) $(minix_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-minix.o: mod-minix.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -c -o $@ $<
 
 mod-minix.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'minix' $< > $@ || (rm -f $@; exit 1)
@@ -283,10 +283,10 @@ und-minix.lst: pre-minix.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 minix_mod-fs_minix.o: fs/minix.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_TARGET_CFLAGS) -c -o $@ $<
 
 minix_mod-fs_minix.d: fs/minix.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -M $<       | sed 's,minix\.o[ :]*,minix_mod-fs_minix.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_TARGET_CFLAGS) -M $<           | sed 's,minix\.o[ :]*,minix_mod-fs_minix.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include minix_mod-fs_minix.d
 
@@ -295,10 +295,10 @@ COMMANDFILES += cmd-minix_mod-fs_minix.lst
 FSFILES += fs-minix_mod-fs_minix.lst
 
 cmd-minix_mod-fs_minix.lst: fs/minix.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh minix > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh minix > $@ || (rm -f $@; exit 1)
 
 fs-minix_mod-fs_minix.lst: fs/minix.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh minix > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh minix > $@ || (rm -f $@; exit 1)
 
 
 minix_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -316,15 +316,15 @@ UNDSYMFILES += und-hfs.lst
 
 hfs.mod: pre-hfs.o mod-hfs.o
        -rm -f $@
-       $(CC) $(hfs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-hfs.o: hfs_mod-fs_hfs.o
        -rm -f $@
-       $(CC) $(hfs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-hfs.o: mod-hfs.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -c -o $@ $<
 
 mod-hfs.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'hfs' $< > $@ || (rm -f $@; exit 1)
@@ -339,10 +339,10 @@ und-hfs.lst: pre-hfs.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 hfs_mod-fs_hfs.o: fs/hfs.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_TARGET_CFLAGS) -c -o $@ $<
 
 hfs_mod-fs_hfs.d: fs/hfs.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -M $<         | sed 's,hfs\.o[ :]*,hfs_mod-fs_hfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_TARGET_CFLAGS) -M $<     | sed 's,hfs\.o[ :]*,hfs_mod-fs_hfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include hfs_mod-fs_hfs.d
 
@@ -351,10 +351,10 @@ COMMANDFILES += cmd-hfs_mod-fs_hfs.lst
 FSFILES += fs-hfs_mod-fs_hfs.lst
 
 cmd-hfs_mod-fs_hfs.lst: fs/hfs.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh hfs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh hfs > $@ || (rm -f $@; exit 1)
 
 fs-hfs_mod-fs_hfs.lst: fs/hfs.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh hfs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh hfs > $@ || (rm -f $@; exit 1)
 
 
 hfs_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -372,15 +372,15 @@ UNDSYMFILES += und-jfs.lst
 
 jfs.mod: pre-jfs.o mod-jfs.o
        -rm -f $@
-       $(CC) $(jfs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-jfs.o: jfs_mod-fs_jfs.o
        -rm -f $@
-       $(CC) $(jfs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-jfs.o: mod-jfs.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -c -o $@ $<
 
 mod-jfs.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'jfs' $< > $@ || (rm -f $@; exit 1)
@@ -395,10 +395,10 @@ und-jfs.lst: pre-jfs.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 jfs_mod-fs_jfs.o: fs/jfs.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_TARGET_CFLAGS) -c -o $@ $<
 
 jfs_mod-fs_jfs.d: fs/jfs.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -M $<         | sed 's,jfs\.o[ :]*,jfs_mod-fs_jfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_TARGET_CFLAGS) -M $<     | sed 's,jfs\.o[ :]*,jfs_mod-fs_jfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include jfs_mod-fs_jfs.d
 
@@ -407,10 +407,10 @@ COMMANDFILES += cmd-jfs_mod-fs_jfs.lst
 FSFILES += fs-jfs_mod-fs_jfs.lst
 
 cmd-jfs_mod-fs_jfs.lst: fs/jfs.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh jfs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh jfs > $@ || (rm -f $@; exit 1)
 
 fs-jfs_mod-fs_jfs.lst: fs/jfs.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh jfs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh jfs > $@ || (rm -f $@; exit 1)
 
 
 jfs_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -428,15 +428,15 @@ UNDSYMFILES += und-iso9660.lst
 
 iso9660.mod: pre-iso9660.o mod-iso9660.o
        -rm -f $@
-       $(CC) $(iso9660_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(iso9660_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-iso9660.o: iso9660_mod-fs_iso9660.o
        -rm -f $@
-       $(CC) $(iso9660_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(iso9660_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-iso9660.o: mod-iso9660.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(iso9660_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -c -o $@ $<
 
 mod-iso9660.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'iso9660' $< > $@ || (rm -f $@; exit 1)
@@ -451,10 +451,10 @@ und-iso9660.lst: pre-iso9660.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 iso9660_mod-fs_iso9660.o: fs/iso9660.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(iso9660_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_TARGET_CFLAGS) -c -o $@ $<
 
 iso9660_mod-fs_iso9660.d: fs/iso9660.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(iso9660_mod_CFLAGS) -M $<     | sed 's,iso9660\.o[ :]*,iso9660_mod-fs_iso9660.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_TARGET_CFLAGS) -M $<         | sed 's,iso9660\.o[ :]*,iso9660_mod-fs_iso9660.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
 
 -include iso9660_mod-fs_iso9660.d
 
@@ -463,10 +463,10 @@ COMMANDFILES += cmd-iso9660_mod-fs_iso9660.lst
 FSFILES += fs-iso9660_mod-fs_iso9660.lst
 
 cmd-iso9660_mod-fs_iso9660.lst: fs/iso9660.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(iso9660_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh iso9660 > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh iso9660 > $@ || (rm -f $@; exit 1)
 
 fs-iso9660_mod-fs_iso9660.lst: fs/iso9660.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(iso9660_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh iso9660 > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh iso9660 > $@ || (rm -f $@; exit 1)
 
 
 iso9660_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -484,15 +484,15 @@ UNDSYMFILES += und-xfs.lst
 
 xfs.mod: pre-xfs.o mod-xfs.o
        -rm -f $@
-       $(CC) $(xfs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-xfs.o: xfs_mod-fs_xfs.o
        -rm -f $@
-       $(CC) $(xfs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-xfs.o: mod-xfs.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -c -o $@ $<
 
 mod-xfs.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'xfs' $< > $@ || (rm -f $@; exit 1)
@@ -507,10 +507,10 @@ und-xfs.lst: pre-xfs.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 xfs_mod-fs_xfs.o: fs/xfs.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_TARGET_CFLAGS) -c -o $@ $<
 
 xfs_mod-fs_xfs.d: fs/xfs.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -M $<         | sed 's,xfs\.o[ :]*,xfs_mod-fs_xfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_TARGET_CFLAGS) -M $<     | sed 's,xfs\.o[ :]*,xfs_mod-fs_xfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include xfs_mod-fs_xfs.d
 
@@ -519,10 +519,10 @@ COMMANDFILES += cmd-xfs_mod-fs_xfs.lst
 FSFILES += fs-xfs_mod-fs_xfs.lst
 
 cmd-xfs_mod-fs_xfs.lst: fs/xfs.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh xfs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh xfs > $@ || (rm -f $@; exit 1)
 
 fs-xfs_mod-fs_xfs.lst: fs/xfs.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh xfs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh xfs > $@ || (rm -f $@; exit 1)
 
 
 xfs_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -540,15 +540,15 @@ UNDSYMFILES += und-affs.lst
 
 affs.mod: pre-affs.o mod-affs.o
        -rm -f $@
-       $(CC) $(affs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-affs.o: affs_mod-fs_affs.o
        -rm -f $@
-       $(CC) $(affs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-affs.o: mod-affs.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -c -o $@ $<
 
 mod-affs.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'affs' $< > $@ || (rm -f $@; exit 1)
@@ -563,10 +563,10 @@ und-affs.lst: pre-affs.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 affs_mod-fs_affs.o: fs/affs.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_TARGET_CFLAGS) -c -o $@ $<
 
 affs_mod-fs_affs.d: fs/affs.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -M $<        | sed 's,affs\.o[ :]*,affs_mod-fs_affs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_TARGET_CFLAGS) -M $<    | sed 's,affs\.o[ :]*,affs_mod-fs_affs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include affs_mod-fs_affs.d
 
@@ -575,10 +575,10 @@ COMMANDFILES += cmd-affs_mod-fs_affs.lst
 FSFILES += fs-affs_mod-fs_affs.lst
 
 cmd-affs_mod-fs_affs.lst: fs/affs.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh affs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh affs > $@ || (rm -f $@; exit 1)
 
 fs-affs_mod-fs_affs.lst: fs/affs.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh affs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh affs > $@ || (rm -f $@; exit 1)
 
 
 affs_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -596,15 +596,15 @@ UNDSYMFILES += und-sfs.lst
 
 sfs.mod: pre-sfs.o mod-sfs.o
        -rm -f $@
-       $(CC) $(sfs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-sfs.o: sfs_mod-fs_sfs.o
        -rm -f $@
-       $(CC) $(sfs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-sfs.o: mod-sfs.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -c -o $@ $<
 
 mod-sfs.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'sfs' $< > $@ || (rm -f $@; exit 1)
@@ -619,10 +619,10 @@ und-sfs.lst: pre-sfs.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 sfs_mod-fs_sfs.o: fs/sfs.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_TARGET_CFLAGS) -c -o $@ $<
 
 sfs_mod-fs_sfs.d: fs/sfs.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -M $<         | sed 's,sfs\.o[ :]*,sfs_mod-fs_sfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_TARGET_CFLAGS) -M $<     | sed 's,sfs\.o[ :]*,sfs_mod-fs_sfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include sfs_mod-fs_sfs.d
 
@@ -631,10 +631,10 @@ COMMANDFILES += cmd-sfs_mod-fs_sfs.lst
 FSFILES += fs-sfs_mod-fs_sfs.lst
 
 cmd-sfs_mod-fs_sfs.lst: fs/sfs.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh sfs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh sfs > $@ || (rm -f $@; exit 1)
 
 fs-sfs_mod-fs_sfs.lst: fs/sfs.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh sfs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh sfs > $@ || (rm -f $@; exit 1)
 
 
 sfs_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -652,15 +652,15 @@ UNDSYMFILES += und-hfsplus.lst
 
 hfsplus.mod: pre-hfsplus.o mod-hfsplus.o
        -rm -f $@
-       $(CC) $(hfsplus_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(hfsplus_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-hfsplus.o: hfsplus_mod-fs_hfsplus.o
        -rm -f $@
-       $(CC) $(hfsplus_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(hfsplus_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-hfsplus.o: mod-hfsplus.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(hfsplus_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -c -o $@ $<
 
 mod-hfsplus.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'hfsplus' $< > $@ || (rm -f $@; exit 1)
@@ -675,10 +675,10 @@ und-hfsplus.lst: pre-hfsplus.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 hfsplus_mod-fs_hfsplus.o: fs/hfsplus.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfsplus_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_TARGET_CFLAGS) -c -o $@ $<
 
 hfsplus_mod-fs_hfsplus.d: fs/hfsplus.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfsplus_mod_CFLAGS) -M $<     | sed 's,hfsplus\.o[ :]*,hfsplus_mod-fs_hfsplus.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_TARGET_CFLAGS) -M $<         | sed 's,hfsplus\.o[ :]*,hfsplus_mod-fs_hfsplus.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
 
 -include hfsplus_mod-fs_hfsplus.d
 
@@ -687,10 +687,10 @@ COMMANDFILES += cmd-hfsplus_mod-fs_hfsplus.lst
 FSFILES += fs-hfsplus_mod-fs_hfsplus.lst
 
 cmd-hfsplus_mod-fs_hfsplus.lst: fs/hfsplus.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfsplus_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh hfsplus > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh hfsplus > $@ || (rm -f $@; exit 1)
 
 fs-hfsplus_mod-fs_hfsplus.lst: fs/hfsplus.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfsplus_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh hfsplus > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh hfsplus > $@ || (rm -f $@; exit 1)
 
 
 hfsplus_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -711,15 +711,15 @@ UNDSYMFILES += und-amiga.lst
 
 amiga.mod: pre-amiga.o mod-amiga.o
        -rm -f $@
-       $(CC) $(amiga_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-amiga.o: amiga_mod-partmap_amiga.o
        -rm -f $@
-       $(CC) $(amiga_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-amiga.o: mod-amiga.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -c -o $@ $<
 
 mod-amiga.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'amiga' $< > $@ || (rm -f $@; exit 1)
@@ -734,10 +734,10 @@ und-amiga.lst: pre-amiga.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 amiga_mod-partmap_amiga.o: partmap/amiga.c
-       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_TARGET_CFLAGS) -c -o $@ $<
 
 amiga_mod-partmap_amiga.d: partmap/amiga.c
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -M $<     | sed 's,amiga\.o[ :]*,amiga_mod-partmap_amiga.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_TARGET_CFLAGS) -M $<         | sed 's,amiga\.o[ :]*,amiga_mod-partmap_amiga.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include amiga_mod-partmap_amiga.d
 
@@ -746,10 +746,10 @@ COMMANDFILES += cmd-amiga_mod-partmap_amiga.lst
 FSFILES += fs-amiga_mod-partmap_amiga.lst
 
 cmd-amiga_mod-partmap_amiga.lst: partmap/amiga.c gencmdlist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh amiga > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh amiga > $@ || (rm -f $@; exit 1)
 
 fs-amiga_mod-partmap_amiga.lst: partmap/amiga.c genfslist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh amiga > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh amiga > $@ || (rm -f $@; exit 1)
 
 
 amiga_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -767,15 +767,15 @@ UNDSYMFILES += und-apple.lst
 
 apple.mod: pre-apple.o mod-apple.o
        -rm -f $@
-       $(CC) $(apple_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-apple.o: apple_mod-partmap_apple.o
        -rm -f $@
-       $(CC) $(apple_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-apple.o: mod-apple.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -c -o $@ $<
 
 mod-apple.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'apple' $< > $@ || (rm -f $@; exit 1)
@@ -790,10 +790,10 @@ und-apple.lst: pre-apple.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 apple_mod-partmap_apple.o: partmap/apple.c
-       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_TARGET_CFLAGS) -c -o $@ $<
 
 apple_mod-partmap_apple.d: partmap/apple.c
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -M $<     | sed 's,apple\.o[ :]*,apple_mod-partmap_apple.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_TARGET_CFLAGS) -M $<         | sed 's,apple\.o[ :]*,apple_mod-partmap_apple.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include apple_mod-partmap_apple.d
 
@@ -802,10 +802,10 @@ COMMANDFILES += cmd-apple_mod-partmap_apple.lst
 FSFILES += fs-apple_mod-partmap_apple.lst
 
 cmd-apple_mod-partmap_apple.lst: partmap/apple.c gencmdlist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh apple > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh apple > $@ || (rm -f $@; exit 1)
 
 fs-apple_mod-partmap_apple.lst: partmap/apple.c genfslist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh apple > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh apple > $@ || (rm -f $@; exit 1)
 
 
 apple_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -823,15 +823,15 @@ UNDSYMFILES += und-pc.lst
 
 pc.mod: pre-pc.o mod-pc.o
        -rm -f $@
-       $(CC) $(pc_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-pc.o: pc_mod-partmap_pc.o
        -rm -f $@
-       $(CC) $(pc_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-pc.o: mod-pc.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -c -o $@ $<
 
 mod-pc.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'pc' $< > $@ || (rm -f $@; exit 1)
@@ -846,10 +846,10 @@ und-pc.lst: pre-pc.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 pc_mod-partmap_pc.o: partmap/pc.c
-       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_TARGET_CFLAGS) -c -o $@ $<
 
 pc_mod-partmap_pc.d: partmap/pc.c
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -M $<        | sed 's,pc\.o[ :]*,pc_mod-partmap_pc.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_TARGET_CFLAGS) -M $<    | sed 's,pc\.o[ :]*,pc_mod-partmap_pc.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include pc_mod-partmap_pc.d
 
@@ -858,10 +858,10 @@ COMMANDFILES += cmd-pc_mod-partmap_pc.lst
 FSFILES += fs-pc_mod-partmap_pc.lst
 
 cmd-pc_mod-partmap_pc.lst: partmap/pc.c gencmdlist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh pc > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh pc > $@ || (rm -f $@; exit 1)
 
 fs-pc_mod-partmap_pc.lst: partmap/pc.c genfslist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh pc > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh pc > $@ || (rm -f $@; exit 1)
 
 
 pc_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -879,15 +879,15 @@ UNDSYMFILES += und-sun.lst
 
 sun.mod: pre-sun.o mod-sun.o
        -rm -f $@
-       $(CC) $(sun_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-sun.o: sun_mod-partmap_sun.o
        -rm -f $@
-       $(CC) $(sun_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-sun.o: mod-sun.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -c -o $@ $<
 
 mod-sun.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'sun' $< > $@ || (rm -f $@; exit 1)
@@ -902,10 +902,10 @@ und-sun.lst: pre-sun.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 sun_mod-partmap_sun.o: partmap/sun.c
-       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_TARGET_CFLAGS) -c -o $@ $<
 
 sun_mod-partmap_sun.d: partmap/sun.c
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -M $<       | sed 's,sun\.o[ :]*,sun_mod-partmap_sun.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_TARGET_CFLAGS) -M $<           | sed 's,sun\.o[ :]*,sun_mod-partmap_sun.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include sun_mod-partmap_sun.d
 
@@ -914,10 +914,10 @@ COMMANDFILES += cmd-sun_mod-partmap_sun.lst
 FSFILES += fs-sun_mod-partmap_sun.lst
 
 cmd-sun_mod-partmap_sun.lst: partmap/sun.c gencmdlist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh sun > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh sun > $@ || (rm -f $@; exit 1)
 
 fs-sun_mod-partmap_sun.lst: partmap/sun.c genfslist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh sun > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh sun > $@ || (rm -f $@; exit 1)
 
 
 sun_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -935,15 +935,15 @@ UNDSYMFILES += und-acorn.lst
 
 acorn.mod: pre-acorn.o mod-acorn.o
        -rm -f $@
-       $(CC) $(acorn_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-acorn.o: acorn_mod-partmap_acorn.o
        -rm -f $@
-       $(CC) $(acorn_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-acorn.o: mod-acorn.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -c -o $@ $<
 
 mod-acorn.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'acorn' $< > $@ || (rm -f $@; exit 1)
@@ -958,10 +958,10 @@ und-acorn.lst: pre-acorn.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 acorn_mod-partmap_acorn.o: partmap/acorn.c
-       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_TARGET_CFLAGS) -c -o $@ $<
 
 acorn_mod-partmap_acorn.d: partmap/acorn.c
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -M $<     | sed 's,acorn\.o[ :]*,acorn_mod-partmap_acorn.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_TARGET_CFLAGS) -M $<         | sed 's,acorn\.o[ :]*,acorn_mod-partmap_acorn.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include acorn_mod-partmap_acorn.d
 
@@ -970,10 +970,10 @@ COMMANDFILES += cmd-acorn_mod-partmap_acorn.lst
 FSFILES += fs-acorn_mod-partmap_acorn.lst
 
 cmd-acorn_mod-partmap_acorn.lst: partmap/acorn.c gencmdlist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh acorn > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh acorn > $@ || (rm -f $@; exit 1)
 
 fs-acorn_mod-partmap_acorn.lst: partmap/acorn.c genfslist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh acorn > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh acorn > $@ || (rm -f $@; exit 1)
 
 
 acorn_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -991,15 +991,15 @@ UNDSYMFILES += und-gpt.lst
 
 gpt.mod: pre-gpt.o mod-gpt.o
        -rm -f $@
-       $(CC) $(gpt_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(gpt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-gpt.o: gpt_mod-partmap_gpt.o
        -rm -f $@
-       $(CC) $(gpt_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(gpt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-gpt.o: mod-gpt.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(gpt_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -c -o $@ $<
 
 mod-gpt.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'gpt' $< > $@ || (rm -f $@; exit 1)
@@ -1014,10 +1014,10 @@ und-gpt.lst: pre-gpt.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 gpt_mod-partmap_gpt.o: partmap/gpt.c
-       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(gpt_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_TARGET_CFLAGS) -c -o $@ $<
 
 gpt_mod-partmap_gpt.d: partmap/gpt.c
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(gpt_mod_CFLAGS) -M $<       | sed 's,gpt\.o[ :]*,gpt_mod-partmap_gpt.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_TARGET_CFLAGS) -M $<           | sed 's,gpt\.o[ :]*,gpt_mod-partmap_gpt.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include gpt_mod-partmap_gpt.d
 
@@ -1026,10 +1026,10 @@ COMMANDFILES += cmd-gpt_mod-partmap_gpt.lst
 FSFILES += fs-gpt_mod-partmap_gpt.lst
 
 cmd-gpt_mod-partmap_gpt.lst: partmap/gpt.c gencmdlist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(gpt_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh gpt > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh gpt > $@ || (rm -f $@; exit 1)
 
 fs-gpt_mod-partmap_gpt.lst: partmap/gpt.c genfslist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(gpt_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh gpt > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh gpt > $@ || (rm -f $@; exit 1)
 
 
 gpt_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1054,15 +1054,15 @@ UNDSYMFILES += und-hello.lst
 
 hello.mod: pre-hello.o mod-hello.o
        -rm -f $@
-       $(CC) $(hello_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-hello.o: hello_mod-hello_hello.o
        -rm -f $@
-       $(CC) $(hello_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-hello.o: mod-hello.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $<
 
 mod-hello.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'hello' $< > $@ || (rm -f $@; exit 1)
@@ -1077,10 +1077,10 @@ und-hello.lst: pre-hello.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 hello_mod-hello_hello.o: hello/hello.c
-       $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_TARGET_CFLAGS) -c -o $@ $<
 
 hello_mod-hello_hello.d: hello/hello.c
-       set -e;           $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -M $<         | sed 's,hello\.o[ :]*,hello_mod-hello_hello.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_TARGET_CFLAGS) -M $<     | sed 's,hello\.o[ :]*,hello_mod-hello_hello.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include hello_mod-hello_hello.d
 
@@ -1089,10 +1089,10 @@ COMMANDFILES += cmd-hello_mod-hello_hello.lst
 FSFILES += fs-hello_mod-hello_hello.lst
 
 cmd-hello_mod-hello_hello.lst: hello/hello.c gencmdlist.sh
-       set -e;           $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh hello > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh hello > $@ || (rm -f $@; exit 1)
 
 fs-hello_mod-hello_hello.lst: hello/hello.c genfslist.sh
-       set -e;           $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh hello > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh hello > $@ || (rm -f $@; exit 1)
 
 
 hello_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1110,15 +1110,15 @@ UNDSYMFILES += und-boot.lst
 
 boot.mod: pre-boot.o mod-boot.o
        -rm -f $@
-       $(CC) $(boot_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-boot.o: boot_mod-commands_boot.o
        -rm -f $@
-       $(CC) $(boot_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-boot.o: mod-boot.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $<
 
 mod-boot.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'boot' $< > $@ || (rm -f $@; exit 1)
@@ -1133,10 +1133,10 @@ und-boot.lst: pre-boot.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 boot_mod-commands_boot.o: commands/boot.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_TARGET_CFLAGS) -c -o $@ $<
 
 boot_mod-commands_boot.d: commands/boot.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -M $<    | sed 's,boot\.o[ :]*,boot_mod-commands_boot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_TARGET_CFLAGS) -M $<        | sed 's,boot\.o[ :]*,boot_mod-commands_boot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include boot_mod-commands_boot.d
 
@@ -1145,10 +1145,10 @@ COMMANDFILES += cmd-boot_mod-commands_boot.lst
 FSFILES += fs-boot_mod-commands_boot.lst
 
 cmd-boot_mod-commands_boot.lst: commands/boot.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh boot > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh boot > $@ || (rm -f $@; exit 1)
 
 fs-boot_mod-commands_boot.lst: commands/boot.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh boot > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh boot > $@ || (rm -f $@; exit 1)
 
 
 boot_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1166,15 +1166,15 @@ UNDSYMFILES += und-terminal.lst
 
 terminal.mod: pre-terminal.o mod-terminal.o
        -rm -f $@
-       $(CC) $(terminal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-terminal.o: terminal_mod-commands_terminal.o
        -rm -f $@
-       $(CC) $(terminal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-terminal.o: mod-terminal.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $<
 
 mod-terminal.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'terminal' $< > $@ || (rm -f $@; exit 1)
@@ -1189,10 +1189,10 @@ und-terminal.lst: pre-terminal.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 terminal_mod-commands_terminal.o: commands/terminal.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 terminal_mod-commands_terminal.d: commands/terminal.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -M $<        | sed 's,terminal\.o[ :]*,terminal_mod-commands_terminal.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_TARGET_CFLAGS) -M $<    | sed 's,terminal\.o[ :]*,terminal_mod-commands_terminal.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include terminal_mod-commands_terminal.d
 
@@ -1201,10 +1201,10 @@ COMMANDFILES += cmd-terminal_mod-commands_terminal.lst
 FSFILES += fs-terminal_mod-commands_terminal.lst
 
 cmd-terminal_mod-commands_terminal.lst: commands/terminal.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh terminal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh terminal > $@ || (rm -f $@; exit 1)
 
 fs-terminal_mod-commands_terminal.lst: commands/terminal.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh terminal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh terminal > $@ || (rm -f $@; exit 1)
 
 
 terminal_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1222,15 +1222,15 @@ UNDSYMFILES += und-ls.lst
 
 ls.mod: pre-ls.o mod-ls.o
        -rm -f $@
-       $(CC) $(ls_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-ls.o: ls_mod-commands_ls.o
        -rm -f $@
-       $(CC) $(ls_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-ls.o: mod-ls.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $<
 
 mod-ls.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'ls' $< > $@ || (rm -f $@; exit 1)
@@ -1245,10 +1245,10 @@ und-ls.lst: pre-ls.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 ls_mod-commands_ls.o: commands/ls.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_TARGET_CFLAGS) -c -o $@ $<
 
 ls_mod-commands_ls.d: commands/ls.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -M $<      | sed 's,ls\.o[ :]*,ls_mod-commands_ls.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_TARGET_CFLAGS) -M $<          | sed 's,ls\.o[ :]*,ls_mod-commands_ls.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include ls_mod-commands_ls.d
 
@@ -1257,10 +1257,10 @@ COMMANDFILES += cmd-ls_mod-commands_ls.lst
 FSFILES += fs-ls_mod-commands_ls.lst
 
 cmd-ls_mod-commands_ls.lst: commands/ls.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh ls > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh ls > $@ || (rm -f $@; exit 1)
 
 fs-ls_mod-commands_ls.lst: commands/ls.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh ls > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh ls > $@ || (rm -f $@; exit 1)
 
 
 ls_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1278,15 +1278,15 @@ UNDSYMFILES += und-cmp.lst
 
 cmp.mod: pre-cmp.o mod-cmp.o
        -rm -f $@
-       $(CC) $(cmp_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-cmp.o: cmp_mod-commands_cmp.o
        -rm -f $@
-       $(CC) $(cmp_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-cmp.o: mod-cmp.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $<
 
 mod-cmp.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'cmp' $< > $@ || (rm -f $@; exit 1)
@@ -1301,10 +1301,10 @@ und-cmp.lst: pre-cmp.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 cmp_mod-commands_cmp.o: commands/cmp.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_TARGET_CFLAGS) -c -o $@ $<
 
 cmp_mod-commands_cmp.d: commands/cmp.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -M $<     | sed 's,cmp\.o[ :]*,cmp_mod-commands_cmp.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_TARGET_CFLAGS) -M $<         | sed 's,cmp\.o[ :]*,cmp_mod-commands_cmp.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include cmp_mod-commands_cmp.d
 
@@ -1313,10 +1313,10 @@ COMMANDFILES += cmd-cmp_mod-commands_cmp.lst
 FSFILES += fs-cmp_mod-commands_cmp.lst
 
 cmd-cmp_mod-commands_cmp.lst: commands/cmp.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh cmp > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh cmp > $@ || (rm -f $@; exit 1)
 
 fs-cmp_mod-commands_cmp.lst: commands/cmp.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh cmp > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh cmp > $@ || (rm -f $@; exit 1)
 
 
 cmp_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1334,15 +1334,15 @@ UNDSYMFILES += und-cat.lst
 
 cat.mod: pre-cat.o mod-cat.o
        -rm -f $@
-       $(CC) $(cat_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-cat.o: cat_mod-commands_cat.o
        -rm -f $@
-       $(CC) $(cat_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-cat.o: mod-cat.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $<
 
 mod-cat.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'cat' $< > $@ || (rm -f $@; exit 1)
@@ -1357,10 +1357,10 @@ und-cat.lst: pre-cat.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 cat_mod-commands_cat.o: commands/cat.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_TARGET_CFLAGS) -c -o $@ $<
 
 cat_mod-commands_cat.d: commands/cat.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -M $<     | sed 's,cat\.o[ :]*,cat_mod-commands_cat.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_TARGET_CFLAGS) -M $<         | sed 's,cat\.o[ :]*,cat_mod-commands_cat.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include cat_mod-commands_cat.d
 
@@ -1369,10 +1369,10 @@ COMMANDFILES += cmd-cat_mod-commands_cat.lst
 FSFILES += fs-cat_mod-commands_cat.lst
 
 cmd-cat_mod-commands_cat.lst: commands/cat.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh cat > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh cat > $@ || (rm -f $@; exit 1)
 
 fs-cat_mod-commands_cat.lst: commands/cat.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh cat > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh cat > $@ || (rm -f $@; exit 1)
 
 
 cat_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1390,15 +1390,15 @@ UNDSYMFILES += und-help.lst
 
 help.mod: pre-help.o mod-help.o
        -rm -f $@
-       $(CC) $(help_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-help.o: help_mod-commands_help.o
        -rm -f $@
-       $(CC) $(help_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-help.o: mod-help.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -c -o $@ $<
 
 mod-help.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'help' $< > $@ || (rm -f $@; exit 1)
@@ -1413,10 +1413,10 @@ und-help.lst: pre-help.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 help_mod-commands_help.o: commands/help.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_TARGET_CFLAGS) -c -o $@ $<
 
 help_mod-commands_help.d: commands/help.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -M $<    | sed 's,help\.o[ :]*,help_mod-commands_help.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_TARGET_CFLAGS) -M $<        | sed 's,help\.o[ :]*,help_mod-commands_help.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include help_mod-commands_help.d
 
@@ -1425,10 +1425,10 @@ COMMANDFILES += cmd-help_mod-commands_help.lst
 FSFILES += fs-help_mod-commands_help.lst
 
 cmd-help_mod-commands_help.lst: commands/help.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh help > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh help > $@ || (rm -f $@; exit 1)
 
 fs-help_mod-commands_help.lst: commands/help.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh help > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh help > $@ || (rm -f $@; exit 1)
 
 
 help_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1446,15 +1446,15 @@ UNDSYMFILES += und-font.lst
 
 font.mod: pre-font.o mod-font.o
        -rm -f $@
-       $(CC) $(font_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-font.o: font_mod-font_manager.o
        -rm -f $@
-       $(CC) $(font_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-font.o: mod-font.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -c -o $@ $<
 
 mod-font.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'font' $< > $@ || (rm -f $@; exit 1)
@@ -1469,10 +1469,10 @@ und-font.lst: pre-font.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 font_mod-font_manager.o: font/manager.c
-       $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_TARGET_CFLAGS) -c -o $@ $<
 
 font_mod-font_manager.d: font/manager.c
-       set -e;           $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -M $<    | sed 's,manager\.o[ :]*,font_mod-font_manager.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_TARGET_CFLAGS) -M $<        | sed 's,manager\.o[ :]*,font_mod-font_manager.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include font_mod-font_manager.d
 
@@ -1481,10 +1481,10 @@ COMMANDFILES += cmd-font_mod-font_manager.lst
 FSFILES += fs-font_mod-font_manager.lst
 
 cmd-font_mod-font_manager.lst: font/manager.c gencmdlist.sh
-       set -e;           $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1)
 
 fs-font_mod-font_manager.lst: font/manager.c genfslist.sh
-       set -e;           $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1)
 
 
 font_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1502,15 +1502,15 @@ UNDSYMFILES += und-search.lst
 
 search.mod: pre-search.o mod-search.o
        -rm -f $@
-       $(CC) $(search_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-search.o: search_mod-commands_search.o
        -rm -f $@
-       $(CC) $(search_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-search.o: mod-search.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -c -o $@ $<
 
 mod-search.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'search' $< > $@ || (rm -f $@; exit 1)
@@ -1525,10 +1525,10 @@ und-search.lst: pre-search.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 search_mod-commands_search.o: commands/search.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_TARGET_CFLAGS) -c -o $@ $<
 
 search_mod-commands_search.d: commands/search.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -M $<          | sed 's,search\.o[ :]*,search_mod-commands_search.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_TARGET_CFLAGS) -M $<      | sed 's,search\.o[ :]*,search_mod-commands_search.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include search_mod-commands_search.d
 
@@ -1537,10 +1537,10 @@ COMMANDFILES += cmd-search_mod-commands_search.lst
 FSFILES += fs-search_mod-commands_search.lst
 
 cmd-search_mod-commands_search.lst: commands/search.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh search > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh search > $@ || (rm -f $@; exit 1)
 
 fs-search_mod-commands_search.lst: commands/search.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh search > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh search > $@ || (rm -f $@; exit 1)
 
 
 search_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1558,15 +1558,15 @@ UNDSYMFILES += und-test.lst
 
 test.mod: pre-test.o mod-test.o
        -rm -f $@
-       $(CC) $(test_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(test_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-test.o: test_mod-commands_test.o
        -rm -f $@
-       $(CC) $(test_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(test_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-test.o: mod-test.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -c -o $@ $<
 
 mod-test.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'test' $< > $@ || (rm -f $@; exit 1)
@@ -1581,10 +1581,10 @@ und-test.lst: pre-test.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 test_mod-commands_test.o: commands/test.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_TARGET_CFLAGS) -c -o $@ $<
 
 test_mod-commands_test.d: commands/test.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -M $<    | sed 's,test\.o[ :]*,test_mod-commands_test.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_TARGET_CFLAGS) -M $<        | sed 's,test\.o[ :]*,test_mod-commands_test.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include test_mod-commands_test.d
 
@@ -1593,10 +1593,10 @@ COMMANDFILES += cmd-test_mod-commands_test.lst
 FSFILES += fs-test_mod-commands_test.lst
 
 cmd-test_mod-commands_test.lst: commands/test.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh test > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh test > $@ || (rm -f $@; exit 1)
 
 fs-test_mod-commands_test.lst: commands/test.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(test_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh test > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh test > $@ || (rm -f $@; exit 1)
 
 
 test_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1614,15 +1614,15 @@ UNDSYMFILES += und-loopback.lst
 
 loopback.mod: pre-loopback.o mod-loopback.o
        -rm -f $@
-       $(CC) $(loopback_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-loopback.o: loopback_mod-disk_loopback.o
        -rm -f $@
-       $(CC) $(loopback_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-loopback.o: mod-loopback.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -c -o $@ $<
 
 mod-loopback.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'loopback' $< > $@ || (rm -f $@; exit 1)
@@ -1637,10 +1637,10 @@ und-loopback.lst: pre-loopback.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 loopback_mod-disk_loopback.o: disk/loopback.c
-       $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_TARGET_CFLAGS) -c -o $@ $<
 
 loopback_mod-disk_loopback.d: disk/loopback.c
-       set -e;           $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -M $<        | sed 's,loopback\.o[ :]*,loopback_mod-disk_loopback.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_TARGET_CFLAGS) -M $<    | sed 's,loopback\.o[ :]*,loopback_mod-disk_loopback.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include loopback_mod-disk_loopback.d
 
@@ -1649,10 +1649,10 @@ COMMANDFILES += cmd-loopback_mod-disk_loopback.lst
 FSFILES += fs-loopback_mod-disk_loopback.lst
 
 cmd-loopback_mod-disk_loopback.lst: disk/loopback.c gencmdlist.sh
-       set -e;           $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh loopback > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh loopback > $@ || (rm -f $@; exit 1)
 
 fs-loopback_mod-disk_loopback.lst: disk/loopback.c genfslist.sh
-       set -e;           $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh loopback > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh loopback > $@ || (rm -f $@; exit 1)
 
 
 loopback_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1670,15 +1670,15 @@ UNDSYMFILES += und-configfile.lst
 
 configfile.mod: pre-configfile.o mod-configfile.o
        -rm -f $@
-       $(CC) $(configfile_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-configfile.o: configfile_mod-commands_configfile.o
        -rm -f $@
-       $(CC) $(configfile_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-configfile.o: mod-configfile.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -c -o $@ $<
 
 mod-configfile.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'configfile' $< > $@ || (rm -f $@; exit 1)
@@ -1693,10 +1693,10 @@ und-configfile.lst: pre-configfile.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 configfile_mod-commands_configfile.o: commands/configfile.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_TARGET_CFLAGS) -c -o $@ $<
 
 configfile_mod-commands_configfile.d: commands/configfile.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -M $<      | sed 's,configfile\.o[ :]*,configfile_mod-commands_configfile.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_TARGET_CFLAGS) -M $<          | sed 's,configfile\.o[ :]*,configfile_mod-commands_configfile.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include configfile_mod-commands_configfile.d
 
@@ -1705,10 +1705,10 @@ COMMANDFILES += cmd-configfile_mod-commands_configfile.lst
 FSFILES += fs-configfile_mod-commands_configfile.lst
 
 cmd-configfile_mod-commands_configfile.lst: commands/configfile.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh configfile > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh configfile > $@ || (rm -f $@; exit 1)
 
 fs-configfile_mod-commands_configfile.lst: commands/configfile.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh configfile > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh configfile > $@ || (rm -f $@; exit 1)
 
 
 configfile_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1726,15 +1726,15 @@ UNDSYMFILES += und-terminfo.lst
 
 terminfo.mod: pre-terminfo.o mod-terminfo.o
        -rm -f $@
-       $(CC) $(terminfo_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(terminfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-terminfo.o: terminfo_mod-term_terminfo.o terminfo_mod-term_tparm.o
        -rm -f $@
-       $(CC) $(terminfo_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(terminfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-terminfo.o: mod-terminfo.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -c -o $@ $<
 
 mod-terminfo.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'terminfo' $< > $@ || (rm -f $@; exit 1)
@@ -1749,10 +1749,10 @@ und-terminfo.lst: pre-terminfo.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 terminfo_mod-term_terminfo.o: term/terminfo.c
-       $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_TARGET_CFLAGS) -c -o $@ $<
 
 terminfo_mod-term_terminfo.d: term/terminfo.c
-       set -e;           $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -M $<        | sed 's,terminfo\.o[ :]*,terminfo_mod-term_terminfo.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_TARGET_CFLAGS) -M $<    | sed 's,terminfo\.o[ :]*,terminfo_mod-term_terminfo.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include terminfo_mod-term_terminfo.d
 
@@ -1761,17 +1761,17 @@ COMMANDFILES += cmd-terminfo_mod-term_terminfo.lst
 FSFILES += fs-terminfo_mod-term_terminfo.lst
 
 cmd-terminfo_mod-term_terminfo.lst: term/terminfo.c gencmdlist.sh
-       set -e;           $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1)
 
 fs-terminfo_mod-term_terminfo.lst: term/terminfo.c genfslist.sh
-       set -e;           $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1)
 
 
 terminfo_mod-term_tparm.o: term/tparm.c
-       $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_TARGET_CFLAGS) -c -o $@ $<
 
 terminfo_mod-term_tparm.d: term/tparm.c
-       set -e;           $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -M $<        | sed 's,tparm\.o[ :]*,terminfo_mod-term_tparm.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_TARGET_CFLAGS) -M $<    | sed 's,tparm\.o[ :]*,terminfo_mod-term_tparm.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include terminfo_mod-term_tparm.d
 
@@ -1780,10 +1780,10 @@ COMMANDFILES += cmd-terminfo_mod-term_tparm.lst
 FSFILES += fs-terminfo_mod-term_tparm.lst
 
 cmd-terminfo_mod-term_tparm.lst: term/tparm.c gencmdlist.sh
-       set -e;           $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1)
 
 fs-terminfo_mod-term_tparm.lst: term/tparm.c genfslist.sh
-       set -e;           $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(terminfo_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1)
 
 
 terminfo_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1801,15 +1801,15 @@ UNDSYMFILES += und-blocklist.lst
 
 blocklist.mod: pre-blocklist.o mod-blocklist.o
        -rm -f $@
-       $(CC) $(blocklist_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(blocklist_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-blocklist.o: blocklist_mod-commands_blocklist.o
        -rm -f $@
-       $(CC) $(blocklist_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(blocklist_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-blocklist.o: mod-blocklist.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(blocklist_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -c -o $@ $<
 
 mod-blocklist.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'blocklist' $< > $@ || (rm -f $@; exit 1)
@@ -1824,10 +1824,10 @@ und-blocklist.lst: pre-blocklist.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 blocklist_mod-commands_blocklist.o: commands/blocklist.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(blocklist_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_TARGET_CFLAGS) -c -o $@ $<
 
 blocklist_mod-commands_blocklist.d: commands/blocklist.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(blocklist_mod_CFLAGS) -M $<       | sed 's,blocklist\.o[ :]*,blocklist_mod-commands_blocklist.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_TARGET_CFLAGS) -M $<           | sed 's,blocklist\.o[ :]*,blocklist_mod-commands_blocklist.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include blocklist_mod-commands_blocklist.d
 
@@ -1836,10 +1836,10 @@ COMMANDFILES += cmd-blocklist_mod-commands_blocklist.lst
 FSFILES += fs-blocklist_mod-commands_blocklist.lst
 
 cmd-blocklist_mod-commands_blocklist.lst: commands/blocklist.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(blocklist_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh blocklist > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh blocklist > $@ || (rm -f $@; exit 1)
 
 fs-blocklist_mod-commands_blocklist.lst: commands/blocklist.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(blocklist_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh blocklist > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh blocklist > $@ || (rm -f $@; exit 1)
 
 
 blocklist_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1860,15 +1860,15 @@ UNDSYMFILES += und-gzio.lst
 
 gzio.mod: pre-gzio.o mod-gzio.o
        -rm -f $@
-       $(CC) $(gzio_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-gzio.o: gzio_mod-io_gzio.o
        -rm -f $@
-       $(CC) $(gzio_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-gzio.o: mod-gzio.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -c -o $@ $<
 
 mod-gzio.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'gzio' $< > $@ || (rm -f $@; exit 1)
@@ -1883,10 +1883,10 @@ und-gzio.lst: pre-gzio.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 gzio_mod-io_gzio.o: io/gzio.c
-       $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_TARGET_CFLAGS) -c -o $@ $<
 
 gzio_mod-io_gzio.d: io/gzio.c
-       set -e;           $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -M $<        | sed 's,gzio\.o[ :]*,gzio_mod-io_gzio.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_TARGET_CFLAGS) -M $<    | sed 's,gzio\.o[ :]*,gzio_mod-io_gzio.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include gzio_mod-io_gzio.d
 
@@ -1895,10 +1895,10 @@ COMMANDFILES += cmd-gzio_mod-io_gzio.lst
 FSFILES += fs-gzio_mod-io_gzio.lst
 
 cmd-gzio_mod-io_gzio.lst: io/gzio.c gencmdlist.sh
-       set -e;           $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh gzio > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh gzio > $@ || (rm -f $@; exit 1)
 
 fs-gzio_mod-io_gzio.lst: io/gzio.c genfslist.sh
-       set -e;           $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh gzio > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh gzio > $@ || (rm -f $@; exit 1)
 
 
 gzio_mod_CFLAGS = $(COMMON_CFLAGS)
index b673d42dd9e6fa346f45cac51666a81efd2fe6d8..752e4b38cf71466660ae01239f67b183c993f089 100644 (file)
@@ -7,7 +7,6 @@ COMMON_LDFLAGS = -melf_i386 -nostdlib
 # Utilities.
 bin_UTILITIES = grub-mkimage
 #sbin_UTILITIES = grub-setup grub-emu grub-mkdevicemap grub-probefs
-noinst_UTILITIES = genmoddep
 
 # For grub-mkimage.
 grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \
@@ -16,29 +15,29 @@ CLEANFILES += grub-mkimage grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimag
 MOSTLYCLEANFILES += grub_mkimage-util_i386_efi_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d
 
 grub-mkimage: grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o
-       $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_mkimage_LDFLAGS)
+       $(CC) -o $@ $^ $(LDFLAGS) $(grub_mkimage_LDFLAGS)
 
 grub_mkimage-util_i386_efi_grub_mkimage.o: util/i386/efi/grub-mkimage.c
-       $(BUILD_CC) -Iutil/i386/efi -I$(srcdir)/util/i386/efi $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil/i386/efi -I$(srcdir)/util/i386/efi $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
 
 grub_mkimage-util_i386_efi_grub_mkimage.d: util/i386/efi/grub-mkimage.c
-       set -e;           $(BUILD_CC) -Iutil/i386/efi -I$(srcdir)/util/i386/efi $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<      | sed 's,grub\-mkimage\.o[ :]*,grub_mkimage-util_i386_efi_grub_mkimage.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil/i386/efi -I$(srcdir)/util/i386/efi $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<        | sed 's,grub\-mkimage\.o[ :]*,grub_mkimage-util_i386_efi_grub_mkimage.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_mkimage-util_i386_efi_grub_mkimage.d
 
 grub_mkimage-util_misc.o: util/misc.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
 
 grub_mkimage-util_misc.d: util/misc.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<        | sed 's,misc\.o[ :]*,grub_mkimage-util_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_mkimage-util_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_mkimage-util_misc.d
 
 grub_mkimage-util_resolve.o: util/resolve.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
 
 grub_mkimage-util_resolve.d: util/resolve.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<        | sed 's,resolve\.o[ :]*,grub_mkimage-util_resolve.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<          | sed 's,resolve\.o[ :]*,grub_mkimage-util_resolve.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_mkimage-util_resolve.d
 
@@ -87,23 +86,6 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c     \
 
 grub_emu_LDFLAGS = $(LIBCURSES)
 
-# For genmoddep.
-genmoddep_SOURCES = util/genmoddep.c
-CLEANFILES += genmoddep genmoddep-util_genmoddep.o
-MOSTLYCLEANFILES += genmoddep-util_genmoddep.d
-
-genmoddep: genmoddep-util_genmoddep.o
-       $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(genmoddep_LDFLAGS)
-
-genmoddep-util_genmoddep.o: util/genmoddep.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(genmoddep_CFLAGS) -c -o $@ $<
-
-genmoddep-util_genmoddep.d: util/genmoddep.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(genmoddep_CFLAGS) -M $<           | sed 's,genmoddep\.o[ :]*,genmoddep-util_genmoddep.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-
--include genmoddep-util_genmoddep.d
-
-
 # Scripts.
 #sbin_SCRIPTS = grub-install
 
@@ -132,15 +114,15 @@ UNDSYMFILES += und-kernel.lst
 
 kernel.mod: pre-kernel.o mod-kernel.o
        -rm -f $@
-       $(CC) $(kernel_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-kernel.o: kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o
        -rm -f $@
-       $(CC) $(kernel_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-kernel.o: mod-kernel.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
 
 mod-kernel.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'kernel' $< > $@ || (rm -f $@; exit 1)
@@ -155,10 +137,10 @@ und-kernel.lst: pre-kernel.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 kernel_mod-kern_i386_efi_startup.o: kern/i386/efi/startup.S
-       $(CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(CPPFLAGS) $(ASFLAGS) $(kernel_mod_ASFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_TARGET_ASFLAGS) -c -o $@ $<
 
 kernel_mod-kern_i386_efi_startup.d: kern/i386/efi/startup.S
-       set -e;           $(CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(CPPFLAGS) $(ASFLAGS) $(kernel_mod_ASFLAGS) -M $<      | sed 's,startup\.o[ :]*,kernel_mod-kern_i386_efi_startup.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_TARGET_ASFLAGS) -M $<          | sed 's,startup\.o[ :]*,kernel_mod-kern_i386_efi_startup.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_i386_efi_startup.d
 
@@ -167,17 +149,17 @@ COMMANDFILES += cmd-kernel_mod-kern_i386_efi_startup.lst
 FSFILES += fs-kernel_mod-kern_i386_efi_startup.lst
 
 cmd-kernel_mod-kern_i386_efi_startup.lst: kern/i386/efi/startup.S gencmdlist.sh
-       set -e;           $(CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(CPPFLAGS) $(ASFLAGS) $(kernel_mod_ASFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_TARGET_ASFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_i386_efi_startup.lst: kern/i386/efi/startup.S genfslist.sh
-       set -e;           $(CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(CPPFLAGS) $(ASFLAGS) $(kernel_mod_ASFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_TARGET_ASFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_main.o: kern/main.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_main.d: kern/main.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,main\.o[ :]*,kernel_mod-kern_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,main\.o[ :]*,kernel_mod-kern_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_main.d
 
@@ -186,17 +168,17 @@ COMMANDFILES += cmd-kernel_mod-kern_main.lst
 FSFILES += fs-kernel_mod-kern_main.lst
 
 cmd-kernel_mod-kern_main.lst: kern/main.c gencmdlist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_main.lst: kern/main.c genfslist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_device.o: kern/device.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_device.d: kern/device.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,device\.o[ :]*,kernel_mod-kern_device.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,device\.o[ :]*,kernel_mod-kern_device.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_device.d
 
@@ -205,17 +187,17 @@ COMMANDFILES += cmd-kernel_mod-kern_device.lst
 FSFILES += fs-kernel_mod-kern_device.lst
 
 cmd-kernel_mod-kern_device.lst: kern/device.c gencmdlist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_device.lst: kern/device.c genfslist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_disk.o: kern/disk.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_disk.d: kern/disk.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,disk\.o[ :]*,kernel_mod-kern_disk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,disk\.o[ :]*,kernel_mod-kern_disk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_disk.d
 
@@ -224,17 +206,17 @@ COMMANDFILES += cmd-kernel_mod-kern_disk.lst
 FSFILES += fs-kernel_mod-kern_disk.lst
 
 cmd-kernel_mod-kern_disk.lst: kern/disk.c gencmdlist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_disk.lst: kern/disk.c genfslist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_dl.o: kern/dl.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_dl.d: kern/dl.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,dl\.o[ :]*,kernel_mod-kern_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,dl\.o[ :]*,kernel_mod-kern_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_dl.d
 
@@ -243,17 +225,17 @@ COMMANDFILES += cmd-kernel_mod-kern_dl.lst
 FSFILES += fs-kernel_mod-kern_dl.lst
 
 cmd-kernel_mod-kern_dl.lst: kern/dl.c gencmdlist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_dl.lst: kern/dl.c genfslist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_file.o: kern/file.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_file.d: kern/file.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,file\.o[ :]*,kernel_mod-kern_file.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,file\.o[ :]*,kernel_mod-kern_file.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_file.d
 
@@ -262,17 +244,17 @@ COMMANDFILES += cmd-kernel_mod-kern_file.lst
 FSFILES += fs-kernel_mod-kern_file.lst
 
 cmd-kernel_mod-kern_file.lst: kern/file.c gencmdlist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_file.lst: kern/file.c genfslist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_fs.o: kern/fs.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_fs.d: kern/fs.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,fs\.o[ :]*,kernel_mod-kern_fs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,fs\.o[ :]*,kernel_mod-kern_fs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_fs.d
 
@@ -281,17 +263,17 @@ COMMANDFILES += cmd-kernel_mod-kern_fs.lst
 FSFILES += fs-kernel_mod-kern_fs.lst
 
 cmd-kernel_mod-kern_fs.lst: kern/fs.c gencmdlist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_fs.lst: kern/fs.c genfslist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_err.o: kern/err.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_err.d: kern/err.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,err\.o[ :]*,kernel_mod-kern_err.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,err\.o[ :]*,kernel_mod-kern_err.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_err.d
 
@@ -300,17 +282,17 @@ COMMANDFILES += cmd-kernel_mod-kern_err.lst
 FSFILES += fs-kernel_mod-kern_err.lst
 
 cmd-kernel_mod-kern_err.lst: kern/err.c gencmdlist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_err.lst: kern/err.c genfslist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_misc.o: kern/misc.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_misc.d: kern/misc.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,kernel_mod-kern_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,kernel_mod-kern_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_misc.d
 
@@ -319,17 +301,17 @@ COMMANDFILES += cmd-kernel_mod-kern_misc.lst
 FSFILES += fs-kernel_mod-kern_misc.lst
 
 cmd-kernel_mod-kern_misc.lst: kern/misc.c gencmdlist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_misc.lst: kern/misc.c genfslist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_mm.o: kern/mm.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_mm.d: kern/mm.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,mm\.o[ :]*,kernel_mod-kern_mm.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,mm\.o[ :]*,kernel_mod-kern_mm.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_mm.d
 
@@ -338,17 +320,17 @@ COMMANDFILES += cmd-kernel_mod-kern_mm.lst
 FSFILES += fs-kernel_mod-kern_mm.lst
 
 cmd-kernel_mod-kern_mm.lst: kern/mm.c gencmdlist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_mm.lst: kern/mm.c genfslist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_loader.o: kern/loader.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_loader.d: kern/loader.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,loader\.o[ :]*,kernel_mod-kern_loader.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,loader\.o[ :]*,kernel_mod-kern_loader.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_loader.d
 
@@ -357,17 +339,17 @@ COMMANDFILES += cmd-kernel_mod-kern_loader.lst
 FSFILES += fs-kernel_mod-kern_loader.lst
 
 cmd-kernel_mod-kern_loader.lst: kern/loader.c gencmdlist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_loader.lst: kern/loader.c genfslist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_rescue.o: kern/rescue.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_rescue.d: kern/rescue.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,rescue\.o[ :]*,kernel_mod-kern_rescue.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,rescue\.o[ :]*,kernel_mod-kern_rescue.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_rescue.d
 
@@ -376,17 +358,17 @@ COMMANDFILES += cmd-kernel_mod-kern_rescue.lst
 FSFILES += fs-kernel_mod-kern_rescue.lst
 
 cmd-kernel_mod-kern_rescue.lst: kern/rescue.c gencmdlist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_rescue.lst: kern/rescue.c genfslist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_term.o: kern/term.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_term.d: kern/term.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,term\.o[ :]*,kernel_mod-kern_term.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,term\.o[ :]*,kernel_mod-kern_term.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_term.d
 
@@ -395,17 +377,17 @@ COMMANDFILES += cmd-kernel_mod-kern_term.lst
 FSFILES += fs-kernel_mod-kern_term.lst
 
 cmd-kernel_mod-kern_term.lst: kern/term.c gencmdlist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_term.lst: kern/term.c genfslist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_i386_dl.o: kern/i386/dl.c
-       $(CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_i386_dl.d: kern/i386/dl.c
-       set -e;           $(CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<        | sed 's,dl\.o[ :]*,kernel_mod-kern_i386_dl.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<    | sed 's,dl\.o[ :]*,kernel_mod-kern_i386_dl.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_i386_dl.d
 
@@ -414,17 +396,17 @@ COMMANDFILES += cmd-kernel_mod-kern_i386_dl.lst
 FSFILES += fs-kernel_mod-kern_i386_dl.lst
 
 cmd-kernel_mod-kern_i386_dl.lst: kern/i386/dl.c gencmdlist.sh
-       set -e;           $(CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_i386_dl.lst: kern/i386/dl.c genfslist.sh
-       set -e;           $(CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_i386_efi_init.o: kern/i386/efi/init.c
-       $(CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_i386_efi_init.d: kern/i386/efi/init.c
-       set -e;           $(CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<        | sed 's,init\.o[ :]*,kernel_mod-kern_i386_efi_init.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<    | sed 's,init\.o[ :]*,kernel_mod-kern_i386_efi_init.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_i386_efi_init.d
 
@@ -433,17 +415,17 @@ COMMANDFILES += cmd-kernel_mod-kern_i386_efi_init.lst
 FSFILES += fs-kernel_mod-kern_i386_efi_init.lst
 
 cmd-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c gencmdlist.sh
-       set -e;           $(CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c genfslist.sh
-       set -e;           $(CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_parser.o: kern/parser.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_parser.d: kern/parser.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,parser\.o[ :]*,kernel_mod-kern_parser.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,parser\.o[ :]*,kernel_mod-kern_parser.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_parser.d
 
@@ -452,17 +434,17 @@ COMMANDFILES += cmd-kernel_mod-kern_parser.lst
 FSFILES += fs-kernel_mod-kern_parser.lst
 
 cmd-kernel_mod-kern_parser.lst: kern/parser.c gencmdlist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_parser.lst: kern/parser.c genfslist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_partition.o: kern/partition.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_partition.d: kern/partition.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,partition\.o[ :]*,kernel_mod-kern_partition.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,partition\.o[ :]*,kernel_mod-kern_partition.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_partition.d
 
@@ -471,17 +453,17 @@ COMMANDFILES += cmd-kernel_mod-kern_partition.lst
 FSFILES += fs-kernel_mod-kern_partition.lst
 
 cmd-kernel_mod-kern_partition.lst: kern/partition.c gencmdlist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_partition.lst: kern/partition.c genfslist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_env.o: kern/env.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_env.d: kern/env.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,env\.o[ :]*,kernel_mod-kern_env.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,env\.o[ :]*,kernel_mod-kern_env.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_env.d
 
@@ -490,17 +472,17 @@ COMMANDFILES += cmd-kernel_mod-kern_env.lst
 FSFILES += fs-kernel_mod-kern_env.lst
 
 cmd-kernel_mod-kern_env.lst: kern/env.c gencmdlist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_env.lst: kern/env.c genfslist.sh
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-symlist.o: symlist.c
-       $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-symlist.d: symlist.c
-       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<        | sed 's,symlist\.o[ :]*,kernel_mod-symlist.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<    | sed 's,symlist\.o[ :]*,kernel_mod-symlist.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include kernel_mod-symlist.d
 
@@ -509,17 +491,17 @@ COMMANDFILES += cmd-kernel_mod-symlist.lst
 FSFILES += fs-kernel_mod-symlist.lst
 
 cmd-kernel_mod-symlist.lst: symlist.c gencmdlist.sh
-       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-symlist.lst: symlist.c genfslist.sh
-       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_efi_efi.o: kern/efi/efi.c
-       $(CC) -Ikern/efi -I$(srcdir)/kern/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_efi_efi.d: kern/efi/efi.c
-       set -e;           $(CC) -Ikern/efi -I$(srcdir)/kern/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,efi\.o[ :]*,kernel_mod-kern_efi_efi.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,efi\.o[ :]*,kernel_mod-kern_efi_efi.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_efi_efi.d
 
@@ -528,17 +510,17 @@ COMMANDFILES += cmd-kernel_mod-kern_efi_efi.lst
 FSFILES += fs-kernel_mod-kern_efi_efi.lst
 
 cmd-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c gencmdlist.sh
-       set -e;           $(CC) -Ikern/efi -I$(srcdir)/kern/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c genfslist.sh
-       set -e;           $(CC) -Ikern/efi -I$(srcdir)/kern/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_efi_init.o: kern/efi/init.c
-       $(CC) -Ikern/efi -I$(srcdir)/kern/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_efi_init.d: kern/efi/init.c
-       set -e;           $(CC) -Ikern/efi -I$(srcdir)/kern/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,init\.o[ :]*,kernel_mod-kern_efi_init.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,init\.o[ :]*,kernel_mod-kern_efi_init.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_efi_init.d
 
@@ -547,17 +529,17 @@ COMMANDFILES += cmd-kernel_mod-kern_efi_init.lst
 FSFILES += fs-kernel_mod-kern_efi_init.lst
 
 cmd-kernel_mod-kern_efi_init.lst: kern/efi/init.c gencmdlist.sh
-       set -e;           $(CC) -Ikern/efi -I$(srcdir)/kern/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_efi_init.lst: kern/efi/init.c genfslist.sh
-       set -e;           $(CC) -Ikern/efi -I$(srcdir)/kern/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-kern_efi_mm.o: kern/efi/mm.c
-       $(CC) -Ikern/efi -I$(srcdir)/kern/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-kern_efi_mm.d: kern/efi/mm.c
-       set -e;           $(CC) -Ikern/efi -I$(srcdir)/kern/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,mm\.o[ :]*,kernel_mod-kern_efi_mm.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,mm\.o[ :]*,kernel_mod-kern_efi_mm.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_mod-kern_efi_mm.d
 
@@ -566,17 +548,17 @@ COMMANDFILES += cmd-kernel_mod-kern_efi_mm.lst
 FSFILES += fs-kernel_mod-kern_efi_mm.lst
 
 cmd-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c gencmdlist.sh
-       set -e;           $(CC) -Ikern/efi -I$(srcdir)/kern/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c genfslist.sh
-       set -e;           $(CC) -Ikern/efi -I$(srcdir)/kern/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-term_efi_console.o: term/efi/console.c
-       $(CC) -Iterm/efi -I$(srcdir)/term/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-term_efi_console.d: term/efi/console.c
-       set -e;           $(CC) -Iterm/efi -I$(srcdir)/term/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,console\.o[ :]*,kernel_mod-term_efi_console.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,console\.o[ :]*,kernel_mod-term_efi_console.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include kernel_mod-term_efi_console.d
 
@@ -585,17 +567,17 @@ COMMANDFILES += cmd-kernel_mod-term_efi_console.lst
 FSFILES += fs-kernel_mod-term_efi_console.lst
 
 cmd-kernel_mod-term_efi_console.lst: term/efi/console.c gencmdlist.sh
-       set -e;           $(CC) -Iterm/efi -I$(srcdir)/term/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-term_efi_console.lst: term/efi/console.c genfslist.sh
-       set -e;           $(CC) -Iterm/efi -I$(srcdir)/term/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod-disk_efi_efidisk.o: disk/efi/efidisk.c
-       $(CC) -Idisk/efi -I$(srcdir)/disk/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_mod-disk_efi_efidisk.d: disk/efi/efidisk.c
-       set -e;           $(CC) -Idisk/efi -I$(srcdir)/disk/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -M $<          | sed 's,efidisk\.o[ :]*,kernel_mod-disk_efi_efidisk.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -M $<      | sed 's,efidisk\.o[ :]*,kernel_mod-disk_efi_efidisk.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include kernel_mod-disk_efi_efidisk.d
 
@@ -604,10 +586,10 @@ COMMANDFILES += cmd-kernel_mod-disk_efi_efidisk.lst
 FSFILES += fs-kernel_mod-disk_efi_efidisk.lst
 
 cmd-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c gencmdlist.sh
-       set -e;           $(CC) -Idisk/efi -I$(srcdir)/disk/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1)
 
 fs-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c genfslist.sh
-       set -e;           $(CC) -Idisk/efi -I$(srcdir)/disk/efi $(CPPFLAGS) $(CFLAGS) $(kernel_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1)
 
 
 kernel_mod_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
@@ -644,15 +626,15 @@ UNDSYMFILES += und-normal.lst
 
 normal.mod: pre-normal.o mod-normal.o
        -rm -f $@
-       $(CC) $(normal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o
        -rm -f $@
-       $(CC) $(normal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-normal.o: mod-normal.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
 
 mod-normal.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1)
@@ -667,10 +649,10 @@ und-normal.lst: pre-normal.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 normal_mod-normal_arg.o: normal/arg.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_arg.d: normal/arg.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,arg\.o[ :]*,normal_mod-normal_arg.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,arg\.o[ :]*,normal_mod-normal_arg.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_arg.d
 
@@ -679,17 +661,17 @@ COMMANDFILES += cmd-normal_mod-normal_arg.lst
 FSFILES += fs-normal_mod-normal_arg.lst
 
 cmd-normal_mod-normal_arg.lst: normal/arg.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_arg.lst: normal/arg.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_cmdline.o: normal/cmdline.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_cmdline.d: normal/cmdline.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,cmdline\.o[ :]*,normal_mod-normal_cmdline.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,cmdline\.o[ :]*,normal_mod-normal_cmdline.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_cmdline.d
 
@@ -698,17 +680,17 @@ COMMANDFILES += cmd-normal_mod-normal_cmdline.lst
 FSFILES += fs-normal_mod-normal_cmdline.lst
 
 cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_cmdline.lst: normal/cmdline.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_command.o: normal/command.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_command.d: normal/command.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,command\.o[ :]*,normal_mod-normal_command.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,command\.o[ :]*,normal_mod-normal_command.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_command.d
 
@@ -717,17 +699,17 @@ COMMANDFILES += cmd-normal_mod-normal_command.lst
 FSFILES += fs-normal_mod-normal_command.lst
 
 cmd-normal_mod-normal_command.lst: normal/command.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_command.lst: normal/command.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_completion.o: normal/completion.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_completion.d: normal/completion.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,completion\.o[ :]*,normal_mod-normal_completion.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,completion\.o[ :]*,normal_mod-normal_completion.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_completion.d
 
@@ -736,17 +718,17 @@ COMMANDFILES += cmd-normal_mod-normal_completion.lst
 FSFILES += fs-normal_mod-normal_completion.lst
 
 cmd-normal_mod-normal_completion.lst: normal/completion.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_completion.lst: normal/completion.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_execute.o: normal/execute.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_execute.d: normal/execute.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,execute\.o[ :]*,normal_mod-normal_execute.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,execute\.o[ :]*,normal_mod-normal_execute.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_execute.d
 
@@ -755,17 +737,17 @@ COMMANDFILES += cmd-normal_mod-normal_execute.lst
 FSFILES += fs-normal_mod-normal_execute.lst
 
 cmd-normal_mod-normal_execute.lst: normal/execute.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_execute.lst: normal/execute.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_function.o: normal/function.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_function.d: normal/function.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,function\.o[ :]*,normal_mod-normal_function.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,function\.o[ :]*,normal_mod-normal_function.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_function.d
 
@@ -774,17 +756,17 @@ COMMANDFILES += cmd-normal_mod-normal_function.lst
 FSFILES += fs-normal_mod-normal_function.lst
 
 cmd-normal_mod-normal_function.lst: normal/function.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_function.lst: normal/function.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_lexer.o: normal/lexer.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_lexer.d: normal/lexer.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,lexer\.o[ :]*,normal_mod-normal_lexer.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,lexer\.o[ :]*,normal_mod-normal_lexer.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_lexer.d
 
@@ -793,17 +775,17 @@ COMMANDFILES += cmd-normal_mod-normal_lexer.lst
 FSFILES += fs-normal_mod-normal_lexer.lst
 
 cmd-normal_mod-normal_lexer.lst: normal/lexer.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_lexer.lst: normal/lexer.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_main.o: normal/main.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_main.d: normal/main.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,main\.o[ :]*,normal_mod-normal_main.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,main\.o[ :]*,normal_mod-normal_main.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_main.d
 
@@ -812,17 +794,17 @@ COMMANDFILES += cmd-normal_mod-normal_main.lst
 FSFILES += fs-normal_mod-normal_main.lst
 
 cmd-normal_mod-normal_main.lst: normal/main.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_main.lst: normal/main.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_menu.o: normal/menu.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_menu.d: normal/menu.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,menu\.o[ :]*,normal_mod-normal_menu.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,menu\.o[ :]*,normal_mod-normal_menu.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_menu.d
 
@@ -831,17 +813,17 @@ COMMANDFILES += cmd-normal_mod-normal_menu.lst
 FSFILES += fs-normal_mod-normal_menu.lst
 
 cmd-normal_mod-normal_menu.lst: normal/menu.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_menu.lst: normal/menu.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_menu_entry.o: normal/menu_entry.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_menu_entry.d: normal/menu_entry.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,menu_entry\.o[ :]*,normal_mod-normal_menu_entry.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,menu_entry\.o[ :]*,normal_mod-normal_menu_entry.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_menu_entry.d
 
@@ -850,17 +832,17 @@ COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst
 FSFILES += fs-normal_mod-normal_menu_entry.lst
 
 cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_misc.o: normal/misc.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_misc.d: normal/misc.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,normal_mod-normal_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,normal_mod-normal_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_misc.d
 
@@ -869,17 +851,17 @@ COMMANDFILES += cmd-normal_mod-normal_misc.lst
 FSFILES += fs-normal_mod-normal_misc.lst
 
 cmd-normal_mod-normal_misc.lst: normal/misc.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_misc.lst: normal/misc.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-grub_script_tab.o: grub_script.tab.c
-       $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-grub_script_tab.d: grub_script.tab.c
-       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<        | sed 's,grub_script\.tab\.o[ :]*,normal_mod-grub_script_tab.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<    | sed 's,grub_script\.tab\.o[ :]*,normal_mod-grub_script_tab.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-grub_script_tab.d
 
@@ -888,17 +870,17 @@ COMMANDFILES += cmd-normal_mod-grub_script_tab.lst
 FSFILES += fs-normal_mod-grub_script_tab.lst
 
 cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c gencmdlist.sh
-       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-grub_script_tab.lst: grub_script.tab.c genfslist.sh
-       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_script.o: normal/script.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_script.d: normal/script.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,script\.o[ :]*,normal_mod-normal_script.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,script\.o[ :]*,normal_mod-normal_script.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_script.d
 
@@ -907,17 +889,17 @@ COMMANDFILES += cmd-normal_mod-normal_script.lst
 FSFILES += fs-normal_mod-normal_script.lst
 
 cmd-normal_mod-normal_script.lst: normal/script.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_script.lst: normal/script.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S
-       $(CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_TARGET_ASFLAGS) -c -o $@ $<
 
 normal_mod-normal_i386_setjmp.d: normal/i386/setjmp.S
-       set -e;           $(CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -M $<          | sed 's,setjmp\.o[ :]*,normal_mod-normal_i386_setjmp.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_TARGET_ASFLAGS) -M $<      | sed 's,setjmp\.o[ :]*,normal_mod-normal_i386_setjmp.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_i386_setjmp.d
 
@@ -926,10 +908,10 @@ COMMANDFILES += cmd-normal_mod-normal_i386_setjmp.lst
 FSFILES += fs-normal_mod-normal_i386_setjmp.lst
 
 cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S gencmdlist.sh
-       set -e;           $(CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_TARGET_ASFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S genfslist.sh
-       set -e;           $(CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_TARGET_ASFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -948,15 +930,15 @@ UNDSYMFILES += und-_chain.lst
 
 _chain.mod: pre-_chain.o mod-_chain.o
        -rm -f $@
-       $(CC) $(_chain_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-_chain.o: _chain_mod-loader_efi_chainloader.o
        -rm -f $@
-       $(CC) $(_chain_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-_chain.o: mod-_chain.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $<
 
 mod-_chain.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh '_chain' $< > $@ || (rm -f $@; exit 1)
@@ -971,10 +953,10 @@ und-_chain.lst: pre-_chain.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 _chain_mod-loader_efi_chainloader.o: loader/efi/chainloader.c
-       $(CC) -Iloader/efi -I$(srcdir)/loader/efi $(CPPFLAGS) $(CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_TARGET_CFLAGS) -c -o $@ $<
 
 _chain_mod-loader_efi_chainloader.d: loader/efi/chainloader.c
-       set -e;           $(CC) -Iloader/efi -I$(srcdir)/loader/efi $(CPPFLAGS) $(CFLAGS) $(_chain_mod_CFLAGS) -M $<      | sed 's,chainloader\.o[ :]*,_chain_mod-loader_efi_chainloader.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_TARGET_CFLAGS) -M $<          | sed 's,chainloader\.o[ :]*,_chain_mod-loader_efi_chainloader.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include _chain_mod-loader_efi_chainloader.d
 
@@ -983,10 +965,10 @@ COMMANDFILES += cmd-_chain_mod-loader_efi_chainloader.lst
 FSFILES += fs-_chain_mod-loader_efi_chainloader.lst
 
 cmd-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c gencmdlist.sh
-       set -e;           $(CC) -Iloader/efi -I$(srcdir)/loader/efi $(CPPFLAGS) $(CFLAGS) $(_chain_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh _chain > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh _chain > $@ || (rm -f $@; exit 1)
 
 fs-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c genfslist.sh
-       set -e;           $(CC) -Iloader/efi -I$(srcdir)/loader/efi $(CPPFLAGS) $(CFLAGS) $(_chain_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh _chain > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh _chain > $@ || (rm -f $@; exit 1)
 
 
 _chain_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1004,15 +986,15 @@ UNDSYMFILES += und-chain.lst
 
 chain.mod: pre-chain.o mod-chain.o
        -rm -f $@
-       $(CC) $(chain_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-chain.o: chain_mod-loader_efi_chainloader_normal.o
        -rm -f $@
-       $(CC) $(chain_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-chain.o: mod-chain.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $<
 
 mod-chain.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'chain' $< > $@ || (rm -f $@; exit 1)
@@ -1027,10 +1009,10 @@ und-chain.lst: pre-chain.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 chain_mod-loader_efi_chainloader_normal.o: loader/efi/chainloader_normal.c
-       $(CC) -Iloader/efi -I$(srcdir)/loader/efi $(CPPFLAGS) $(CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_TARGET_CFLAGS) -c -o $@ $<
 
 chain_mod-loader_efi_chainloader_normal.d: loader/efi/chainloader_normal.c
-       set -e;           $(CC) -Iloader/efi -I$(srcdir)/loader/efi $(CPPFLAGS) $(CFLAGS) $(chain_mod_CFLAGS) -M $<       | sed 's,chainloader_normal\.o[ :]*,chain_mod-loader_efi_chainloader_normal.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_TARGET_CFLAGS) -M $<           | sed 's,chainloader_normal\.o[ :]*,chain_mod-loader_efi_chainloader_normal.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include chain_mod-loader_efi_chainloader_normal.d
 
@@ -1039,10 +1021,10 @@ COMMANDFILES += cmd-chain_mod-loader_efi_chainloader_normal.lst
 FSFILES += fs-chain_mod-loader_efi_chainloader_normal.lst
 
 cmd-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c gencmdlist.sh
-       set -e;           $(CC) -Iloader/efi -I$(srcdir)/loader/efi $(CPPFLAGS) $(CFLAGS) $(chain_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1)
 
 fs-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c genfslist.sh
-       set -e;           $(CC) -Iloader/efi -I$(srcdir)/loader/efi $(CPPFLAGS) $(CFLAGS) $(chain_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1)
 
 
 chain_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1060,15 +1042,15 @@ UNDSYMFILES += und-_linux.lst
 
 _linux.mod: pre-_linux.o mod-_linux.o
        -rm -f $@
-       $(CC) $(_linux_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-_linux.o: _linux_mod-loader_i386_efi_linux.o
        -rm -f $@
-       $(CC) $(_linux_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-_linux.o: mod-_linux.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
 
 mod-_linux.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1)
@@ -1083,10 +1065,10 @@ und-_linux.lst: pre-_linux.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 _linux_mod-loader_i386_efi_linux.o: loader/i386/efi/linux.c
-       $(CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_TARGET_CFLAGS) -c -o $@ $<
 
 _linux_mod-loader_i386_efi_linux.d: loader/i386/efi/linux.c
-       set -e;           $(CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -M $<    | sed 's,linux\.o[ :]*,_linux_mod-loader_i386_efi_linux.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_TARGET_CFLAGS) -M $<        | sed 's,linux\.o[ :]*,_linux_mod-loader_i386_efi_linux.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
 
 -include _linux_mod-loader_i386_efi_linux.d
 
@@ -1095,10 +1077,10 @@ COMMANDFILES += cmd-_linux_mod-loader_i386_efi_linux.lst
 FSFILES += fs-_linux_mod-loader_i386_efi_linux.lst
 
 cmd-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c gencmdlist.sh
-       set -e;           $(CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1)
 
 fs-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c genfslist.sh
-       set -e;           $(CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1)
 
 
 _linux_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1116,15 +1098,15 @@ UNDSYMFILES += und-linux.lst
 
 linux.mod: pre-linux.o mod-linux.o
        -rm -f $@
-       $(CC) $(linux_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-linux.o: linux_mod-loader_i386_efi_linux_normal.o
        -rm -f $@
-       $(CC) $(linux_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-linux.o: mod-linux.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
 
 mod-linux.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1)
@@ -1139,10 +1121,10 @@ und-linux.lst: pre-linux.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 linux_mod-loader_i386_efi_linux_normal.o: loader/i386/efi/linux_normal.c
-       $(CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_TARGET_CFLAGS) -c -o $@ $<
 
 linux_mod-loader_i386_efi_linux_normal.d: loader/i386/efi/linux_normal.c
-       set -e;           $(CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -M $<     | sed 's,linux_normal\.o[ :]*,linux_mod-loader_i386_efi_linux_normal.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_TARGET_CFLAGS) -M $<         | sed 's,linux_normal\.o[ :]*,linux_mod-loader_i386_efi_linux_normal.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include linux_mod-loader_i386_efi_linux_normal.d
 
@@ -1151,10 +1133,10 @@ COMMANDFILES += cmd-linux_mod-loader_i386_efi_linux_normal.lst
 FSFILES += fs-linux_mod-loader_i386_efi_linux_normal.lst
 
 cmd-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c gencmdlist.sh
-       set -e;           $(CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1)
 
 fs-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c genfslist.sh
-       set -e;           $(CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1)
 
 
 linux_mod_CFLAGS = $(COMMON_CFLAGS)
index 6e8e36199a844ad532be87ba3b2785e128005ca9..6b9c1b78409da364f829d3f880c6201cdb0e4539 100644 (file)
@@ -7,7 +7,6 @@ COMMON_LDFLAGS = -melf_i386 -nostdlib
 # Utilities.
 bin_UTILITIES = grub-mkimage
 #sbin_UTILITIES = grub-setup grub-emu grub-mkdevicemap grub-probefs
-noinst_UTILITIES = genmoddep
 
 # For grub-mkimage.
 grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \
@@ -57,9 +56,6 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c      \
 
 grub_emu_LDFLAGS = $(LIBCURSES)
 
-# For genmoddep.
-genmoddep_SOURCES = util/genmoddep.c
-
 # Scripts.
 #sbin_SCRIPTS = grub-install
 
index 077e24bb1a265d374402f12e4fabd6a404718cab..f29cdea84fc64914724f6462e95223477cfba95f 100644 (file)
@@ -16,13 +16,13 @@ boot.img: boot.exec
        $(OBJCOPY) -O binary -R .note -R .comment $< $@
 
 boot.exec: boot_img-boot_i386_pc_boot.o
-       $(CC) -o $@ $^ $(LDFLAGS) $(boot_img_LDFLAGS)
+       $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(boot_img_LDFLAGS)
 
 boot_img-boot_i386_pc_boot.o: boot/i386/pc/boot.S
-       $(CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(boot_img_ASFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(boot_img_TARGET_ASFLAGS) -c -o $@ $<
 
 boot_img-boot_i386_pc_boot.d: boot/i386/pc/boot.S
-       set -e;           $(CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(boot_img_ASFLAGS) -M $<     | sed 's,boot\.o[ :]*,boot_img-boot_i386_pc_boot.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(boot_img_TARGET_ASFLAGS) -M $<         | sed 's,boot\.o[ :]*,boot_img-boot_i386_pc_boot.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include boot_img-boot_i386_pc_boot.d
 
@@ -38,13 +38,13 @@ pxeboot.img: pxeboot.exec
        $(OBJCOPY) -O binary -R .note -R .comment $< $@
 
 pxeboot.exec: pxeboot_img-boot_i386_pc_pxeboot.o
-       $(CC) -o $@ $^ $(LDFLAGS) $(pxeboot_img_LDFLAGS)
+       $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(pxeboot_img_LDFLAGS)
 
 pxeboot_img-boot_i386_pc_pxeboot.o: boot/i386/pc/pxeboot.S
-       $(CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(pxeboot_img_ASFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(pxeboot_img_TARGET_ASFLAGS) -c -o $@ $<
 
 pxeboot_img-boot_i386_pc_pxeboot.d: boot/i386/pc/pxeboot.S
-       set -e;           $(CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(pxeboot_img_ASFLAGS) -M $<          | sed 's,pxeboot\.o[ :]*,pxeboot_img-boot_i386_pc_pxeboot.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(pxeboot_img_TARGET_ASFLAGS) -M $<      | sed 's,pxeboot\.o[ :]*,pxeboot_img-boot_i386_pc_pxeboot.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include pxeboot_img-boot_i386_pc_pxeboot.d
 
@@ -60,13 +60,13 @@ diskboot.img: diskboot.exec
        $(OBJCOPY) -O binary -R .note -R .comment $< $@
 
 diskboot.exec: diskboot_img-boot_i386_pc_diskboot.o
-       $(CC) -o $@ $^ $(LDFLAGS) $(diskboot_img_LDFLAGS)
+       $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(diskboot_img_LDFLAGS)
 
 diskboot_img-boot_i386_pc_diskboot.o: boot/i386/pc/diskboot.S
-       $(CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(diskboot_img_ASFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(diskboot_img_TARGET_ASFLAGS) -c -o $@ $<
 
 diskboot_img-boot_i386_pc_diskboot.d: boot/i386/pc/diskboot.S
-       set -e;           $(CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(diskboot_img_ASFLAGS) -M $<         | sed 's,diskboot\.o[ :]*,diskboot_img-boot_i386_pc_diskboot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(diskboot_img_TARGET_ASFLAGS) -M $<     | sed 's,diskboot\.o[ :]*,diskboot_img-boot_i386_pc_diskboot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include diskboot_img-boot_i386_pc_diskboot.d
 
@@ -88,173 +88,173 @@ kernel.img: kernel.exec
        $(OBJCOPY) -O binary -R .note -R .comment $< $@
 
 kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_env.o kernel_img-disk_i386_pc_biosdisk.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o
-       $(CC) -o $@ $^ $(LDFLAGS) $(kernel_img_LDFLAGS)
+       $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_img_LDFLAGS)
 
 kernel_img-kern_i386_pc_startup.o: kern/i386/pc/startup.S
-       $(CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(kernel_img_ASFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_img_TARGET_ASFLAGS) -c -o $@ $<
 
 kernel_img-kern_i386_pc_startup.d: kern/i386/pc/startup.S
-       set -e;           $(CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(kernel_img_ASFLAGS) -M $<           | sed 's,startup\.o[ :]*,kernel_img-kern_i386_pc_startup.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_img_TARGET_ASFLAGS) -M $<       | sed 's,startup\.o[ :]*,kernel_img-kern_i386_pc_startup.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include kernel_img-kern_i386_pc_startup.d
 
 kernel_img-kern_main.o: kern/main.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-kern_main.d: kern/main.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,main\.o[ :]*,kernel_img-kern_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<     | sed 's,main\.o[ :]*,kernel_img-kern_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_img-kern_main.d
 
 kernel_img-kern_device.o: kern/device.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-kern_device.d: kern/device.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,device\.o[ :]*,kernel_img-kern_device.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<     | sed 's,device\.o[ :]*,kernel_img-kern_device.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_img-kern_device.d
 
 kernel_img-kern_disk.o: kern/disk.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-kern_disk.d: kern/disk.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,disk\.o[ :]*,kernel_img-kern_disk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<     | sed 's,disk\.o[ :]*,kernel_img-kern_disk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_img-kern_disk.d
 
 kernel_img-kern_dl.o: kern/dl.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-kern_dl.d: kern/dl.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,dl\.o[ :]*,kernel_img-kern_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<     | sed 's,dl\.o[ :]*,kernel_img-kern_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_img-kern_dl.d
 
 kernel_img-kern_file.o: kern/file.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-kern_file.d: kern/file.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,file\.o[ :]*,kernel_img-kern_file.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<     | sed 's,file\.o[ :]*,kernel_img-kern_file.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_img-kern_file.d
 
 kernel_img-kern_fs.o: kern/fs.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-kern_fs.d: kern/fs.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,fs\.o[ :]*,kernel_img-kern_fs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<     | sed 's,fs\.o[ :]*,kernel_img-kern_fs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_img-kern_fs.d
 
 kernel_img-kern_err.o: kern/err.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-kern_err.d: kern/err.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,err\.o[ :]*,kernel_img-kern_err.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<     | sed 's,err\.o[ :]*,kernel_img-kern_err.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include kernel_img-kern_err.d
 
 kernel_img-kern_misc.o: kern/misc.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-kern_misc.d: kern/misc.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,misc\.o[ :]*,kernel_img-kern_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<     | sed 's,misc\.o[ :]*,kernel_img-kern_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_img-kern_misc.d
 
 kernel_img-kern_mm.o: kern/mm.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-kern_mm.d: kern/mm.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,mm\.o[ :]*,kernel_img-kern_mm.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<     | sed 's,mm\.o[ :]*,kernel_img-kern_mm.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_img-kern_mm.d
 
 kernel_img-kern_loader.o: kern/loader.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-kern_loader.d: kern/loader.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,loader\.o[ :]*,kernel_img-kern_loader.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<     | sed 's,loader\.o[ :]*,kernel_img-kern_loader.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_img-kern_loader.d
 
 kernel_img-kern_rescue.o: kern/rescue.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-kern_rescue.d: kern/rescue.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,rescue\.o[ :]*,kernel_img-kern_rescue.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<     | sed 's,rescue\.o[ :]*,kernel_img-kern_rescue.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_img-kern_rescue.d
 
 kernel_img-kern_term.o: kern/term.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-kern_term.d: kern/term.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,term\.o[ :]*,kernel_img-kern_term.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<     | sed 's,term\.o[ :]*,kernel_img-kern_term.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_img-kern_term.d
 
 kernel_img-kern_i386_dl.o: kern/i386/dl.c
-       $(CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-kern_i386_dl.d: kern/i386/dl.c
-       set -e;           $(CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<       | sed 's,dl\.o[ :]*,kernel_img-kern_i386_dl.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<           | sed 's,dl\.o[ :]*,kernel_img-kern_i386_dl.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include kernel_img-kern_i386_dl.d
 
 kernel_img-kern_i386_pc_init.o: kern/i386/pc/init.c
-       $(CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-kern_i386_pc_init.d: kern/i386/pc/init.c
-       set -e;           $(CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,init\.o[ :]*,kernel_img-kern_i386_pc_init.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<     | sed 's,init\.o[ :]*,kernel_img-kern_i386_pc_init.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_img-kern_i386_pc_init.d
 
 kernel_img-kern_parser.o: kern/parser.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-kern_parser.d: kern/parser.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,parser\.o[ :]*,kernel_img-kern_parser.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<     | sed 's,parser\.o[ :]*,kernel_img-kern_parser.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_img-kern_parser.d
 
 kernel_img-kern_partition.o: kern/partition.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-kern_partition.d: kern/partition.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,partition\.o[ :]*,kernel_img-kern_partition.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<     | sed 's,partition\.o[ :]*,kernel_img-kern_partition.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include kernel_img-kern_partition.d
 
 kernel_img-kern_env.o: kern/env.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-kern_env.d: kern/env.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,env\.o[ :]*,kernel_img-kern_env.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<     | sed 's,env\.o[ :]*,kernel_img-kern_env.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include kernel_img-kern_env.d
 
 kernel_img-disk_i386_pc_biosdisk.o: disk/i386/pc/biosdisk.c
-       $(CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-disk_i386_pc_biosdisk.d: disk/i386/pc/biosdisk.c
-       set -e;           $(CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,biosdisk\.o[ :]*,kernel_img-disk_i386_pc_biosdisk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<     | sed 's,biosdisk\.o[ :]*,kernel_img-disk_i386_pc_biosdisk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_img-disk_i386_pc_biosdisk.d
 
 kernel_img-term_i386_pc_console.o: term/i386/pc/console.c
-       $(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-term_i386_pc_console.d: term/i386/pc/console.c
-       set -e;           $(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<         | sed 's,console\.o[ :]*,kernel_img-term_i386_pc_console.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<     | sed 's,console\.o[ :]*,kernel_img-term_i386_pc_console.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include kernel_img-term_i386_pc_console.d
 
 kernel_img-symlist.o: symlist.c
-       $(CC) -I. -I$(srcdir)/. $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -c -o $@ $<
 
 kernel_img-symlist.d: symlist.c
-       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS)  $(CFLAGS) $(kernel_img_CFLAGS) -M $<       | sed 's,symlist\.o[ :]*,kernel_img-symlist.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS)  $(TARGET_CFLAGS) $(kernel_img_TARGET_CFLAGS) -M $<           | sed 's,symlist\.o[ :]*,kernel_img-symlist.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include kernel_img-symlist.d
 
@@ -280,7 +280,6 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genke
 # Utilities.
 bin_UTILITIES = grub-mkimage
 sbin_UTILITIES = grub-setup grub-emu grub-mkdevicemap grub-probefs
-noinst_UTILITIES = genmoddep
 
 # For grub-mkimage.
 grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \
@@ -289,29 +288,29 @@ CLEANFILES += grub-mkimage grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage
 MOSTLYCLEANFILES += grub_mkimage-util_i386_pc_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d
 
 grub-mkimage: grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o
-       $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_mkimage_LDFLAGS)
+       $(CC) -o $@ $^ $(LDFLAGS) $(grub_mkimage_LDFLAGS)
 
 grub_mkimage-util_i386_pc_grub_mkimage.o: util/i386/pc/grub-mkimage.c
-       $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
 
 grub_mkimage-util_i386_pc_grub_mkimage.d: util/i386/pc/grub-mkimage.c
-       set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<        | sed 's,grub\-mkimage\.o[ :]*,grub_mkimage-util_i386_pc_grub_mkimage.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<          | sed 's,grub\-mkimage\.o[ :]*,grub_mkimage-util_i386_pc_grub_mkimage.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include grub_mkimage-util_i386_pc_grub_mkimage.d
 
 grub_mkimage-util_misc.o: util/misc.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
 
 grub_mkimage-util_misc.d: util/misc.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<        | sed 's,misc\.o[ :]*,grub_mkimage-util_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_mkimage-util_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_mkimage-util_misc.d
 
 grub_mkimage-util_resolve.o: util/resolve.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
 
 grub_mkimage-util_resolve.d: util/resolve.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<        | sed 's,resolve\.o[ :]*,grub_mkimage-util_resolve.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<          | sed 's,resolve\.o[ :]*,grub_mkimage-util_resolve.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_mkimage-util_resolve.d
 
@@ -328,205 +327,205 @@ CLEANFILES += grub-setup grub_setup-util_i386_pc_grub_setup.o grub_setup-util_i3
 MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_i386_pc_biosdisk.d grub_setup-util_misc.d grub_setup-util_i386_pc_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-fs_fat.d grub_setup-fs_ext2.d grub_setup-fs_xfs.d grub_setup-fs_affs.d grub_setup-fs_sfs.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-partmap_pc.d grub_setup-fs_ufs.d grub_setup-fs_minix.d grub_setup-fs_hfs.d grub_setup-fs_jfs.d grub_setup-fs_hfsplus.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d
 
 grub-setup: grub_setup-util_i386_pc_grub_setup.o grub_setup-util_i386_pc_biosdisk.o grub_setup-util_misc.o grub_setup-util_i386_pc_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-fs_fat.o grub_setup-fs_ext2.o grub_setup-fs_xfs.o grub_setup-fs_affs.o grub_setup-fs_sfs.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-partmap_pc.o grub_setup-fs_ufs.o grub_setup-fs_minix.o grub_setup-fs_hfs.o grub_setup-fs_jfs.o grub_setup-fs_hfsplus.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o
-       $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_setup_LDFLAGS)
+       $(CC) -o $@ $^ $(LDFLAGS) $(grub_setup_LDFLAGS)
 
 grub_setup-util_i386_pc_grub_setup.o: util/i386/pc/grub-setup.c
-       $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-util_i386_pc_grub_setup.d: util/i386/pc/grub-setup.c
-       set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,grub\-setup\.o[ :]*,grub_setup-util_i386_pc_grub_setup.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,grub\-setup\.o[ :]*,grub_setup-util_i386_pc_grub_setup.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
 
 -include grub_setup-util_i386_pc_grub_setup.d
 
 grub_setup-util_i386_pc_biosdisk.o: util/i386/pc/biosdisk.c
-       $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-util_i386_pc_biosdisk.d: util/i386/pc/biosdisk.c
-       set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,biosdisk\.o[ :]*,grub_setup-util_i386_pc_biosdisk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,biosdisk\.o[ :]*,grub_setup-util_i386_pc_biosdisk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_setup-util_i386_pc_biosdisk.d
 
 grub_setup-util_misc.o: util/misc.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-util_misc.d: util/misc.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_setup-util_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_setup-util_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_setup-util_misc.d
 
 grub_setup-util_i386_pc_getroot.o: util/i386/pc/getroot.c
-       $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-util_i386_pc_getroot.d: util/i386/pc/getroot.c
-       set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,getroot\.o[ :]*,grub_setup-util_i386_pc_getroot.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,getroot\.o[ :]*,grub_setup-util_i386_pc_getroot.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_setup-util_i386_pc_getroot.d
 
 grub_setup-kern_device.o: kern/device.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-kern_device.d: kern/device.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,device\.o[ :]*,grub_setup-kern_device.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,device\.o[ :]*,grub_setup-kern_device.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_setup-kern_device.d
 
 grub_setup-kern_disk.o: kern/disk.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-kern_disk.d: kern/disk.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,disk\.o[ :]*,grub_setup-kern_disk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,disk\.o[ :]*,grub_setup-kern_disk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_setup-kern_disk.d
 
 grub_setup-kern_err.o: kern/err.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-kern_err.d: kern/err.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,err\.o[ :]*,grub_setup-kern_err.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,err\.o[ :]*,grub_setup-kern_err.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_setup-kern_err.d
 
 grub_setup-kern_misc.o: kern/misc.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-kern_misc.d: kern/misc.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_setup-kern_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_setup-kern_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_setup-kern_misc.d
 
 grub_setup-fs_fat.o: fs/fat.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-fs_fat.d: fs/fat.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,fat\.o[ :]*,grub_setup-fs_fat.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,fat\.o[ :]*,grub_setup-fs_fat.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_setup-fs_fat.d
 
 grub_setup-fs_ext2.o: fs/ext2.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-fs_ext2.d: fs/ext2.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,ext2\.o[ :]*,grub_setup-fs_ext2.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,ext2\.o[ :]*,grub_setup-fs_ext2.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_setup-fs_ext2.d
 
 grub_setup-fs_xfs.o: fs/xfs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-fs_xfs.d: fs/xfs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,xfs\.o[ :]*,grub_setup-fs_xfs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,xfs\.o[ :]*,grub_setup-fs_xfs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_setup-fs_xfs.d
 
 grub_setup-fs_affs.o: fs/affs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-fs_affs.d: fs/affs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,affs\.o[ :]*,grub_setup-fs_affs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,affs\.o[ :]*,grub_setup-fs_affs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_setup-fs_affs.d
 
 grub_setup-fs_sfs.o: fs/sfs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-fs_sfs.d: fs/sfs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,sfs\.o[ :]*,grub_setup-fs_sfs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,sfs\.o[ :]*,grub_setup-fs_sfs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_setup-fs_sfs.d
 
 grub_setup-kern_parser.o: kern/parser.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-kern_parser.d: kern/parser.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,parser\.o[ :]*,grub_setup-kern_parser.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,parser\.o[ :]*,grub_setup-kern_parser.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_setup-kern_parser.d
 
 grub_setup-kern_partition.o: kern/partition.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-kern_partition.d: kern/partition.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,partition\.o[ :]*,grub_setup-kern_partition.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,partition\.o[ :]*,grub_setup-kern_partition.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_setup-kern_partition.d
 
 grub_setup-partmap_pc.o: partmap/pc.c
-       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-partmap_pc.d: partmap/pc.c
-       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,pc\.o[ :]*,grub_setup-partmap_pc.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,pc\.o[ :]*,grub_setup-partmap_pc.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include grub_setup-partmap_pc.d
 
 grub_setup-fs_ufs.o: fs/ufs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-fs_ufs.d: fs/ufs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,ufs\.o[ :]*,grub_setup-fs_ufs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,ufs\.o[ :]*,grub_setup-fs_ufs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_setup-fs_ufs.d
 
 grub_setup-fs_minix.o: fs/minix.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-fs_minix.d: fs/minix.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,minix\.o[ :]*,grub_setup-fs_minix.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,minix\.o[ :]*,grub_setup-fs_minix.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_setup-fs_minix.d
 
 grub_setup-fs_hfs.o: fs/hfs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-fs_hfs.d: fs/hfs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,hfs\.o[ :]*,grub_setup-fs_hfs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,hfs\.o[ :]*,grub_setup-fs_hfs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_setup-fs_hfs.d
 
 grub_setup-fs_jfs.o: fs/jfs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-fs_jfs.d: fs/jfs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,jfs\.o[ :]*,grub_setup-fs_jfs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,jfs\.o[ :]*,grub_setup-fs_jfs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_setup-fs_jfs.d
 
 grub_setup-fs_hfsplus.o: fs/hfsplus.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-fs_hfsplus.d: fs/hfsplus.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,hfsplus\.o[ :]*,grub_setup-fs_hfsplus.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,hfsplus\.o[ :]*,grub_setup-fs_hfsplus.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_setup-fs_hfsplus.d
 
 grub_setup-kern_file.o: kern/file.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-kern_file.d: kern/file.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,file\.o[ :]*,grub_setup-kern_file.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,file\.o[ :]*,grub_setup-kern_file.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_setup-kern_file.d
 
 grub_setup-kern_fs.o: kern/fs.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-kern_fs.d: kern/fs.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,fs\.o[ :]*,grub_setup-kern_fs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,fs\.o[ :]*,grub_setup-kern_fs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_setup-kern_fs.d
 
 grub_setup-kern_env.o: kern/env.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-kern_env.d: kern/env.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<          | sed 's,env\.o[ :]*,grub_setup-kern_env.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<    | sed 's,env\.o[ :]*,grub_setup-kern_env.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_setup-kern_env.d
 
 grub_setup-fs_fshelp.o: fs/fshelp.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -c -o $@ $<
 
 grub_setup-fs_fshelp.d: fs/fshelp.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<      | sed 's,fshelp\.o[ :]*,grub_setup-fs_fshelp.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -M $<        | sed 's,fshelp\.o[ :]*,grub_setup-fs_fshelp.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_setup-fs_fshelp.d
 
@@ -537,21 +536,21 @@ CLEANFILES += grub-mkdevicemap grub_mkdevicemap-util_i386_pc_grub_mkdevicemap.o
 MOSTLYCLEANFILES += grub_mkdevicemap-util_i386_pc_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d
 
 grub-mkdevicemap: grub_mkdevicemap-util_i386_pc_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o
-       $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_mkdevicemap_LDFLAGS)
+       $(CC) -o $@ $^ $(LDFLAGS) $(grub_mkdevicemap_LDFLAGS)
 
 grub_mkdevicemap-util_i386_pc_grub_mkdevicemap.o: util/i386/pc/grub-mkdevicemap.c
-       $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -c -o $@ $<
 
 grub_mkdevicemap-util_i386_pc_grub_mkdevicemap.d: util/i386/pc/grub-mkdevicemap.c
-       set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -M $<    | sed 's,grub\-mkdevicemap\.o[ :]*,grub_mkdevicemap-util_i386_pc_grub_mkdevicemap.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -M $<      | sed 's,grub\-mkdevicemap\.o[ :]*,grub_mkdevicemap-util_i386_pc_grub_mkdevicemap.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include grub_mkdevicemap-util_i386_pc_grub_mkdevicemap.d
 
 grub_mkdevicemap-util_misc.o: util/misc.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -c -o $@ $<
 
 grub_mkdevicemap-util_misc.d: util/misc.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_mkdevicemap-util_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,grub_mkdevicemap-util_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_mkdevicemap-util_misc.d
 
@@ -567,197 +566,197 @@ CLEANFILES += grub-probefs grub_probefs-util_i386_pc_grub_probefs.o grub_probefs
 MOSTLYCLEANFILES += grub_probefs-util_i386_pc_grub_probefs.d grub_probefs-util_i386_pc_biosdisk.d grub_probefs-util_misc.d grub_probefs-util_i386_pc_getroot.d grub_probefs-kern_device.d grub_probefs-kern_disk.d grub_probefs-kern_err.d grub_probefs-kern_misc.d grub_probefs-fs_fat.d grub_probefs-fs_ext2.d grub_probefs-kern_parser.d grub_probefs-kern_partition.d grub_probefs-partmap_pc.d grub_probefs-fs_ufs.d grub_probefs-fs_minix.d grub_probefs-fs_hfs.d grub_probefs-fs_jfs.d grub_probefs-kern_fs.d grub_probefs-kern_env.d grub_probefs-fs_fshelp.d grub_probefs-fs_xfs.d grub_probefs-fs_affs.d grub_probefs-fs_sfs.d grub_probefs-fs_hfsplus.d
 
 grub-probefs: grub_probefs-util_i386_pc_grub_probefs.o grub_probefs-util_i386_pc_biosdisk.o grub_probefs-util_misc.o grub_probefs-util_i386_pc_getroot.o grub_probefs-kern_device.o grub_probefs-kern_disk.o grub_probefs-kern_err.o grub_probefs-kern_misc.o grub_probefs-fs_fat.o grub_probefs-fs_ext2.o grub_probefs-kern_parser.o grub_probefs-kern_partition.o grub_probefs-partmap_pc.o grub_probefs-fs_ufs.o grub_probefs-fs_minix.o grub_probefs-fs_hfs.o grub_probefs-fs_jfs.o grub_probefs-kern_fs.o grub_probefs-kern_env.o grub_probefs-fs_fshelp.o grub_probefs-fs_xfs.o grub_probefs-fs_affs.o grub_probefs-fs_sfs.o grub_probefs-fs_hfsplus.o
-       $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_probefs_LDFLAGS)
+       $(CC) -o $@ $^ $(LDFLAGS) $(grub_probefs_LDFLAGS)
 
 grub_probefs-util_i386_pc_grub_probefs.o: util/i386/pc/grub-probefs.c
-       $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-util_i386_pc_grub_probefs.d: util/i386/pc/grub-probefs.c
-       set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,grub\-probefs\.o[ :]*,grub_probefs-util_i386_pc_grub_probefs.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,grub\-probefs\.o[ :]*,grub_probefs-util_i386_pc_grub_probefs.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include grub_probefs-util_i386_pc_grub_probefs.d
 
 grub_probefs-util_i386_pc_biosdisk.o: util/i386/pc/biosdisk.c
-       $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-util_i386_pc_biosdisk.d: util/i386/pc/biosdisk.c
-       set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,biosdisk\.o[ :]*,grub_probefs-util_i386_pc_biosdisk.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,biosdisk\.o[ :]*,grub_probefs-util_i386_pc_biosdisk.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_probefs-util_i386_pc_biosdisk.d
 
 grub_probefs-util_misc.o: util/misc.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-util_misc.d: util/misc.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,misc\.o[ :]*,grub_probefs-util_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_probefs-util_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_probefs-util_misc.d
 
 grub_probefs-util_i386_pc_getroot.o: util/i386/pc/getroot.c
-       $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-util_i386_pc_getroot.d: util/i386/pc/getroot.c
-       set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,getroot\.o[ :]*,grub_probefs-util_i386_pc_getroot.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,getroot\.o[ :]*,grub_probefs-util_i386_pc_getroot.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_probefs-util_i386_pc_getroot.d
 
 grub_probefs-kern_device.o: kern/device.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-kern_device.d: kern/device.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,device\.o[ :]*,grub_probefs-kern_device.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,device\.o[ :]*,grub_probefs-kern_device.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_probefs-kern_device.d
 
 grub_probefs-kern_disk.o: kern/disk.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-kern_disk.d: kern/disk.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,disk\.o[ :]*,grub_probefs-kern_disk.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,disk\.o[ :]*,grub_probefs-kern_disk.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_probefs-kern_disk.d
 
 grub_probefs-kern_err.o: kern/err.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-kern_err.d: kern/err.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,err\.o[ :]*,grub_probefs-kern_err.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,err\.o[ :]*,grub_probefs-kern_err.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_probefs-kern_err.d
 
 grub_probefs-kern_misc.o: kern/misc.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-kern_misc.d: kern/misc.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,misc\.o[ :]*,grub_probefs-kern_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_probefs-kern_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_probefs-kern_misc.d
 
 grub_probefs-fs_fat.o: fs/fat.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-fs_fat.d: fs/fat.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,fat\.o[ :]*,grub_probefs-fs_fat.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,fat\.o[ :]*,grub_probefs-fs_fat.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_probefs-fs_fat.d
 
 grub_probefs-fs_ext2.o: fs/ext2.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-fs_ext2.d: fs/ext2.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,ext2\.o[ :]*,grub_probefs-fs_ext2.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,ext2\.o[ :]*,grub_probefs-fs_ext2.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_probefs-fs_ext2.d
 
 grub_probefs-kern_parser.o: kern/parser.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-kern_parser.d: kern/parser.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,parser\.o[ :]*,grub_probefs-kern_parser.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,parser\.o[ :]*,grub_probefs-kern_parser.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_probefs-kern_parser.d
 
 grub_probefs-kern_partition.o: kern/partition.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-kern_partition.d: kern/partition.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,partition\.o[ :]*,grub_probefs-kern_partition.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,partition\.o[ :]*,grub_probefs-kern_partition.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_probefs-kern_partition.d
 
 grub_probefs-partmap_pc.o: partmap/pc.c
-       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-partmap_pc.d: partmap/pc.c
-       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,pc\.o[ :]*,grub_probefs-partmap_pc.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,pc\.o[ :]*,grub_probefs-partmap_pc.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include grub_probefs-partmap_pc.d
 
 grub_probefs-fs_ufs.o: fs/ufs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-fs_ufs.d: fs/ufs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,ufs\.o[ :]*,grub_probefs-fs_ufs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,ufs\.o[ :]*,grub_probefs-fs_ufs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_probefs-fs_ufs.d
 
 grub_probefs-fs_minix.o: fs/minix.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-fs_minix.d: fs/minix.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,minix\.o[ :]*,grub_probefs-fs_minix.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,minix\.o[ :]*,grub_probefs-fs_minix.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_probefs-fs_minix.d
 
 grub_probefs-fs_hfs.o: fs/hfs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-fs_hfs.d: fs/hfs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,hfs\.o[ :]*,grub_probefs-fs_hfs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,hfs\.o[ :]*,grub_probefs-fs_hfs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_probefs-fs_hfs.d
 
 grub_probefs-fs_jfs.o: fs/jfs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-fs_jfs.d: fs/jfs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,jfs\.o[ :]*,grub_probefs-fs_jfs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,jfs\.o[ :]*,grub_probefs-fs_jfs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_probefs-fs_jfs.d
 
 grub_probefs-kern_fs.o: kern/fs.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-kern_fs.d: kern/fs.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,fs\.o[ :]*,grub_probefs-kern_fs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,fs\.o[ :]*,grub_probefs-kern_fs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_probefs-kern_fs.d
 
 grub_probefs-kern_env.o: kern/env.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-kern_env.d: kern/env.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<        | sed 's,env\.o[ :]*,grub_probefs-kern_env.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<          | sed 's,env\.o[ :]*,grub_probefs-kern_env.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_probefs-kern_env.d
 
 grub_probefs-fs_fshelp.o: fs/fshelp.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-fs_fshelp.d: fs/fshelp.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,fshelp\.o[ :]*,grub_probefs-fs_fshelp.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,fshelp\.o[ :]*,grub_probefs-fs_fshelp.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_probefs-fs_fshelp.d
 
 grub_probefs-fs_xfs.o: fs/xfs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-fs_xfs.d: fs/xfs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,xfs\.o[ :]*,grub_probefs-fs_xfs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,xfs\.o[ :]*,grub_probefs-fs_xfs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_probefs-fs_xfs.d
 
 grub_probefs-fs_affs.o: fs/affs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-fs_affs.d: fs/affs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,affs\.o[ :]*,grub_probefs-fs_affs.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,affs\.o[ :]*,grub_probefs-fs_affs.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_probefs-fs_affs.d
 
 grub_probefs-fs_sfs.o: fs/sfs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-fs_sfs.d: fs/sfs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,sfs\.o[ :]*,grub_probefs-fs_sfs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,sfs\.o[ :]*,grub_probefs-fs_sfs.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_probefs-fs_sfs.d
 
 grub_probefs-fs_hfsplus.o: fs/hfsplus.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -c -o $@ $<
 
 grub_probefs-fs_hfsplus.d: fs/hfsplus.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<    | sed 's,hfsplus\.o[ :]*,grub_probefs-fs_hfsplus.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probefs_CFLAGS) -M $<      | sed 's,hfsplus\.o[ :]*,grub_probefs-fs_hfsplus.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_probefs-fs_hfsplus.d
 
@@ -788,556 +787,539 @@ CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu
 MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_i386_pc_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_fshelp.d grub_emu-fs_hfs.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_hfsplus.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_i386_pc_biosdisk.d grub_emu-util_i386_pc_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-grub_emu_init.d
 
 grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_hfsplus.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-grub_emu_init.o
-       $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_emu_LDFLAGS)
+       $(CC) -o $@ $^ $(LDFLAGS) $(grub_emu_LDFLAGS)
 
 grub_emu-commands_boot.o: commands/boot.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_boot.d: commands/boot.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,boot\.o[ :]*,grub_emu-commands_boot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,boot\.o[ :]*,grub_emu-commands_boot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_boot.d
 
 grub_emu-commands_cat.o: commands/cat.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_cat.d: commands/cat.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,cat\.o[ :]*,grub_emu-commands_cat.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,cat\.o[ :]*,grub_emu-commands_cat.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_cat.d
 
 grub_emu-commands_cmp.o: commands/cmp.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_cmp.d: commands/cmp.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,cmp\.o[ :]*,grub_emu-commands_cmp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,cmp\.o[ :]*,grub_emu-commands_cmp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_cmp.d
 
 grub_emu-commands_configfile.o: commands/configfile.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_configfile.d: commands/configfile.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,configfile\.o[ :]*,grub_emu-commands_configfile.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,configfile\.o[ :]*,grub_emu-commands_configfile.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_configfile.d
 
 grub_emu-commands_help.o: commands/help.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_help.d: commands/help.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,help\.o[ :]*,grub_emu-commands_help.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,help\.o[ :]*,grub_emu-commands_help.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_help.d
 
 grub_emu-commands_terminal.o: commands/terminal.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_terminal.d: commands/terminal.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,terminal\.o[ :]*,grub_emu-commands_terminal.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,terminal\.o[ :]*,grub_emu-commands_terminal.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_terminal.d
 
 grub_emu-commands_ls.o: commands/ls.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_ls.d: commands/ls.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,ls\.o[ :]*,grub_emu-commands_ls.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,ls\.o[ :]*,grub_emu-commands_ls.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_ls.d
 
 grub_emu-commands_test.o: commands/test.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_test.d: commands/test.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,test\.o[ :]*,grub_emu-commands_test.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,test\.o[ :]*,grub_emu-commands_test.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_test.d
 
 grub_emu-commands_search.o: commands/search.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_search.d: commands/search.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,search\.o[ :]*,grub_emu-commands_search.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,search\.o[ :]*,grub_emu-commands_search.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_search.d
 
 grub_emu-commands_blocklist.o: commands/blocklist.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_blocklist.d: commands/blocklist.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,blocklist\.o[ :]*,grub_emu-commands_blocklist.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,blocklist\.o[ :]*,grub_emu-commands_blocklist.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_blocklist.d
 
 grub_emu-commands_i386_pc_halt.o: commands/i386/pc/halt.c
-       $(BUILD_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_i386_pc_halt.d: commands/i386/pc/halt.c
-       set -e;           $(BUILD_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,halt\.o[ :]*,grub_emu-commands_i386_pc_halt.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,halt\.o[ :]*,grub_emu-commands_i386_pc_halt.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_i386_pc_halt.d
 
 grub_emu-commands_i386_pc_reboot.o: commands/i386/pc/reboot.c
-       $(BUILD_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_i386_pc_reboot.d: commands/i386/pc/reboot.c
-       set -e;           $(BUILD_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,reboot\.o[ :]*,grub_emu-commands_i386_pc_reboot.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,reboot\.o[ :]*,grub_emu-commands_i386_pc_reboot.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_i386_pc_reboot.d
 
 grub_emu-disk_loopback.o: disk/loopback.c
-       $(BUILD_CC) -Idisk -I$(srcdir)/disk $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-disk_loopback.d: disk/loopback.c
-       set -e;           $(BUILD_CC) -Idisk -I$(srcdir)/disk $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,loopback\.o[ :]*,grub_emu-disk_loopback.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,loopback\.o[ :]*,grub_emu-disk_loopback.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-disk_loopback.d
 
 grub_emu-fs_affs.o: fs/affs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_affs.d: fs/affs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,affs\.o[ :]*,grub_emu-fs_affs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,affs\.o[ :]*,grub_emu-fs_affs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_affs.d
 
 grub_emu-fs_ext2.o: fs/ext2.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_ext2.d: fs/ext2.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,ext2\.o[ :]*,grub_emu-fs_ext2.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,ext2\.o[ :]*,grub_emu-fs_ext2.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_ext2.d
 
 grub_emu-fs_fat.o: fs/fat.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_fat.d: fs/fat.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,fat\.o[ :]*,grub_emu-fs_fat.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,fat\.o[ :]*,grub_emu-fs_fat.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_fat.d
 
 grub_emu-fs_fshelp.o: fs/fshelp.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_fshelp.d: fs/fshelp.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,fshelp\.o[ :]*,grub_emu-fs_fshelp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,fshelp\.o[ :]*,grub_emu-fs_fshelp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_fshelp.d
 
 grub_emu-fs_hfs.o: fs/hfs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_hfs.d: fs/hfs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,hfs\.o[ :]*,grub_emu-fs_hfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,hfs\.o[ :]*,grub_emu-fs_hfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_hfs.d
 
 grub_emu-fs_iso9660.o: fs/iso9660.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_iso9660.d: fs/iso9660.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,iso9660\.o[ :]*,grub_emu-fs_iso9660.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,iso9660\.o[ :]*,grub_emu-fs_iso9660.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_iso9660.d
 
 grub_emu-fs_jfs.o: fs/jfs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_jfs.d: fs/jfs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,jfs\.o[ :]*,grub_emu-fs_jfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,jfs\.o[ :]*,grub_emu-fs_jfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_jfs.d
 
 grub_emu-fs_minix.o: fs/minix.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_minix.d: fs/minix.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,minix\.o[ :]*,grub_emu-fs_minix.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,minix\.o[ :]*,grub_emu-fs_minix.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_minix.d
 
 grub_emu-fs_sfs.o: fs/sfs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_sfs.d: fs/sfs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,sfs\.o[ :]*,grub_emu-fs_sfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,sfs\.o[ :]*,grub_emu-fs_sfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_sfs.d
 
 grub_emu-fs_ufs.o: fs/ufs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_ufs.d: fs/ufs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,ufs\.o[ :]*,grub_emu-fs_ufs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,ufs\.o[ :]*,grub_emu-fs_ufs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_ufs.d
 
 grub_emu-fs_xfs.o: fs/xfs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_xfs.d: fs/xfs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,xfs\.o[ :]*,grub_emu-fs_xfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,xfs\.o[ :]*,grub_emu-fs_xfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_xfs.d
 
 grub_emu-fs_hfsplus.o: fs/hfsplus.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_hfsplus.d: fs/hfsplus.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,hfsplus\.o[ :]*,grub_emu-fs_hfsplus.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,hfsplus\.o[ :]*,grub_emu-fs_hfsplus.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_hfsplus.d
 
 grub_emu-io_gzio.o: io/gzio.c
-       $(BUILD_CC) -Iio -I$(srcdir)/io $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-io_gzio.d: io/gzio.c
-       set -e;           $(BUILD_CC) -Iio -I$(srcdir)/io $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,gzio\.o[ :]*,grub_emu-io_gzio.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,gzio\.o[ :]*,grub_emu-io_gzio.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-io_gzio.d
 
 grub_emu-kern_device.o: kern/device.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_device.d: kern/device.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,device\.o[ :]*,grub_emu-kern_device.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,device\.o[ :]*,grub_emu-kern_device.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_device.d
 
 grub_emu-kern_disk.o: kern/disk.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_disk.d: kern/disk.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,disk\.o[ :]*,grub_emu-kern_disk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,disk\.o[ :]*,grub_emu-kern_disk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_disk.d
 
 grub_emu-kern_dl.o: kern/dl.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_dl.d: kern/dl.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,dl\.o[ :]*,grub_emu-kern_dl.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,dl\.o[ :]*,grub_emu-kern_dl.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_dl.d
 
 grub_emu-kern_env.o: kern/env.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_env.d: kern/env.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,env\.o[ :]*,grub_emu-kern_env.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,env\.o[ :]*,grub_emu-kern_env.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_env.d
 
 grub_emu-kern_err.o: kern/err.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_err.d: kern/err.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,err\.o[ :]*,grub_emu-kern_err.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,err\.o[ :]*,grub_emu-kern_err.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_err.d
 
 grub_emu-normal_execute.o: normal/execute.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_execute.d: normal/execute.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,execute\.o[ :]*,grub_emu-normal_execute.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,execute\.o[ :]*,grub_emu-normal_execute.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_execute.d
 
 grub_emu-kern_file.o: kern/file.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_file.d: kern/file.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,file\.o[ :]*,grub_emu-kern_file.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,file\.o[ :]*,grub_emu-kern_file.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_file.d
 
 grub_emu-kern_fs.o: kern/fs.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_fs.d: kern/fs.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,fs\.o[ :]*,grub_emu-kern_fs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,fs\.o[ :]*,grub_emu-kern_fs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_fs.d
 
 grub_emu-normal_lexer.o: normal/lexer.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_lexer.d: normal/lexer.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,lexer\.o[ :]*,grub_emu-normal_lexer.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,lexer\.o[ :]*,grub_emu-normal_lexer.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_lexer.d
 
 grub_emu-kern_loader.o: kern/loader.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_loader.d: kern/loader.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,loader\.o[ :]*,grub_emu-kern_loader.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,loader\.o[ :]*,grub_emu-kern_loader.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_loader.d
 
 grub_emu-kern_main.o: kern/main.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_main.d: kern/main.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,main\.o[ :]*,grub_emu-kern_main.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,main\.o[ :]*,grub_emu-kern_main.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_main.d
 
 grub_emu-kern_misc.o: kern/misc.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_misc.d: kern/misc.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_emu-kern_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,grub_emu-kern_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_misc.d
 
 grub_emu-kern_parser.o: kern/parser.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_parser.d: kern/parser.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,parser\.o[ :]*,grub_emu-kern_parser.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,parser\.o[ :]*,grub_emu-kern_parser.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_parser.d
 
 grub_emu-grub_script_tab.o: grub_script.tab.c
-       $(BUILD_CC) -I. -I$(srcdir)/. $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-grub_script_tab.d: grub_script.tab.c
-       set -e;           $(BUILD_CC) -I. -I$(srcdir)/. $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,grub_script\.tab\.o[ :]*,grub_emu-grub_script_tab.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,grub_script\.tab\.o[ :]*,grub_emu-grub_script_tab.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_emu-grub_script_tab.d
 
 grub_emu-kern_partition.o: kern/partition.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_partition.d: kern/partition.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,partition\.o[ :]*,grub_emu-kern_partition.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,partition\.o[ :]*,grub_emu-kern_partition.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_partition.d
 
 grub_emu-kern_rescue.o: kern/rescue.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_rescue.d: kern/rescue.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,rescue\.o[ :]*,grub_emu-kern_rescue.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,rescue\.o[ :]*,grub_emu-kern_rescue.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_rescue.d
 
 grub_emu-kern_term.o: kern/term.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_term.d: kern/term.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,term\.o[ :]*,grub_emu-kern_term.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,term\.o[ :]*,grub_emu-kern_term.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_term.d
 
 grub_emu-normal_arg.o: normal/arg.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_arg.d: normal/arg.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,arg\.o[ :]*,grub_emu-normal_arg.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,arg\.o[ :]*,grub_emu-normal_arg.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_arg.d
 
 grub_emu-normal_cmdline.o: normal/cmdline.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_cmdline.d: normal/cmdline.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,cmdline\.o[ :]*,grub_emu-normal_cmdline.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,cmdline\.o[ :]*,grub_emu-normal_cmdline.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_cmdline.d
 
 grub_emu-normal_command.o: normal/command.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_command.d: normal/command.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,command\.o[ :]*,grub_emu-normal_command.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,command\.o[ :]*,grub_emu-normal_command.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_command.d
 
 grub_emu-normal_function.o: normal/function.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_function.d: normal/function.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,function\.o[ :]*,grub_emu-normal_function.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,function\.o[ :]*,grub_emu-normal_function.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_function.d
 
 grub_emu-normal_completion.o: normal/completion.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_completion.d: normal/completion.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,completion\.o[ :]*,grub_emu-normal_completion.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,completion\.o[ :]*,grub_emu-normal_completion.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_completion.d
 
 grub_emu-normal_main.o: normal/main.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_main.d: normal/main.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,main\.o[ :]*,grub_emu-normal_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,main\.o[ :]*,grub_emu-normal_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_main.d
 
 grub_emu-normal_menu.o: normal/menu.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_menu.d: normal/menu.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,menu\.o[ :]*,grub_emu-normal_menu.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,menu\.o[ :]*,grub_emu-normal_menu.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_menu.d
 
 grub_emu-normal_menu_entry.o: normal/menu_entry.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_menu_entry.d: normal/menu_entry.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,menu_entry\.o[ :]*,grub_emu-normal_menu_entry.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,menu_entry\.o[ :]*,grub_emu-normal_menu_entry.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_menu_entry.d
 
 grub_emu-normal_misc.o: normal/misc.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_misc.d: normal/misc.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,misc\.o[ :]*,grub_emu-normal_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_emu-normal_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_misc.d
 
 grub_emu-normal_script.o: normal/script.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_script.d: normal/script.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,script\.o[ :]*,grub_emu-normal_script.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,script\.o[ :]*,grub_emu-normal_script.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_script.d
 
 grub_emu-partmap_amiga.o: partmap/amiga.c
-       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-partmap_amiga.d: partmap/amiga.c
-       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,amiga\.o[ :]*,grub_emu-partmap_amiga.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,amiga\.o[ :]*,grub_emu-partmap_amiga.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include grub_emu-partmap_amiga.d
 
 grub_emu-partmap_apple.o: partmap/apple.c
-       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-partmap_apple.d: partmap/apple.c
-       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,apple\.o[ :]*,grub_emu-partmap_apple.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,apple\.o[ :]*,grub_emu-partmap_apple.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include grub_emu-partmap_apple.d
 
 grub_emu-partmap_pc.o: partmap/pc.c
-       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-partmap_pc.d: partmap/pc.c
-       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,pc\.o[ :]*,grub_emu-partmap_pc.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,pc\.o[ :]*,grub_emu-partmap_pc.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
 
 -include grub_emu-partmap_pc.d
 
 grub_emu-partmap_sun.o: partmap/sun.c
-       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-partmap_sun.d: partmap/sun.c
-       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,sun\.o[ :]*,grub_emu-partmap_sun.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,sun\.o[ :]*,grub_emu-partmap_sun.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include grub_emu-partmap_sun.d
 
 grub_emu-partmap_acorn.o: partmap/acorn.c
-       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-partmap_acorn.d: partmap/acorn.c
-       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,acorn\.o[ :]*,grub_emu-partmap_acorn.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,acorn\.o[ :]*,grub_emu-partmap_acorn.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include grub_emu-partmap_acorn.d
 
 grub_emu-partmap_gpt.o: partmap/gpt.c
-       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-partmap_gpt.d: partmap/gpt.c
-       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,gpt\.o[ :]*,grub_emu-partmap_gpt.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,gpt\.o[ :]*,grub_emu-partmap_gpt.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include grub_emu-partmap_gpt.d
 
 grub_emu-util_console.o: util/console.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-util_console.d: util/console.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,console\.o[ :]*,grub_emu-util_console.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,console\.o[ :]*,grub_emu-util_console.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-util_console.d
 
 grub_emu-util_grub_emu.o: util/grub-emu.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-util_grub_emu.d: util/grub-emu.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,grub\-emu\.o[ :]*,grub_emu-util_grub_emu.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,grub\-emu\.o[ :]*,grub_emu-util_grub_emu.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include grub_emu-util_grub_emu.d
 
 grub_emu-util_misc.o: util/misc.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-util_misc.d: util/misc.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_emu-util_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,grub_emu-util_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-util_misc.d
 
 grub_emu-util_i386_pc_biosdisk.o: util/i386/pc/biosdisk.c
-       $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-util_i386_pc_biosdisk.d: util/i386/pc/biosdisk.c
-       set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,biosdisk\.o[ :]*,grub_emu-util_i386_pc_biosdisk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,biosdisk\.o[ :]*,grub_emu-util_i386_pc_biosdisk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-util_i386_pc_biosdisk.d
 
 grub_emu-util_i386_pc_getroot.o: util/i386/pc/getroot.c
-       $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-util_i386_pc_getroot.d: util/i386/pc/getroot.c
-       set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,getroot\.o[ :]*,grub_emu-util_i386_pc_getroot.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,getroot\.o[ :]*,grub_emu-util_i386_pc_getroot.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-util_i386_pc_getroot.d
 
 grub_emu-util_i386_pc_misc.o: util/i386/pc/misc.c
-       $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-util_i386_pc_misc.d: util/i386/pc/misc.c
-       set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_emu-util_i386_pc_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,grub_emu-util_i386_pc_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-util_i386_pc_misc.d
 
 grub_emu-grub_emu_init.o: grub_emu_init.c
-       $(BUILD_CC) -I. -I$(srcdir)/. $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-grub_emu_init.d: grub_emu_init.c
-       set -e;           $(BUILD_CC) -I. -I$(srcdir)/. $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,grub_emu_init\.o[ :]*,grub_emu-grub_emu_init.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,grub_emu_init\.o[ :]*,grub_emu-grub_emu_init.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include grub_emu-grub_emu_init.d
 
 
 grub_emu_LDFLAGS = $(LIBCURSES)
 
-# For genmoddep.
-genmoddep_SOURCES = util/genmoddep.c
-CLEANFILES += genmoddep genmoddep-util_genmoddep.o
-MOSTLYCLEANFILES += genmoddep-util_genmoddep.d
-
-genmoddep: genmoddep-util_genmoddep.o
-       $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(genmoddep_LDFLAGS)
-
-genmoddep-util_genmoddep.o: util/genmoddep.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(genmoddep_CFLAGS) -c -o $@ $<
-
-genmoddep-util_genmoddep.d: util/genmoddep.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(genmoddep_CFLAGS) -M $<           | sed 's,genmoddep\.o[ :]*,genmoddep-util_genmoddep.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-
--include genmoddep-util_genmoddep.d
-
-
 # Scripts.
 sbin_SCRIPTS = grub-install
 
@@ -1368,15 +1350,15 @@ UNDSYMFILES += und-_chain.lst
 
 _chain.mod: pre-_chain.o mod-_chain.o
        -rm -f $@
-       $(CC) $(_chain_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-_chain.o: _chain_mod-loader_i386_pc_chainloader.o
        -rm -f $@
-       $(CC) $(_chain_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-_chain.o: mod-_chain.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $<
 
 mod-_chain.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh '_chain' $< > $@ || (rm -f $@; exit 1)
@@ -1391,10 +1373,10 @@ und-_chain.lst: pre-_chain.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 _chain_mod-loader_i386_pc_chainloader.o: loader/i386/pc/chainloader.c
-       $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_TARGET_CFLAGS) -c -o $@ $<
 
 _chain_mod-loader_i386_pc_chainloader.d: loader/i386/pc/chainloader.c
-       set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_chain_mod_CFLAGS) -M $<      | sed 's,chainloader\.o[ :]*,_chain_mod-loader_i386_pc_chainloader.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_TARGET_CFLAGS) -M $<          | sed 's,chainloader\.o[ :]*,_chain_mod-loader_i386_pc_chainloader.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include _chain_mod-loader_i386_pc_chainloader.d
 
@@ -1403,10 +1385,10 @@ COMMANDFILES += cmd-_chain_mod-loader_i386_pc_chainloader.lst
 FSFILES += fs-_chain_mod-loader_i386_pc_chainloader.lst
 
 cmd-_chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c gencmdlist.sh
-       set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_chain_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh _chain > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh _chain > $@ || (rm -f $@; exit 1)
 
 fs-_chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c genfslist.sh
-       set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_chain_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh _chain > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh _chain > $@ || (rm -f $@; exit 1)
 
 
 _chain_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1424,15 +1406,15 @@ UNDSYMFILES += und-chain.lst
 
 chain.mod: pre-chain.o mod-chain.o
        -rm -f $@
-       $(CC) $(chain_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-chain.o: chain_mod-loader_i386_pc_chainloader_normal.o
        -rm -f $@
-       $(CC) $(chain_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-chain.o: mod-chain.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $<
 
 mod-chain.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'chain' $< > $@ || (rm -f $@; exit 1)
@@ -1447,10 +1429,10 @@ und-chain.lst: pre-chain.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 chain_mod-loader_i386_pc_chainloader_normal.o: loader/i386/pc/chainloader_normal.c
-       $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_TARGET_CFLAGS) -c -o $@ $<
 
 chain_mod-loader_i386_pc_chainloader_normal.d: loader/i386/pc/chainloader_normal.c
-       set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(chain_mod_CFLAGS) -M $<       | sed 's,chainloader_normal\.o[ :]*,chain_mod-loader_i386_pc_chainloader_normal.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_TARGET_CFLAGS) -M $<           | sed 's,chainloader_normal\.o[ :]*,chain_mod-loader_i386_pc_chainloader_normal.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
 
 -include chain_mod-loader_i386_pc_chainloader_normal.d
 
@@ -1459,10 +1441,10 @@ COMMANDFILES += cmd-chain_mod-loader_i386_pc_chainloader_normal.lst
 FSFILES += fs-chain_mod-loader_i386_pc_chainloader_normal.lst
 
 cmd-chain_mod-loader_i386_pc_chainloader_normal.lst: loader/i386/pc/chainloader_normal.c gencmdlist.sh
-       set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(chain_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1)
 
 fs-chain_mod-loader_i386_pc_chainloader_normal.lst: loader/i386/pc/chainloader_normal.c genfslist.sh
-       set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(chain_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1)
 
 
 chain_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1480,15 +1462,15 @@ UNDSYMFILES += und-_linux.lst
 
 _linux.mod: pre-_linux.o mod-_linux.o
        -rm -f $@
-       $(CC) $(_linux_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-_linux.o: _linux_mod-loader_i386_pc_linux.o
        -rm -f $@
-       $(CC) $(_linux_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-_linux.o: mod-_linux.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
 
 mod-_linux.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1)
@@ -1503,10 +1485,10 @@ und-_linux.lst: pre-_linux.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 _linux_mod-loader_i386_pc_linux.o: loader/i386/pc/linux.c
-       $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_TARGET_CFLAGS) -c -o $@ $<
 
 _linux_mod-loader_i386_pc_linux.d: loader/i386/pc/linux.c
-       set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -M $<      | sed 's,linux\.o[ :]*,_linux_mod-loader_i386_pc_linux.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_TARGET_CFLAGS) -M $<          | sed 's,linux\.o[ :]*,_linux_mod-loader_i386_pc_linux.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include _linux_mod-loader_i386_pc_linux.d
 
@@ -1515,10 +1497,10 @@ COMMANDFILES += cmd-_linux_mod-loader_i386_pc_linux.lst
 FSFILES += fs-_linux_mod-loader_i386_pc_linux.lst
 
 cmd-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c gencmdlist.sh
-       set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1)
 
 fs-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c genfslist.sh
-       set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1)
 
 
 _linux_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1536,15 +1518,15 @@ UNDSYMFILES += und-linux.lst
 
 linux.mod: pre-linux.o mod-linux.o
        -rm -f $@
-       $(CC) $(linux_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-linux.o: linux_mod-loader_i386_pc_linux_normal.o
        -rm -f $@
-       $(CC) $(linux_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-linux.o: mod-linux.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
 
 mod-linux.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1)
@@ -1559,10 +1541,10 @@ und-linux.lst: pre-linux.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 linux_mod-loader_i386_pc_linux_normal.o: loader/i386/pc/linux_normal.c
-       $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_TARGET_CFLAGS) -c -o $@ $<
 
 linux_mod-loader_i386_pc_linux_normal.d: loader/i386/pc/linux_normal.c
-       set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -M $<       | sed 's,linux_normal\.o[ :]*,linux_mod-loader_i386_pc_linux_normal.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_TARGET_CFLAGS) -M $<           | sed 's,linux_normal\.o[ :]*,linux_mod-loader_i386_pc_linux_normal.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include linux_mod-loader_i386_pc_linux_normal.d
 
@@ -1571,10 +1553,10 @@ COMMANDFILES += cmd-linux_mod-loader_i386_pc_linux_normal.lst
 FSFILES += fs-linux_mod-loader_i386_pc_linux_normal.lst
 
 cmd-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c gencmdlist.sh
-       set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1)
 
 fs-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c genfslist.sh
-       set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1)
 
 
 linux_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1596,15 +1578,15 @@ UNDSYMFILES += und-normal.lst
 
 normal.mod: pre-normal.o mod-normal.o
        -rm -f $@
-       $(CC) $(normal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o
        -rm -f $@
-       $(CC) $(normal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-normal.o: mod-normal.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
 
 mod-normal.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1)
@@ -1619,10 +1601,10 @@ und-normal.lst: pre-normal.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 normal_mod-normal_arg.o: normal/arg.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_arg.d: normal/arg.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,arg\.o[ :]*,normal_mod-normal_arg.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,arg\.o[ :]*,normal_mod-normal_arg.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_arg.d
 
@@ -1631,17 +1613,17 @@ COMMANDFILES += cmd-normal_mod-normal_arg.lst
 FSFILES += fs-normal_mod-normal_arg.lst
 
 cmd-normal_mod-normal_arg.lst: normal/arg.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_arg.lst: normal/arg.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_cmdline.o: normal/cmdline.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_cmdline.d: normal/cmdline.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,cmdline\.o[ :]*,normal_mod-normal_cmdline.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,cmdline\.o[ :]*,normal_mod-normal_cmdline.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_cmdline.d
 
@@ -1650,17 +1632,17 @@ COMMANDFILES += cmd-normal_mod-normal_cmdline.lst
 FSFILES += fs-normal_mod-normal_cmdline.lst
 
 cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_cmdline.lst: normal/cmdline.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_command.o: normal/command.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_command.d: normal/command.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,command\.o[ :]*,normal_mod-normal_command.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,command\.o[ :]*,normal_mod-normal_command.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_command.d
 
@@ -1669,17 +1651,17 @@ COMMANDFILES += cmd-normal_mod-normal_command.lst
 FSFILES += fs-normal_mod-normal_command.lst
 
 cmd-normal_mod-normal_command.lst: normal/command.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_command.lst: normal/command.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_completion.o: normal/completion.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_completion.d: normal/completion.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,completion\.o[ :]*,normal_mod-normal_completion.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,completion\.o[ :]*,normal_mod-normal_completion.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_completion.d
 
@@ -1688,17 +1670,17 @@ COMMANDFILES += cmd-normal_mod-normal_completion.lst
 FSFILES += fs-normal_mod-normal_completion.lst
 
 cmd-normal_mod-normal_completion.lst: normal/completion.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_completion.lst: normal/completion.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_execute.o: normal/execute.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_execute.d: normal/execute.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,execute\.o[ :]*,normal_mod-normal_execute.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,execute\.o[ :]*,normal_mod-normal_execute.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_execute.d
 
@@ -1707,17 +1689,17 @@ COMMANDFILES += cmd-normal_mod-normal_execute.lst
 FSFILES += fs-normal_mod-normal_execute.lst
 
 cmd-normal_mod-normal_execute.lst: normal/execute.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_execute.lst: normal/execute.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_function.o: normal/function.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_function.d: normal/function.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,function\.o[ :]*,normal_mod-normal_function.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,function\.o[ :]*,normal_mod-normal_function.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_function.d
 
@@ -1726,17 +1708,17 @@ COMMANDFILES += cmd-normal_mod-normal_function.lst
 FSFILES += fs-normal_mod-normal_function.lst
 
 cmd-normal_mod-normal_function.lst: normal/function.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_function.lst: normal/function.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_lexer.o: normal/lexer.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_lexer.d: normal/lexer.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,lexer\.o[ :]*,normal_mod-normal_lexer.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,lexer\.o[ :]*,normal_mod-normal_lexer.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_lexer.d
 
@@ -1745,17 +1727,17 @@ COMMANDFILES += cmd-normal_mod-normal_lexer.lst
 FSFILES += fs-normal_mod-normal_lexer.lst
 
 cmd-normal_mod-normal_lexer.lst: normal/lexer.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_lexer.lst: normal/lexer.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_main.o: normal/main.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_main.d: normal/main.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,main\.o[ :]*,normal_mod-normal_main.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,main\.o[ :]*,normal_mod-normal_main.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_main.d
 
@@ -1764,17 +1746,17 @@ COMMANDFILES += cmd-normal_mod-normal_main.lst
 FSFILES += fs-normal_mod-normal_main.lst
 
 cmd-normal_mod-normal_main.lst: normal/main.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_main.lst: normal/main.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_menu.o: normal/menu.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_menu.d: normal/menu.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,menu\.o[ :]*,normal_mod-normal_menu.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,menu\.o[ :]*,normal_mod-normal_menu.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_menu.d
 
@@ -1783,17 +1765,17 @@ COMMANDFILES += cmd-normal_mod-normal_menu.lst
 FSFILES += fs-normal_mod-normal_menu.lst
 
 cmd-normal_mod-normal_menu.lst: normal/menu.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_menu.lst: normal/menu.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_menu_entry.o: normal/menu_entry.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_menu_entry.d: normal/menu_entry.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,menu_entry\.o[ :]*,normal_mod-normal_menu_entry.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,menu_entry\.o[ :]*,normal_mod-normal_menu_entry.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_menu_entry.d
 
@@ -1802,17 +1784,17 @@ COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst
 FSFILES += fs-normal_mod-normal_menu_entry.lst
 
 cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_misc.o: normal/misc.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_misc.d: normal/misc.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,normal_mod-normal_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,normal_mod-normal_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_misc.d
 
@@ -1821,17 +1803,17 @@ COMMANDFILES += cmd-normal_mod-normal_misc.lst
 FSFILES += fs-normal_mod-normal_misc.lst
 
 cmd-normal_mod-normal_misc.lst: normal/misc.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_misc.lst: normal/misc.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-grub_script_tab.o: grub_script.tab.c
-       $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-grub_script_tab.d: grub_script.tab.c
-       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<        | sed 's,grub_script\.tab\.o[ :]*,normal_mod-grub_script_tab.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<    | sed 's,grub_script\.tab\.o[ :]*,normal_mod-grub_script_tab.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-grub_script_tab.d
 
@@ -1840,17 +1822,17 @@ COMMANDFILES += cmd-normal_mod-grub_script_tab.lst
 FSFILES += fs-normal_mod-grub_script_tab.lst
 
 cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c gencmdlist.sh
-       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-grub_script_tab.lst: grub_script.tab.c genfslist.sh
-       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_script.o: normal/script.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_script.d: normal/script.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,script\.o[ :]*,normal_mod-normal_script.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,script\.o[ :]*,normal_mod-normal_script.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_script.d
 
@@ -1859,17 +1841,17 @@ COMMANDFILES += cmd-normal_mod-normal_script.lst
 FSFILES += fs-normal_mod-normal_script.lst
 
 cmd-normal_mod-normal_script.lst: normal/script.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_script.lst: normal/script.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S
-       $(CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_TARGET_ASFLAGS) -c -o $@ $<
 
 normal_mod-normal_i386_setjmp.d: normal/i386/setjmp.S
-       set -e;           $(CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -M $<          | sed 's,setjmp\.o[ :]*,normal_mod-normal_i386_setjmp.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_TARGET_ASFLAGS) -M $<      | sed 's,setjmp\.o[ :]*,normal_mod-normal_i386_setjmp.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_i386_setjmp.d
 
@@ -1878,10 +1860,10 @@ COMMANDFILES += cmd-normal_mod-normal_i386_setjmp.lst
 FSFILES += fs-normal_mod-normal_i386_setjmp.lst
 
 cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S gencmdlist.sh
-       set -e;           $(CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_TARGET_ASFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S genfslist.sh
-       set -e;           $(CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_TARGET_ASFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1900,15 +1882,15 @@ UNDSYMFILES += und-reboot.lst
 
 reboot.mod: pre-reboot.o mod-reboot.o
        -rm -f $@
-       $(CC) $(reboot_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-reboot.o: reboot_mod-commands_i386_pc_reboot.o
        -rm -f $@
-       $(CC) $(reboot_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-reboot.o: mod-reboot.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
 
 mod-reboot.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1)
@@ -1923,10 +1905,10 @@ und-reboot.lst: pre-reboot.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 reboot_mod-commands_i386_pc_reboot.o: commands/i386/pc/reboot.c
-       $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_TARGET_CFLAGS) -c -o $@ $<
 
 reboot_mod-commands_i386_pc_reboot.d: commands/i386/pc/reboot.c
-       set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -M $<          | sed 's,reboot\.o[ :]*,reboot_mod-commands_i386_pc_reboot.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_TARGET_CFLAGS) -M $<      | sed 's,reboot\.o[ :]*,reboot_mod-commands_i386_pc_reboot.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include reboot_mod-commands_i386_pc_reboot.d
 
@@ -1935,10 +1917,10 @@ COMMANDFILES += cmd-reboot_mod-commands_i386_pc_reboot.lst
 FSFILES += fs-reboot_mod-commands_i386_pc_reboot.lst
 
 cmd-reboot_mod-commands_i386_pc_reboot.lst: commands/i386/pc/reboot.c gencmdlist.sh
-       set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1)
 
 fs-reboot_mod-commands_i386_pc_reboot.lst: commands/i386/pc/reboot.c genfslist.sh
-       set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1)
 
 
 reboot_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1956,15 +1938,15 @@ UNDSYMFILES += und-halt.lst
 
 halt.mod: pre-halt.o mod-halt.o
        -rm -f $@
-       $(CC) $(halt_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-halt.o: halt_mod-commands_i386_pc_halt.o
        -rm -f $@
-       $(CC) $(halt_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-halt.o: mod-halt.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
 
 mod-halt.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1)
@@ -1979,10 +1961,10 @@ und-halt.lst: pre-halt.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 halt_mod-commands_i386_pc_halt.o: commands/i386/pc/halt.c
-       $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_TARGET_CFLAGS) -c -o $@ $<
 
 halt_mod-commands_i386_pc_halt.d: commands/i386/pc/halt.c
-       set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -M $<    | sed 's,halt\.o[ :]*,halt_mod-commands_i386_pc_halt.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_TARGET_CFLAGS) -M $<        | sed 's,halt\.o[ :]*,halt_mod-commands_i386_pc_halt.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include halt_mod-commands_i386_pc_halt.d
 
@@ -1991,10 +1973,10 @@ COMMANDFILES += cmd-halt_mod-commands_i386_pc_halt.lst
 FSFILES += fs-halt_mod-commands_i386_pc_halt.lst
 
 cmd-halt_mod-commands_i386_pc_halt.lst: commands/i386/pc/halt.c gencmdlist.sh
-       set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1)
 
 fs-halt_mod-commands_i386_pc_halt.lst: commands/i386/pc/halt.c genfslist.sh
-       set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1)
 
 
 halt_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -2017,15 +1999,15 @@ UNDSYMFILES += und-_multiboot.lst
 
 _multiboot.mod: pre-_multiboot.o mod-_multiboot.o
        -rm -f $@
-       $(CC) $(_multiboot_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-_multiboot.o: _multiboot_mod-loader_i386_pc_multiboot.o
        -rm -f $@
-       $(CC) $(_multiboot_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-_multiboot.o: mod-_multiboot.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $<
 
 mod-_multiboot.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh '_multiboot' $< > $@ || (rm -f $@; exit 1)
@@ -2040,10 +2022,10 @@ und-_multiboot.lst: pre-_multiboot.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 _multiboot_mod-loader_i386_pc_multiboot.o: loader/i386/pc/multiboot.c
-       $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_TARGET_CFLAGS) -c -o $@ $<
 
 _multiboot_mod-loader_i386_pc_multiboot.d: loader/i386/pc/multiboot.c
-       set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_multiboot_mod_CFLAGS) -M $<          | sed 's,multiboot\.o[ :]*,_multiboot_mod-loader_i386_pc_multiboot.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_TARGET_CFLAGS) -M $<      | sed 's,multiboot\.o[ :]*,_multiboot_mod-loader_i386_pc_multiboot.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include _multiboot_mod-loader_i386_pc_multiboot.d
 
@@ -2052,10 +2034,10 @@ COMMANDFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot.lst
 FSFILES += fs-_multiboot_mod-loader_i386_pc_multiboot.lst
 
 cmd-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c gencmdlist.sh
-       set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_multiboot_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1)
 
 fs-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c genfslist.sh
-       set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_multiboot_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1)
 
 
 _multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -2073,15 +2055,15 @@ UNDSYMFILES += und-multiboot.lst
 
 multiboot.mod: pre-multiboot.o mod-multiboot.o
        -rm -f $@
-       $(CC) $(multiboot_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-multiboot.o: multiboot_mod-loader_i386_pc_multiboot_normal.o
        -rm -f $@
-       $(CC) $(multiboot_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-multiboot.o: mod-multiboot.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $<
 
 mod-multiboot.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'multiboot' $< > $@ || (rm -f $@; exit 1)
@@ -2096,10 +2078,10 @@ und-multiboot.lst: pre-multiboot.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 multiboot_mod-loader_i386_pc_multiboot_normal.o: loader/i386/pc/multiboot_normal.c
-       $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_TARGET_CFLAGS) -c -o $@ $<
 
 multiboot_mod-loader_i386_pc_multiboot_normal.d: loader/i386/pc/multiboot_normal.c
-       set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(multiboot_mod_CFLAGS) -M $<           | sed 's,multiboot_normal\.o[ :]*,multiboot_mod-loader_i386_pc_multiboot_normal.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_TARGET_CFLAGS) -M $<       | sed 's,multiboot_normal\.o[ :]*,multiboot_mod-loader_i386_pc_multiboot_normal.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
 
 -include multiboot_mod-loader_i386_pc_multiboot_normal.d
 
@@ -2108,10 +2090,10 @@ COMMANDFILES += cmd-multiboot_mod-loader_i386_pc_multiboot_normal.lst
 FSFILES += fs-multiboot_mod-loader_i386_pc_multiboot_normal.lst
 
 cmd-multiboot_mod-loader_i386_pc_multiboot_normal.lst: loader/i386/pc/multiboot_normal.c gencmdlist.sh
-       set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(multiboot_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_TARGET_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1)
 
 fs-multiboot_mod-loader_i386_pc_multiboot_normal.lst: loader/i386/pc/multiboot_normal.c genfslist.sh
-       set -e;           $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(multiboot_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_TARGET_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1)
 
 
 multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -2130,15 +2112,15 @@ UNDSYMFILES += und-vbe.lst
 
 vbe.mod: pre-vbe.o mod-vbe.o
        -rm -f $@
-       $(CC) $(vbe_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(vbe_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-vbe.o: vbe_mod-video_i386_pc_vbe.o vbe_mod-video_i386_pc_vbeblit.o vbe_mod-video_i386_pc_vbefill.o
        -rm -f $@
-       $(CC) $(vbe_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(vbe_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-vbe.o: mod-vbe.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(vbe_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -c -o $@ $<
 
 mod-vbe.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'vbe' $< > $@ || (rm -f $@; exit 1)
@@ -2153,10 +2135,10 @@ und-vbe.lst: pre-vbe.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 vbe_mod-video_i386_pc_vbe.o: video/i386/pc/vbe.c
-       $(CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbe_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_TARGET_CFLAGS) -c -o $@ $<
 
 vbe_mod-video_i386_pc_vbe.d: video/i386/pc/vbe.c
-       set -e;           $(CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbe_mod_CFLAGS) -M $<           | sed 's,vbe\.o[ :]*,vbe_mod-video_i386_pc_vbe.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_TARGET_CFLAGS) -M $<       | sed 's,vbe\.o[ :]*,vbe_mod-video_i386_pc_vbe.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include vbe_mod-video_i386_pc_vbe.d
 
@@ -2165,17 +2147,17 @@ COMMANDFILES += cmd-vbe_mod-video_i386_pc_vbe.lst
 FSFILES += fs-vbe_mod-video_i386_pc_vbe.lst
 
 cmd-vbe_mod-video_i386_pc_vbe.lst: video/i386/pc/vbe.c gencmdlist.sh
-       set -e;           $(CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbe_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_TARGET_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1)
 
 fs-vbe_mod-video_i386_pc_vbe.lst: video/i386/pc/vbe.c genfslist.sh
-       set -e;           $(CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbe_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_TARGET_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1)
 
 
 vbe_mod-video_i386_pc_vbeblit.o: video/i386/pc/vbeblit.c
-       $(CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbe_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_TARGET_CFLAGS) -c -o $@ $<
 
 vbe_mod-video_i386_pc_vbeblit.d: video/i386/pc/vbeblit.c
-       set -e;           $(CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbe_mod_CFLAGS) -M $<           | sed 's,vbeblit\.o[ :]*,vbe_mod-video_i386_pc_vbeblit.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_TARGET_CFLAGS) -M $<       | sed 's,vbeblit\.o[ :]*,vbe_mod-video_i386_pc_vbeblit.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include vbe_mod-video_i386_pc_vbeblit.d
 
@@ -2184,17 +2166,17 @@ COMMANDFILES += cmd-vbe_mod-video_i386_pc_vbeblit.lst
 FSFILES += fs-vbe_mod-video_i386_pc_vbeblit.lst
 
 cmd-vbe_mod-video_i386_pc_vbeblit.lst: video/i386/pc/vbeblit.c gencmdlist.sh
-       set -e;           $(CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbe_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_TARGET_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1)
 
 fs-vbe_mod-video_i386_pc_vbeblit.lst: video/i386/pc/vbeblit.c genfslist.sh
-       set -e;           $(CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbe_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_TARGET_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1)
 
 
 vbe_mod-video_i386_pc_vbefill.o: video/i386/pc/vbefill.c
-       $(CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbe_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_TARGET_CFLAGS) -c -o $@ $<
 
 vbe_mod-video_i386_pc_vbefill.d: video/i386/pc/vbefill.c
-       set -e;           $(CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbe_mod_CFLAGS) -M $<           | sed 's,vbefill\.o[ :]*,vbe_mod-video_i386_pc_vbefill.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_TARGET_CFLAGS) -M $<       | sed 's,vbefill\.o[ :]*,vbe_mod-video_i386_pc_vbefill.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include vbe_mod-video_i386_pc_vbefill.d
 
@@ -2203,10 +2185,10 @@ COMMANDFILES += cmd-vbe_mod-video_i386_pc_vbefill.lst
 FSFILES += fs-vbe_mod-video_i386_pc_vbefill.lst
 
 cmd-vbe_mod-video_i386_pc_vbefill.lst: video/i386/pc/vbefill.c gencmdlist.sh
-       set -e;           $(CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbe_mod_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_TARGET_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1)
 
 fs-vbe_mod-video_i386_pc_vbefill.lst: video/i386/pc/vbefill.c genfslist.sh
-       set -e;           $(CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbe_mod_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_TARGET_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1)
 
 
 vbe_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -2224,15 +2206,15 @@ UNDSYMFILES += und-vbeinfo.lst
 
 vbeinfo.mod: pre-vbeinfo.o mod-vbeinfo.o
        -rm -f $@
-       $(CC) $(vbeinfo_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(vbeinfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-vbeinfo.o: vbeinfo_mod-commands_i386_pc_vbeinfo.o
        -rm -f $@
-       $(CC) $(vbeinfo_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(vbeinfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-vbeinfo.o: mod-vbeinfo.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(vbeinfo_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -c -o $@ $<
 
 mod-vbeinfo.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'vbeinfo' $< > $@ || (rm -f $@; exit 1)
@@ -2247,10 +2229,10 @@ und-vbeinfo.lst: pre-vbeinfo.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 vbeinfo_mod-commands_i386_pc_vbeinfo.o: commands/i386/pc/vbeinfo.c
-       $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbeinfo_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_TARGET_CFLAGS) -c -o $@ $<
 
 vbeinfo_mod-commands_i386_pc_vbeinfo.d: commands/i386/pc/vbeinfo.c
-       set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbeinfo_mod_CFLAGS) -M $<         | sed 's,vbeinfo\.o[ :]*,vbeinfo_mod-commands_i386_pc_vbeinfo.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_TARGET_CFLAGS) -M $<     | sed 's,vbeinfo\.o[ :]*,vbeinfo_mod-commands_i386_pc_vbeinfo.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include vbeinfo_mod-commands_i386_pc_vbeinfo.d
 
@@ -2259,10 +2241,10 @@ COMMANDFILES += cmd-vbeinfo_mod-commands_i386_pc_vbeinfo.lst
 FSFILES += fs-vbeinfo_mod-commands_i386_pc_vbeinfo.lst
 
 cmd-vbeinfo_mod-commands_i386_pc_vbeinfo.lst: commands/i386/pc/vbeinfo.c gencmdlist.sh
-       set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbeinfo_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh vbeinfo > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh vbeinfo > $@ || (rm -f $@; exit 1)
 
 fs-vbeinfo_mod-commands_i386_pc_vbeinfo.lst: commands/i386/pc/vbeinfo.c genfslist.sh
-       set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbeinfo_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh vbeinfo > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh vbeinfo > $@ || (rm -f $@; exit 1)
 
 
 vbeinfo_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -2280,15 +2262,15 @@ UNDSYMFILES += und-vbetest.lst
 
 vbetest.mod: pre-vbetest.o mod-vbetest.o
        -rm -f $@
-       $(CC) $(vbetest_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(vbetest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-vbetest.o: vbetest_mod-commands_i386_pc_vbetest.o
        -rm -f $@
-       $(CC) $(vbetest_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(vbetest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-vbetest.o: mod-vbetest.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(vbetest_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -c -o $@ $<
 
 mod-vbetest.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'vbetest' $< > $@ || (rm -f $@; exit 1)
@@ -2303,10 +2285,10 @@ und-vbetest.lst: pre-vbetest.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 vbetest_mod-commands_i386_pc_vbetest.o: commands/i386/pc/vbetest.c
-       $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbetest_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_TARGET_CFLAGS) -c -o $@ $<
 
 vbetest_mod-commands_i386_pc_vbetest.d: commands/i386/pc/vbetest.c
-       set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbetest_mod_CFLAGS) -M $<         | sed 's,vbetest\.o[ :]*,vbetest_mod-commands_i386_pc_vbetest.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_TARGET_CFLAGS) -M $<     | sed 's,vbetest\.o[ :]*,vbetest_mod-commands_i386_pc_vbetest.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include vbetest_mod-commands_i386_pc_vbetest.d
 
@@ -2315,10 +2297,10 @@ COMMANDFILES += cmd-vbetest_mod-commands_i386_pc_vbetest.lst
 FSFILES += fs-vbetest_mod-commands_i386_pc_vbetest.lst
 
 cmd-vbetest_mod-commands_i386_pc_vbetest.lst: commands/i386/pc/vbetest.c gencmdlist.sh
-       set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbetest_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh vbetest > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh vbetest > $@ || (rm -f $@; exit 1)
 
 fs-vbetest_mod-commands_i386_pc_vbetest.lst: commands/i386/pc/vbetest.c genfslist.sh
-       set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(vbetest_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh vbetest > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh vbetest > $@ || (rm -f $@; exit 1)
 
 
 vbetest_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -2336,15 +2318,15 @@ UNDSYMFILES += und-play.lst
 
 play.mod: pre-play.o mod-play.o
        -rm -f $@
-       $(CC) $(play_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-play.o: play_mod-commands_i386_pc_play.o
        -rm -f $@
-       $(CC) $(play_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-play.o: mod-play.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(play_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -c -o $@ $<
 
 mod-play.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'play' $< > $@ || (rm -f $@; exit 1)
@@ -2359,10 +2341,10 @@ und-play.lst: pre-play.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 play_mod-commands_i386_pc_play.o: commands/i386/pc/play.c
-       $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(play_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_TARGET_CFLAGS) -c -o $@ $<
 
 play_mod-commands_i386_pc_play.d: commands/i386/pc/play.c
-       set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(play_mod_CFLAGS) -M $<    | sed 's,play\.o[ :]*,play_mod-commands_i386_pc_play.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_TARGET_CFLAGS) -M $<        | sed 's,play\.o[ :]*,play_mod-commands_i386_pc_play.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include play_mod-commands_i386_pc_play.d
 
@@ -2371,10 +2353,10 @@ COMMANDFILES += cmd-play_mod-commands_i386_pc_play.lst
 FSFILES += fs-play_mod-commands_i386_pc_play.lst
 
 cmd-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c gencmdlist.sh
-       set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(play_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh play > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh play > $@ || (rm -f $@; exit 1)
 
 fs-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c genfslist.sh
-       set -e;           $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) $(play_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh play > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh play > $@ || (rm -f $@; exit 1)
 
 
 play_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -2392,15 +2374,15 @@ UNDSYMFILES += und-video.lst
 
 video.mod: pre-video.o mod-video.o
        -rm -f $@
-       $(CC) $(video_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-video.o: video_mod-video_video.o
        -rm -f $@
-       $(CC) $(video_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-video.o: mod-video.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(video_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -c -o $@ $<
 
 mod-video.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'video' $< > $@ || (rm -f $@; exit 1)
@@ -2415,10 +2397,10 @@ und-video.lst: pre-video.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 video_mod-video_video.o: video/video.c
-       $(CC) -Ivideo -I$(srcdir)/video $(CPPFLAGS) $(CFLAGS) $(video_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_TARGET_CFLAGS) -c -o $@ $<
 
 video_mod-video_video.d: video/video.c
-       set -e;           $(CC) -Ivideo -I$(srcdir)/video $(CPPFLAGS) $(CFLAGS) $(video_mod_CFLAGS) -M $<         | sed 's,video\.o[ :]*,video_mod-video_video.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_TARGET_CFLAGS) -M $<     | sed 's,video\.o[ :]*,video_mod-video_video.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include video_mod-video_video.d
 
@@ -2427,10 +2409,10 @@ COMMANDFILES += cmd-video_mod-video_video.lst
 FSFILES += fs-video_mod-video_video.lst
 
 cmd-video_mod-video_video.lst: video/video.c gencmdlist.sh
-       set -e;           $(CC) -Ivideo -I$(srcdir)/video $(CPPFLAGS) $(CFLAGS) $(video_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh video > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh video > $@ || (rm -f $@; exit 1)
 
 fs-video_mod-video_video.lst: video/video.c genfslist.sh
-       set -e;           $(CC) -Ivideo -I$(srcdir)/video $(CPPFLAGS) $(CFLAGS) $(video_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh video > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh video > $@ || (rm -f $@; exit 1)
 
 
 video_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -2448,15 +2430,15 @@ UNDSYMFILES += und-gfxterm.lst
 
 gfxterm.mod: pre-gfxterm.o mod-gfxterm.o
        -rm -f $@
-       $(CC) $(gfxterm_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-gfxterm.o: gfxterm_mod-term_gfxterm.o
        -rm -f $@
-       $(CC) $(gfxterm_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-gfxterm.o: mod-gfxterm.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(gfxterm_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -c -o $@ $<
 
 mod-gfxterm.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'gfxterm' $< > $@ || (rm -f $@; exit 1)
@@ -2471,10 +2453,10 @@ und-gfxterm.lst: pre-gfxterm.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 gfxterm_mod-term_gfxterm.o: term/gfxterm.c
-       $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(gfxterm_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_TARGET_CFLAGS) -c -o $@ $<
 
 gfxterm_mod-term_gfxterm.d: term/gfxterm.c
-       set -e;           $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(gfxterm_mod_CFLAGS) -M $<         | sed 's,gfxterm\.o[ :]*,gfxterm_mod-term_gfxterm.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_TARGET_CFLAGS) -M $<     | sed 's,gfxterm\.o[ :]*,gfxterm_mod-term_gfxterm.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include gfxterm_mod-term_gfxterm.d
 
@@ -2483,10 +2465,10 @@ COMMANDFILES += cmd-gfxterm_mod-term_gfxterm.lst
 FSFILES += fs-gfxterm_mod-term_gfxterm.lst
 
 cmd-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c gencmdlist.sh
-       set -e;           $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(gfxterm_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh gfxterm > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh gfxterm > $@ || (rm -f $@; exit 1)
 
 fs-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c genfslist.sh
-       set -e;           $(CC) -Iterm -I$(srcdir)/term $(CPPFLAGS) $(CFLAGS) $(gfxterm_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh gfxterm > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh gfxterm > $@ || (rm -f $@; exit 1)
 
 
 gfxterm_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -2504,15 +2486,15 @@ UNDSYMFILES += und-videotest.lst
 
 videotest.mod: pre-videotest.o mod-videotest.o
        -rm -f $@
-       $(CC) $(videotest_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(videotest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-videotest.o: videotest_mod-commands_videotest.o
        -rm -f $@
-       $(CC) $(videotest_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(videotest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-videotest.o: mod-videotest.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(videotest_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -c -o $@ $<
 
 mod-videotest.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'videotest' $< > $@ || (rm -f $@; exit 1)
@@ -2527,10 +2509,10 @@ und-videotest.lst: pre-videotest.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 videotest_mod-commands_videotest.o: commands/videotest.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(videotest_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_TARGET_CFLAGS) -c -o $@ $<
 
 videotest_mod-commands_videotest.d: commands/videotest.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(videotest_mod_CFLAGS) -M $<       | sed 's,videotest\.o[ :]*,videotest_mod-commands_videotest.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_TARGET_CFLAGS) -M $<           | sed 's,videotest\.o[ :]*,videotest_mod-commands_videotest.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include videotest_mod-commands_videotest.d
 
@@ -2539,10 +2521,10 @@ COMMANDFILES += cmd-videotest_mod-commands_videotest.lst
 FSFILES += fs-videotest_mod-commands_videotest.lst
 
 cmd-videotest_mod-commands_videotest.lst: commands/videotest.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(videotest_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh videotest > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh videotest > $@ || (rm -f $@; exit 1)
 
 fs-videotest_mod-commands_videotest.lst: commands/videotest.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(videotest_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh videotest > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh videotest > $@ || (rm -f $@; exit 1)
 
 
 videotest_mod_CFLAGS = $(COMMON_CFLAGS)
index 05e699f381ba6fa6238e7a99546f3643ef80d1a4..e6e3cbc91bf0b82b20f6252f0725d8a50e2963f3 100644 (file)
@@ -52,7 +52,6 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genke
 # Utilities.
 bin_UTILITIES = grub-mkimage
 sbin_UTILITIES = grub-setup grub-emu grub-mkdevicemap grub-probefs
-noinst_UTILITIES = genmoddep
 
 # For grub-mkimage.
 grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \
@@ -103,9 +102,6 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c    \
 
 grub_emu_LDFLAGS = $(LIBCURSES)
 
-# For genmoddep.
-genmoddep_SOURCES = util/genmoddep.c
-
 # Scripts.
 sbin_SCRIPTS = grub-install
 
index d8044f0142d9e6222b2d477b94d3d41d279d254e..ff159f3e9473f1e20cb9d6cfbe66d3ba7c056137 100644 (file)
@@ -28,7 +28,6 @@ pkgdata_PROGRAMS = kernel.elf
 # Utilities.
 bin_UTILITIES = grub-emu
 sbin_UTILITIES = grub-mkimage
-noinst_UTILITIES = genmoddep
 
 # For grub-mkimage.
 grub_mkimage_SOURCES = util/powerpc/ieee1275/grub-mkimage.c util/misc.c \
@@ -37,29 +36,29 @@ CLEANFILES += grub-mkimage grub_mkimage-util_powerpc_ieee1275_grub_mkimage.o gru
 MOSTLYCLEANFILES += grub_mkimage-util_powerpc_ieee1275_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d
 
 grub-mkimage: grub_mkimage-util_powerpc_ieee1275_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o
-       $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_mkimage_LDFLAGS)
+       $(CC) -o $@ $^ $(LDFLAGS) $(grub_mkimage_LDFLAGS)
 
 grub_mkimage-util_powerpc_ieee1275_grub_mkimage.o: util/powerpc/ieee1275/grub-mkimage.c
-       $(BUILD_CC) -Iutil/powerpc/ieee1275 -I$(srcdir)/util/powerpc/ieee1275 $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil/powerpc/ieee1275 -I$(srcdir)/util/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
 
 grub_mkimage-util_powerpc_ieee1275_grub_mkimage.d: util/powerpc/ieee1275/grub-mkimage.c
-       set -e;           $(BUILD_CC) -Iutil/powerpc/ieee1275 -I$(srcdir)/util/powerpc/ieee1275 $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<      | sed 's,grub\-mkimage\.o[ :]*,grub_mkimage-util_powerpc_ieee1275_grub_mkimage.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil/powerpc/ieee1275 -I$(srcdir)/util/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<        | sed 's,grub\-mkimage\.o[ :]*,grub_mkimage-util_powerpc_ieee1275_grub_mkimage.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_mkimage-util_powerpc_ieee1275_grub_mkimage.d
 
 grub_mkimage-util_misc.o: util/misc.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
 
 grub_mkimage-util_misc.d: util/misc.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<        | sed 's,misc\.o[ :]*,grub_mkimage-util_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_mkimage-util_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_mkimage-util_misc.d
 
 grub_mkimage-util_resolve.o: util/resolve.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -c -o $@ $<
 
 grub_mkimage-util_resolve.d: util/resolve.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<        | sed 's,resolve\.o[ :]*,grub_mkimage-util_resolve.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -M $<          | sed 's,resolve\.o[ :]*,grub_mkimage-util_resolve.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_mkimage-util_resolve.d
 
@@ -90,525 +89,525 @@ CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu
 MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_ieee1275_halt.d grub_emu-commands_ieee1275_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_fshelp.d grub_emu-fs_hfs.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_hfsplus.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_i386_pc_biosdisk.d grub_emu-util_i386_pc_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d
 
 grub-emu: grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_fshelp.o grub_emu-fs_hfs.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_hfsplus.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_i386_pc_biosdisk.o grub_emu-util_i386_pc_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o
-       $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(grub_emu_LDFLAGS)
+       $(CC) -o $@ $^ $(LDFLAGS) $(grub_emu_LDFLAGS)
 
 grub_emu-commands_boot.o: commands/boot.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_boot.d: commands/boot.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,boot\.o[ :]*,grub_emu-commands_boot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,boot\.o[ :]*,grub_emu-commands_boot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_boot.d
 
 grub_emu-commands_cat.o: commands/cat.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_cat.d: commands/cat.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,cat\.o[ :]*,grub_emu-commands_cat.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,cat\.o[ :]*,grub_emu-commands_cat.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_cat.d
 
 grub_emu-commands_cmp.o: commands/cmp.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_cmp.d: commands/cmp.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,cmp\.o[ :]*,grub_emu-commands_cmp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,cmp\.o[ :]*,grub_emu-commands_cmp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_cmp.d
 
 grub_emu-commands_configfile.o: commands/configfile.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_configfile.d: commands/configfile.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,configfile\.o[ :]*,grub_emu-commands_configfile.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,configfile\.o[ :]*,grub_emu-commands_configfile.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_configfile.d
 
 grub_emu-commands_help.o: commands/help.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_help.d: commands/help.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,help\.o[ :]*,grub_emu-commands_help.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,help\.o[ :]*,grub_emu-commands_help.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_help.d
 
 grub_emu-commands_search.o: commands/search.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_search.d: commands/search.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,search\.o[ :]*,grub_emu-commands_search.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,search\.o[ :]*,grub_emu-commands_search.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_search.d
 
 grub_emu-commands_terminal.o: commands/terminal.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_terminal.d: commands/terminal.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,terminal\.o[ :]*,grub_emu-commands_terminal.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,terminal\.o[ :]*,grub_emu-commands_terminal.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_terminal.d
 
 grub_emu-commands_test.o: commands/test.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_test.d: commands/test.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,test\.o[ :]*,grub_emu-commands_test.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,test\.o[ :]*,grub_emu-commands_test.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_test.d
 
 grub_emu-commands_ls.o: commands/ls.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_ls.d: commands/ls.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,ls\.o[ :]*,grub_emu-commands_ls.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,ls\.o[ :]*,grub_emu-commands_ls.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_ls.d
 
 grub_emu-commands_blocklist.o: commands/blocklist.c
-       $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_blocklist.d: commands/blocklist.c
-       set -e;           $(BUILD_CC) -Icommands -I$(srcdir)/commands $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,blocklist\.o[ :]*,grub_emu-commands_blocklist.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,blocklist\.o[ :]*,grub_emu-commands_blocklist.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_blocklist.d
 
 grub_emu-commands_ieee1275_halt.o: commands/ieee1275/halt.c
-       $(BUILD_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_ieee1275_halt.d: commands/ieee1275/halt.c
-       set -e;           $(BUILD_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,halt\.o[ :]*,grub_emu-commands_ieee1275_halt.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,halt\.o[ :]*,grub_emu-commands_ieee1275_halt.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_ieee1275_halt.d
 
 grub_emu-commands_ieee1275_reboot.o: commands/ieee1275/reboot.c
-       $(BUILD_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-commands_ieee1275_reboot.d: commands/ieee1275/reboot.c
-       set -e;           $(BUILD_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,reboot\.o[ :]*,grub_emu-commands_ieee1275_reboot.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,reboot\.o[ :]*,grub_emu-commands_ieee1275_reboot.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include grub_emu-commands_ieee1275_reboot.d
 
 grub_emu-disk_loopback.o: disk/loopback.c
-       $(BUILD_CC) -Idisk -I$(srcdir)/disk $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-disk_loopback.d: disk/loopback.c
-       set -e;           $(BUILD_CC) -Idisk -I$(srcdir)/disk $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,loopback\.o[ :]*,grub_emu-disk_loopback.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,loopback\.o[ :]*,grub_emu-disk_loopback.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-disk_loopback.d
 
 grub_emu-fs_affs.o: fs/affs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_affs.d: fs/affs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,affs\.o[ :]*,grub_emu-fs_affs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,affs\.o[ :]*,grub_emu-fs_affs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_affs.d
 
 grub_emu-fs_ext2.o: fs/ext2.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_ext2.d: fs/ext2.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,ext2\.o[ :]*,grub_emu-fs_ext2.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,ext2\.o[ :]*,grub_emu-fs_ext2.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_ext2.d
 
 grub_emu-fs_fat.o: fs/fat.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_fat.d: fs/fat.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,fat\.o[ :]*,grub_emu-fs_fat.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,fat\.o[ :]*,grub_emu-fs_fat.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_fat.d
 
 grub_emu-fs_fshelp.o: fs/fshelp.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_fshelp.d: fs/fshelp.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,fshelp\.o[ :]*,grub_emu-fs_fshelp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,fshelp\.o[ :]*,grub_emu-fs_fshelp.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_fshelp.d
 
 grub_emu-fs_hfs.o: fs/hfs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_hfs.d: fs/hfs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,hfs\.o[ :]*,grub_emu-fs_hfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,hfs\.o[ :]*,grub_emu-fs_hfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_hfs.d
 
 grub_emu-fs_iso9660.o: fs/iso9660.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_iso9660.d: fs/iso9660.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,iso9660\.o[ :]*,grub_emu-fs_iso9660.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,iso9660\.o[ :]*,grub_emu-fs_iso9660.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_iso9660.d
 
 grub_emu-fs_jfs.o: fs/jfs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_jfs.d: fs/jfs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,jfs\.o[ :]*,grub_emu-fs_jfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,jfs\.o[ :]*,grub_emu-fs_jfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_jfs.d
 
 grub_emu-fs_minix.o: fs/minix.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_minix.d: fs/minix.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,minix\.o[ :]*,grub_emu-fs_minix.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,minix\.o[ :]*,grub_emu-fs_minix.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_minix.d
 
 grub_emu-fs_sfs.o: fs/sfs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_sfs.d: fs/sfs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,sfs\.o[ :]*,grub_emu-fs_sfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,sfs\.o[ :]*,grub_emu-fs_sfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_sfs.d
 
 grub_emu-fs_ufs.o: fs/ufs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_ufs.d: fs/ufs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,ufs\.o[ :]*,grub_emu-fs_ufs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,ufs\.o[ :]*,grub_emu-fs_ufs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_ufs.d
 
 grub_emu-fs_xfs.o: fs/xfs.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_xfs.d: fs/xfs.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,xfs\.o[ :]*,grub_emu-fs_xfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,xfs\.o[ :]*,grub_emu-fs_xfs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_xfs.d
 
 grub_emu-fs_hfsplus.o: fs/hfsplus.c
-       $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-fs_hfsplus.d: fs/hfsplus.c
-       set -e;           $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,hfsplus\.o[ :]*,grub_emu-fs_hfsplus.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,hfsplus\.o[ :]*,grub_emu-fs_hfsplus.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-fs_hfsplus.d
 
 grub_emu-io_gzio.o: io/gzio.c
-       $(BUILD_CC) -Iio -I$(srcdir)/io $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-io_gzio.d: io/gzio.c
-       set -e;           $(BUILD_CC) -Iio -I$(srcdir)/io $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,gzio\.o[ :]*,grub_emu-io_gzio.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,gzio\.o[ :]*,grub_emu-io_gzio.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-io_gzio.d
 
 grub_emu-kern_device.o: kern/device.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_device.d: kern/device.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,device\.o[ :]*,grub_emu-kern_device.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,device\.o[ :]*,grub_emu-kern_device.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_device.d
 
 grub_emu-kern_disk.o: kern/disk.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_disk.d: kern/disk.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,disk\.o[ :]*,grub_emu-kern_disk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,disk\.o[ :]*,grub_emu-kern_disk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_disk.d
 
 grub_emu-kern_dl.o: kern/dl.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_dl.d: kern/dl.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,dl\.o[ :]*,grub_emu-kern_dl.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,dl\.o[ :]*,grub_emu-kern_dl.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_dl.d
 
 grub_emu-kern_env.o: kern/env.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_env.d: kern/env.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,env\.o[ :]*,grub_emu-kern_env.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,env\.o[ :]*,grub_emu-kern_env.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_env.d
 
 grub_emu-kern_err.o: kern/err.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_err.d: kern/err.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,err\.o[ :]*,grub_emu-kern_err.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,err\.o[ :]*,grub_emu-kern_err.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_err.d
 
 grub_emu-kern_file.o: kern/file.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_file.d: kern/file.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,file\.o[ :]*,grub_emu-kern_file.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,file\.o[ :]*,grub_emu-kern_file.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_file.d
 
 grub_emu-kern_fs.o: kern/fs.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_fs.d: kern/fs.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,fs\.o[ :]*,grub_emu-kern_fs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,fs\.o[ :]*,grub_emu-kern_fs.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_fs.d
 
 grub_emu-kern_loader.o: kern/loader.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_loader.d: kern/loader.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,loader\.o[ :]*,grub_emu-kern_loader.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,loader\.o[ :]*,grub_emu-kern_loader.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_loader.d
 
 grub_emu-kern_main.o: kern/main.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_main.d: kern/main.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,main\.o[ :]*,grub_emu-kern_main.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,main\.o[ :]*,grub_emu-kern_main.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_main.d
 
 grub_emu-kern_misc.o: kern/misc.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_misc.d: kern/misc.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_emu-kern_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,grub_emu-kern_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_misc.d
 
 grub_emu-kern_parser.o: kern/parser.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_parser.d: kern/parser.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,parser\.o[ :]*,grub_emu-kern_parser.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,parser\.o[ :]*,grub_emu-kern_parser.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_parser.d
 
 grub_emu-kern_partition.o: kern/partition.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_partition.d: kern/partition.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,partition\.o[ :]*,grub_emu-kern_partition.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,partition\.o[ :]*,grub_emu-kern_partition.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_partition.d
 
 grub_emu-kern_rescue.o: kern/rescue.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_rescue.d: kern/rescue.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,rescue\.o[ :]*,grub_emu-kern_rescue.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,rescue\.o[ :]*,grub_emu-kern_rescue.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_rescue.d
 
 grub_emu-kern_term.o: kern/term.c
-       $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-kern_term.d: kern/term.c
-       set -e;           $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,term\.o[ :]*,grub_emu-kern_term.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,term\.o[ :]*,grub_emu-kern_term.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-kern_term.d
 
 grub_emu-normal_arg.o: normal/arg.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_arg.d: normal/arg.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,arg\.o[ :]*,grub_emu-normal_arg.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,arg\.o[ :]*,grub_emu-normal_arg.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_arg.d
 
 grub_emu-normal_cmdline.o: normal/cmdline.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_cmdline.d: normal/cmdline.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,cmdline\.o[ :]*,grub_emu-normal_cmdline.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,cmdline\.o[ :]*,grub_emu-normal_cmdline.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_cmdline.d
 
 grub_emu-normal_command.o: normal/command.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_command.d: normal/command.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,command\.o[ :]*,grub_emu-normal_command.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,command\.o[ :]*,grub_emu-normal_command.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_command.d
 
 grub_emu-normal_completion.o: normal/completion.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_completion.d: normal/completion.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,completion\.o[ :]*,grub_emu-normal_completion.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,completion\.o[ :]*,grub_emu-normal_completion.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_completion.d
 
 grub_emu-normal_execute.o: normal/execute.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_execute.d: normal/execute.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,execute\.o[ :]*,grub_emu-normal_execute.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,execute\.o[ :]*,grub_emu-normal_execute.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_execute.d
 
 grub_emu-normal_function.o: normal/function.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_function.d: normal/function.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,function\.o[ :]*,grub_emu-normal_function.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,function\.o[ :]*,grub_emu-normal_function.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_function.d
 
 grub_emu-normal_lexer.o: normal/lexer.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_lexer.d: normal/lexer.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,lexer\.o[ :]*,grub_emu-normal_lexer.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,lexer\.o[ :]*,grub_emu-normal_lexer.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_lexer.d
 
 grub_emu-normal_main.o: normal/main.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_main.d: normal/main.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,main\.o[ :]*,grub_emu-normal_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,main\.o[ :]*,grub_emu-normal_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_main.d
 
 grub_emu-normal_menu.o: normal/menu.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_menu.d: normal/menu.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,menu\.o[ :]*,grub_emu-normal_menu.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,menu\.o[ :]*,grub_emu-normal_menu.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_menu.d
 
 grub_emu-normal_menu_entry.o: normal/menu_entry.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_menu_entry.d: normal/menu_entry.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,menu_entry\.o[ :]*,grub_emu-normal_menu_entry.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,menu_entry\.o[ :]*,grub_emu-normal_menu_entry.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_menu_entry.d
 
 grub_emu-normal_misc.o: normal/misc.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_misc.d: normal/misc.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,misc\.o[ :]*,grub_emu-normal_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_emu-normal_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_misc.d
 
 grub_emu-normal_script.o: normal/script.c
-       $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-normal_script.d: normal/script.c
-       set -e;           $(BUILD_CC) -Inormal -I$(srcdir)/normal $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,script\.o[ :]*,grub_emu-normal_script.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,script\.o[ :]*,grub_emu-normal_script.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-normal_script.d
 
 grub_emu-partmap_amiga.o: partmap/amiga.c
-       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-partmap_amiga.d: partmap/amiga.c
-       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,amiga\.o[ :]*,grub_emu-partmap_amiga.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,amiga\.o[ :]*,grub_emu-partmap_amiga.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include grub_emu-partmap_amiga.d
 
 grub_emu-partmap_apple.o: partmap/apple.c
-       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-partmap_apple.d: partmap/apple.c
-       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,apple\.o[ :]*,grub_emu-partmap_apple.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,apple\.o[ :]*,grub_emu-partmap_apple.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include grub_emu-partmap_apple.d
 
 grub_emu-partmap_pc.o: partmap/pc.c
-       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-partmap_pc.d: partmap/pc.c
-       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,pc\.o[ :]*,grub_emu-partmap_pc.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,pc\.o[ :]*,grub_emu-partmap_pc.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
 
 -include grub_emu-partmap_pc.d
 
 grub_emu-partmap_sun.o: partmap/sun.c
-       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-partmap_sun.d: partmap/sun.c
-       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,sun\.o[ :]*,grub_emu-partmap_sun.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,sun\.o[ :]*,grub_emu-partmap_sun.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include grub_emu-partmap_sun.d
 
 grub_emu-partmap_acorn.o: partmap/acorn.c
-       $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-partmap_acorn.d: partmap/acorn.c
-       set -e;           $(BUILD_CC) -Ipartmap -I$(srcdir)/partmap $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,acorn\.o[ :]*,grub_emu-partmap_acorn.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<        | sed 's,acorn\.o[ :]*,grub_emu-partmap_acorn.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include grub_emu-partmap_acorn.d
 
 grub_emu-util_console.o: util/console.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-util_console.d: util/console.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,console\.o[ :]*,grub_emu-util_console.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,console\.o[ :]*,grub_emu-util_console.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-util_console.d
 
 grub_emu-util_grub_emu.o: util/grub-emu.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-util_grub_emu.d: util/grub-emu.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,grub\-emu\.o[ :]*,grub_emu-util_grub_emu.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,grub\-emu\.o[ :]*,grub_emu-util_grub_emu.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include grub_emu-util_grub_emu.d
 
 grub_emu-util_misc.o: util/misc.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-util_misc.d: util/misc.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_emu-util_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,grub_emu-util_misc.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-util_misc.d
 
 grub_emu-util_i386_pc_biosdisk.o: util/i386/pc/biosdisk.c
-       $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-util_i386_pc_biosdisk.d: util/i386/pc/biosdisk.c
-       set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,biosdisk\.o[ :]*,grub_emu-util_i386_pc_biosdisk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,biosdisk\.o[ :]*,grub_emu-util_i386_pc_biosdisk.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include grub_emu-util_i386_pc_biosdisk.d
 
 grub_emu-util_i386_pc_getroot.o: util/i386/pc/getroot.c
-       $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-util_i386_pc_getroot.d: util/i386/pc/getroot.c
-       set -e;           $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,getroot\.o[ :]*,grub_emu-util_i386_pc_getroot.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<      | sed 's,getroot\.o[ :]*,grub_emu-util_i386_pc_getroot.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include grub_emu-util_i386_pc_getroot.d
 
 grub_emu-util_powerpc_ieee1275_misc.o: util/powerpc/ieee1275/misc.c
-       $(BUILD_CC) -Iutil/powerpc/ieee1275 -I$(srcdir)/util/powerpc/ieee1275 $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -Iutil/powerpc/ieee1275 -I$(srcdir)/util/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-util_powerpc_ieee1275_misc.d: util/powerpc/ieee1275/misc.c
-       set -e;           $(BUILD_CC) -Iutil/powerpc/ieee1275 -I$(srcdir)/util/powerpc/ieee1275 $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,grub_emu-util_powerpc_ieee1275_misc.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -Iutil/powerpc/ieee1275 -I$(srcdir)/util/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,misc\.o[ :]*,grub_emu-util_powerpc_ieee1275_misc.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include grub_emu-util_powerpc_ieee1275_misc.d
 
 grub_emu-grub_script_tab.o: grub_script.tab.c
-       $(BUILD_CC) -I. -I$(srcdir)/. $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-grub_script_tab.d: grub_script.tab.c
-       set -e;           $(BUILD_CC) -I. -I$(srcdir)/. $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,grub_script\.tab\.o[ :]*,grub_emu-grub_script_tab.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,grub_script\.tab\.o[ :]*,grub_emu-grub_script_tab.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include grub_emu-grub_script_tab.d
 
 grub_emu-grub_emu_init.o: grub_emu_init.c
-       $(BUILD_CC) -I. -I$(srcdir)/. $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
+       $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -c -o $@ $<
 
 grub_emu-grub_emu_init.d: grub_emu_init.c
-       set -e;           $(BUILD_CC) -I. -I$(srcdir)/. $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<          | sed 's,grub_emu_init\.o[ :]*,grub_emu-grub_emu_init.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -M $<    | sed 's,grub_emu_init\.o[ :]*,grub_emu-grub_emu_init.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include grub_emu-grub_emu_init.d
 
@@ -627,205 +626,205 @@ CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern
 MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_crt0.d kernel_elf-kern_powerpc_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_powerpc_ieee1275_init.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_powerpc_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-kernel_elf_symlist.d kernel_elf-kern_powerpc_cache.d
 
 kernel.elf: kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_powerpc_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_powerpc_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_powerpc_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_powerpc_cache.o
-       $(CC) -o $@ $^ $(LDFLAGS) $(kernel_elf_LDFLAGS)
+       $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS)
 
 kernel_elf-kern_powerpc_ieee1275_crt0.o: kern/powerpc/ieee1275/crt0.S
-       $(CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_powerpc_ieee1275_crt0.d: kern/powerpc/ieee1275/crt0.S
-       set -e;           $(CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<        | sed 's,crt0\.o[ :]*,kernel_elf-kern_powerpc_ieee1275_crt0.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,crt0\.o[ :]*,kernel_elf-kern_powerpc_ieee1275_crt0.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_powerpc_ieee1275_crt0.d
 
 kernel_elf-kern_powerpc_ieee1275_cmain.o: kern/powerpc/ieee1275/cmain.c
-       $(CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_powerpc_ieee1275_cmain.d: kern/powerpc/ieee1275/cmain.c
-       set -e;           $(CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<        | sed 's,cmain\.o[ :]*,kernel_elf-kern_powerpc_ieee1275_cmain.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,cmain\.o[ :]*,kernel_elf-kern_powerpc_ieee1275_cmain.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_powerpc_ieee1275_cmain.d
 
 kernel_elf-kern_ieee1275_ieee1275.o: kern/ieee1275/ieee1275.c
-       $(CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_ieee1275_ieee1275.d: kern/ieee1275/ieee1275.c
-       set -e;           $(CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<        | sed 's,ieee1275\.o[ :]*,kernel_elf-kern_ieee1275_ieee1275.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,ieee1275\.o[ :]*,kernel_elf-kern_ieee1275_ieee1275.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_ieee1275_ieee1275.d
 
 kernel_elf-kern_main.o: kern/main.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_main.d: kern/main.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,main\.o[ :]*,kernel_elf-kern_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,main\.o[ :]*,kernel_elf-kern_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_main.d
 
 kernel_elf-kern_device.o: kern/device.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_device.d: kern/device.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,device\.o[ :]*,kernel_elf-kern_device.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,device\.o[ :]*,kernel_elf-kern_device.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_device.d
 
 kernel_elf-kern_disk.o: kern/disk.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_disk.d: kern/disk.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,disk\.o[ :]*,kernel_elf-kern_disk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,disk\.o[ :]*,kernel_elf-kern_disk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_disk.d
 
 kernel_elf-kern_dl.o: kern/dl.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_dl.d: kern/dl.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,dl\.o[ :]*,kernel_elf-kern_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,dl\.o[ :]*,kernel_elf-kern_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_dl.d
 
 kernel_elf-kern_file.o: kern/file.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_file.d: kern/file.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,file\.o[ :]*,kernel_elf-kern_file.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,file\.o[ :]*,kernel_elf-kern_file.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_file.d
 
 kernel_elf-kern_fs.o: kern/fs.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_fs.d: kern/fs.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,fs\.o[ :]*,kernel_elf-kern_fs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,fs\.o[ :]*,kernel_elf-kern_fs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_fs.d
 
 kernel_elf-kern_err.o: kern/err.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_err.d: kern/err.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,err\.o[ :]*,kernel_elf-kern_err.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,err\.o[ :]*,kernel_elf-kern_err.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_err.d
 
 kernel_elf-kern_misc.o: kern/misc.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_misc.d: kern/misc.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,kernel_elf-kern_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,misc\.o[ :]*,kernel_elf-kern_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_misc.d
 
 kernel_elf-kern_mm.o: kern/mm.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_mm.d: kern/mm.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,mm\.o[ :]*,kernel_elf-kern_mm.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,mm\.o[ :]*,kernel_elf-kern_mm.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_mm.d
 
 kernel_elf-kern_loader.o: kern/loader.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_loader.d: kern/loader.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,loader\.o[ :]*,kernel_elf-kern_loader.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,loader\.o[ :]*,kernel_elf-kern_loader.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_loader.d
 
 kernel_elf-kern_rescue.o: kern/rescue.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_rescue.d: kern/rescue.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,rescue\.o[ :]*,kernel_elf-kern_rescue.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,rescue\.o[ :]*,kernel_elf-kern_rescue.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_rescue.d
 
 kernel_elf-kern_term.o: kern/term.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_term.d: kern/term.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,term\.o[ :]*,kernel_elf-kern_term.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,term\.o[ :]*,kernel_elf-kern_term.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_term.d
 
 kernel_elf-kern_powerpc_ieee1275_init.o: kern/powerpc/ieee1275/init.c
-       $(CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_powerpc_ieee1275_init.d: kern/powerpc/ieee1275/init.c
-       set -e;           $(CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<        | sed 's,init\.o[ :]*,kernel_elf-kern_powerpc_ieee1275_init.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,init\.o[ :]*,kernel_elf-kern_powerpc_ieee1275_init.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_powerpc_ieee1275_init.d
 
 kernel_elf-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c
-       $(CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-term_ieee1275_ofconsole.d: term/ieee1275/ofconsole.c
-       set -e;           $(CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<        | sed 's,ofconsole\.o[ :]*,kernel_elf-term_ieee1275_ofconsole.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,ofconsole\.o[ :]*,kernel_elf-term_ieee1275_ofconsole.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include kernel_elf-term_ieee1275_ofconsole.d
 
 kernel_elf-kern_powerpc_ieee1275_openfw.o: kern/powerpc/ieee1275/openfw.c
-       $(CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_powerpc_ieee1275_openfw.d: kern/powerpc/ieee1275/openfw.c
-       set -e;           $(CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<        | sed 's,openfw\.o[ :]*,kernel_elf-kern_powerpc_ieee1275_openfw.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,openfw\.o[ :]*,kernel_elf-kern_powerpc_ieee1275_openfw.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_powerpc_ieee1275_openfw.d
 
 kernel_elf-disk_ieee1275_ofdisk.o: disk/ieee1275/ofdisk.c
-       $(CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-disk_ieee1275_ofdisk.d: disk/ieee1275/ofdisk.c
-       set -e;           $(CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<        | sed 's,ofdisk\.o[ :]*,kernel_elf-disk_ieee1275_ofdisk.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,ofdisk\.o[ :]*,kernel_elf-disk_ieee1275_ofdisk.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
 
 -include kernel_elf-disk_ieee1275_ofdisk.d
 
 kernel_elf-kern_parser.o: kern/parser.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_parser.d: kern/parser.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,parser\.o[ :]*,kernel_elf-kern_parser.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,parser\.o[ :]*,kernel_elf-kern_parser.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_parser.d
 
 kernel_elf-kern_partition.o: kern/partition.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_partition.d: kern/partition.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,partition\.o[ :]*,kernel_elf-kern_partition.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,partition\.o[ :]*,kernel_elf-kern_partition.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_partition.d
 
 kernel_elf-kern_env.o: kern/env.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_env.d: kern/env.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,env\.o[ :]*,kernel_elf-kern_env.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,env\.o[ :]*,kernel_elf-kern_env.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_env.d
 
 kernel_elf-kern_powerpc_dl.o: kern/powerpc/dl.c
-       $(CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_powerpc_dl.d: kern/powerpc/dl.c
-       set -e;           $(CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,dl\.o[ :]*,kernel_elf-kern_powerpc_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,dl\.o[ :]*,kernel_elf-kern_powerpc_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_powerpc_dl.d
 
 kernel_elf-kernel_elf_symlist.o: kernel_elf_symlist.c
-       $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kernel_elf_symlist.d: kernel_elf_symlist.c
-       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<        | sed 's,kernel_elf_symlist\.o[ :]*,kernel_elf-kernel_elf_symlist.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,kernel_elf_symlist\.o[ :]*,kernel_elf-kernel_elf_symlist.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kernel_elf_symlist.d
 
 kernel_elf-kern_powerpc_cache.o: kern/powerpc/cache.S
-       $(CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_powerpc_cache.d: kern/powerpc/cache.S
-       set -e;           $(CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,cache\.o[ :]*,kernel_elf-kern_powerpc_cache.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,cache\.o[ :]*,kernel_elf-kern_powerpc_cache.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_powerpc_cache.d
 
@@ -835,23 +834,6 @@ kernel_elf_ASFLAGS = $(COMMON_ASFLAGS)
 kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \
        -Wl,-N,-S,-Ttext,0x200000,-Bstatic
 
-# For genmoddep.
-genmoddep_SOURCES = util/genmoddep.c
-CLEANFILES += genmoddep genmoddep-util_genmoddep.o
-MOSTLYCLEANFILES += genmoddep-util_genmoddep.d
-
-genmoddep: genmoddep-util_genmoddep.o
-       $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(genmoddep_LDFLAGS)
-
-genmoddep-util_genmoddep.o: util/genmoddep.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(genmoddep_CFLAGS) -c -o $@ $<
-
-genmoddep-util_genmoddep.d: util/genmoddep.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(genmoddep_CFLAGS) -M $<           | sed 's,genmoddep\.o[ :]*,genmoddep-util_genmoddep.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-
--include genmoddep-util_genmoddep.d
-
-
 # Scripts.
 sbin_SCRIPTS = grub-install
 
@@ -884,15 +866,15 @@ UNDSYMFILES += und-_linux.lst
 
 _linux.mod: pre-_linux.o mod-_linux.o
        -rm -f $@
-       $(CC) $(_linux_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-_linux.o: _linux_mod-loader_powerpc_ieee1275_linux.o
        -rm -f $@
-       $(CC) $(_linux_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-_linux.o: mod-_linux.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
 
 mod-_linux.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1)
@@ -907,10 +889,10 @@ und-_linux.lst: pre-_linux.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 _linux_mod-loader_powerpc_ieee1275_linux.o: loader/powerpc/ieee1275/linux.c
-       $(CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_TARGET_CFLAGS) -c -o $@ $<
 
 _linux_mod-loader_powerpc_ieee1275_linux.d: loader/powerpc/ieee1275/linux.c
-       set -e;           $(CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -M $<    | sed 's,linux\.o[ :]*,_linux_mod-loader_powerpc_ieee1275_linux.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_TARGET_CFLAGS) -M $<        | sed 's,linux\.o[ :]*,_linux_mod-loader_powerpc_ieee1275_linux.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
 
 -include _linux_mod-loader_powerpc_ieee1275_linux.d
 
@@ -919,10 +901,10 @@ COMMANDFILES += cmd-_linux_mod-loader_powerpc_ieee1275_linux.lst
 FSFILES += fs-_linux_mod-loader_powerpc_ieee1275_linux.lst
 
 cmd-_linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c gencmdlist.sh
-       set -e;           $(CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1)
 
 fs-_linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c genfslist.sh
-       set -e;           $(CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1)
 
 
 _linux_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -940,15 +922,15 @@ UNDSYMFILES += und-linux.lst
 
 linux.mod: pre-linux.o mod-linux.o
        -rm -f $@
-       $(CC) $(linux_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-linux.o: linux_mod-loader_powerpc_ieee1275_linux_normal.o
        -rm -f $@
-       $(CC) $(linux_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-linux.o: mod-linux.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
 
 mod-linux.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1)
@@ -963,10 +945,10 @@ und-linux.lst: pre-linux.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 linux_mod-loader_powerpc_ieee1275_linux_normal.o: loader/powerpc/ieee1275/linux_normal.c
-       $(CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_TARGET_CFLAGS) -c -o $@ $<
 
 linux_mod-loader_powerpc_ieee1275_linux_normal.d: loader/powerpc/ieee1275/linux_normal.c
-       set -e;           $(CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -M $<     | sed 's,linux_normal\.o[ :]*,linux_mod-loader_powerpc_ieee1275_linux_normal.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_TARGET_CFLAGS) -M $<         | sed 's,linux_normal\.o[ :]*,linux_mod-loader_powerpc_ieee1275_linux_normal.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include linux_mod-loader_powerpc_ieee1275_linux_normal.d
 
@@ -975,10 +957,10 @@ COMMANDFILES += cmd-linux_mod-loader_powerpc_ieee1275_linux_normal.lst
 FSFILES += fs-linux_mod-loader_powerpc_ieee1275_linux_normal.lst
 
 cmd-linux_mod-loader_powerpc_ieee1275_linux_normal.lst: loader/powerpc/ieee1275/linux_normal.c gencmdlist.sh
-       set -e;           $(CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1)
 
 fs-linux_mod-loader_powerpc_ieee1275_linux_normal.lst: loader/powerpc/ieee1275/linux_normal.c genfslist.sh
-       set -e;           $(CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(linux_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1)
 
 
 linux_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1000,15 +982,15 @@ UNDSYMFILES += und-normal.lst
 
 normal.mod: pre-normal.o mod-normal.o
        -rm -f $@
-       $(CC) $(normal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o
        -rm -f $@
-       $(CC) $(normal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-normal.o: mod-normal.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
 
 mod-normal.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1)
@@ -1023,10 +1005,10 @@ und-normal.lst: pre-normal.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 normal_mod-normal_arg.o: normal/arg.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_arg.d: normal/arg.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,arg\.o[ :]*,normal_mod-normal_arg.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,arg\.o[ :]*,normal_mod-normal_arg.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_arg.d
 
@@ -1035,17 +1017,17 @@ COMMANDFILES += cmd-normal_mod-normal_arg.lst
 FSFILES += fs-normal_mod-normal_arg.lst
 
 cmd-normal_mod-normal_arg.lst: normal/arg.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_arg.lst: normal/arg.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_cmdline.o: normal/cmdline.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_cmdline.d: normal/cmdline.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,cmdline\.o[ :]*,normal_mod-normal_cmdline.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,cmdline\.o[ :]*,normal_mod-normal_cmdline.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_cmdline.d
 
@@ -1054,17 +1036,17 @@ COMMANDFILES += cmd-normal_mod-normal_cmdline.lst
 FSFILES += fs-normal_mod-normal_cmdline.lst
 
 cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_cmdline.lst: normal/cmdline.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_command.o: normal/command.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_command.d: normal/command.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,command\.o[ :]*,normal_mod-normal_command.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,command\.o[ :]*,normal_mod-normal_command.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_command.d
 
@@ -1073,17 +1055,17 @@ COMMANDFILES += cmd-normal_mod-normal_command.lst
 FSFILES += fs-normal_mod-normal_command.lst
 
 cmd-normal_mod-normal_command.lst: normal/command.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_command.lst: normal/command.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_completion.o: normal/completion.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_completion.d: normal/completion.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,completion\.o[ :]*,normal_mod-normal_completion.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,completion\.o[ :]*,normal_mod-normal_completion.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_completion.d
 
@@ -1092,17 +1074,17 @@ COMMANDFILES += cmd-normal_mod-normal_completion.lst
 FSFILES += fs-normal_mod-normal_completion.lst
 
 cmd-normal_mod-normal_completion.lst: normal/completion.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_completion.lst: normal/completion.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_execute.o: normal/execute.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_execute.d: normal/execute.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,execute\.o[ :]*,normal_mod-normal_execute.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,execute\.o[ :]*,normal_mod-normal_execute.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_execute.d
 
@@ -1111,17 +1093,17 @@ COMMANDFILES += cmd-normal_mod-normal_execute.lst
 FSFILES += fs-normal_mod-normal_execute.lst
 
 cmd-normal_mod-normal_execute.lst: normal/execute.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_execute.lst: normal/execute.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_function.o: normal/function.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_function.d: normal/function.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,function\.o[ :]*,normal_mod-normal_function.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,function\.o[ :]*,normal_mod-normal_function.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_function.d
 
@@ -1130,17 +1112,17 @@ COMMANDFILES += cmd-normal_mod-normal_function.lst
 FSFILES += fs-normal_mod-normal_function.lst
 
 cmd-normal_mod-normal_function.lst: normal/function.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_function.lst: normal/function.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_lexer.o: normal/lexer.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_lexer.d: normal/lexer.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,lexer\.o[ :]*,normal_mod-normal_lexer.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,lexer\.o[ :]*,normal_mod-normal_lexer.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_lexer.d
 
@@ -1149,17 +1131,17 @@ COMMANDFILES += cmd-normal_mod-normal_lexer.lst
 FSFILES += fs-normal_mod-normal_lexer.lst
 
 cmd-normal_mod-normal_lexer.lst: normal/lexer.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_lexer.lst: normal/lexer.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_main.o: normal/main.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_main.d: normal/main.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,main\.o[ :]*,normal_mod-normal_main.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,main\.o[ :]*,normal_mod-normal_main.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_main.d
 
@@ -1168,17 +1150,17 @@ COMMANDFILES += cmd-normal_mod-normal_main.lst
 FSFILES += fs-normal_mod-normal_main.lst
 
 cmd-normal_mod-normal_main.lst: normal/main.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_main.lst: normal/main.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_menu.o: normal/menu.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_menu.d: normal/menu.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,menu\.o[ :]*,normal_mod-normal_menu.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,menu\.o[ :]*,normal_mod-normal_menu.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_menu.d
 
@@ -1187,17 +1169,17 @@ COMMANDFILES += cmd-normal_mod-normal_menu.lst
 FSFILES += fs-normal_mod-normal_menu.lst
 
 cmd-normal_mod-normal_menu.lst: normal/menu.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_menu.lst: normal/menu.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_menu_entry.o: normal/menu_entry.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_menu_entry.d: normal/menu_entry.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,menu_entry\.o[ :]*,normal_mod-normal_menu_entry.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,menu_entry\.o[ :]*,normal_mod-normal_menu_entry.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_menu_entry.d
 
@@ -1206,17 +1188,17 @@ COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst
 FSFILES += fs-normal_mod-normal_menu_entry.lst
 
 cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_misc.o: normal/misc.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_misc.d: normal/misc.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,normal_mod-normal_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,normal_mod-normal_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_misc.d
 
@@ -1225,17 +1207,17 @@ COMMANDFILES += cmd-normal_mod-normal_misc.lst
 FSFILES += fs-normal_mod-normal_misc.lst
 
 cmd-normal_mod-normal_misc.lst: normal/misc.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_misc.lst: normal/misc.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-grub_script_tab.o: grub_script.tab.c
-       $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-grub_script_tab.d: grub_script.tab.c
-       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<        | sed 's,grub_script\.tab\.o[ :]*,normal_mod-grub_script_tab.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<    | sed 's,grub_script\.tab\.o[ :]*,normal_mod-grub_script_tab.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-grub_script_tab.d
 
@@ -1244,17 +1226,17 @@ COMMANDFILES += cmd-normal_mod-grub_script_tab.lst
 FSFILES += fs-normal_mod-grub_script_tab.lst
 
 cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c gencmdlist.sh
-       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-grub_script_tab.lst: grub_script.tab.c genfslist.sh
-       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_script.o: normal/script.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_script.d: normal/script.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,script\.o[ :]*,normal_mod-normal_script.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,script\.o[ :]*,normal_mod-normal_script.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_script.d
 
@@ -1263,17 +1245,17 @@ COMMANDFILES += cmd-normal_mod-normal_script.lst
 FSFILES += fs-normal_mod-normal_script.lst
 
 cmd-normal_mod-normal_script.lst: normal/script.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_script.lst: normal/script.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_powerpc_setjmp.o: normal/powerpc/setjmp.S
-       $(CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_TARGET_ASFLAGS) -c -o $@ $<
 
 normal_mod-normal_powerpc_setjmp.d: normal/powerpc/setjmp.S
-       set -e;           $(CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -M $<    | sed 's,setjmp\.o[ :]*,normal_mod-normal_powerpc_setjmp.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_TARGET_ASFLAGS) -M $<        | sed 's,setjmp\.o[ :]*,normal_mod-normal_powerpc_setjmp.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_powerpc_setjmp.d
 
@@ -1282,10 +1264,10 @@ COMMANDFILES += cmd-normal_mod-normal_powerpc_setjmp.lst
 FSFILES += fs-normal_mod-normal_powerpc_setjmp.lst
 
 cmd-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S gencmdlist.sh
-       set -e;           $(CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_TARGET_ASFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S genfslist.sh
-       set -e;           $(CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -E $<    | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_TARGET_ASFLAGS) -E $<        | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1304,15 +1286,15 @@ UNDSYMFILES += und-suspend.lst
 
 suspend.mod: pre-suspend.o mod-suspend.o
        -rm -f $@
-       $(CC) $(suspend_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-suspend.o: suspend_mod-commands_ieee1275_suspend.o
        -rm -f $@
-       $(CC) $(suspend_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-suspend.o: mod-suspend.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $<
 
 mod-suspend.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'suspend' $< > $@ || (rm -f $@; exit 1)
@@ -1327,10 +1309,10 @@ und-suspend.lst: pre-suspend.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 suspend_mod-commands_ieee1275_suspend.o: commands/ieee1275/suspend.c
-       $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_TARGET_CFLAGS) -c -o $@ $<
 
 suspend_mod-commands_ieee1275_suspend.d: commands/ieee1275/suspend.c
-       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -M $<       | sed 's,suspend\.o[ :]*,suspend_mod-commands_ieee1275_suspend.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_TARGET_CFLAGS) -M $<           | sed 's,suspend\.o[ :]*,suspend_mod-commands_ieee1275_suspend.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include suspend_mod-commands_ieee1275_suspend.d
 
@@ -1339,10 +1321,10 @@ COMMANDFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst
 FSFILES += fs-suspend_mod-commands_ieee1275_suspend.lst
 
 cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c gencmdlist.sh
-       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1)
 
 fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c genfslist.sh
-       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1)
 
 
 suspend_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1360,15 +1342,15 @@ UNDSYMFILES += und-reboot.lst
 
 reboot.mod: pre-reboot.o mod-reboot.o
        -rm -f $@
-       $(CC) $(reboot_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-reboot.o: reboot_mod-commands_ieee1275_reboot.o
        -rm -f $@
-       $(CC) $(reboot_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-reboot.o: mod-reboot.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
 
 mod-reboot.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1)
@@ -1383,10 +1365,10 @@ und-reboot.lst: pre-reboot.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 reboot_mod-commands_ieee1275_reboot.o: commands/ieee1275/reboot.c
-       $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_TARGET_CFLAGS) -c -o $@ $<
 
 reboot_mod-commands_ieee1275_reboot.d: commands/ieee1275/reboot.c
-       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -M $<        | sed 's,reboot\.o[ :]*,reboot_mod-commands_ieee1275_reboot.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_TARGET_CFLAGS) -M $<    | sed 's,reboot\.o[ :]*,reboot_mod-commands_ieee1275_reboot.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include reboot_mod-commands_ieee1275_reboot.d
 
@@ -1395,10 +1377,10 @@ COMMANDFILES += cmd-reboot_mod-commands_ieee1275_reboot.lst
 FSFILES += fs-reboot_mod-commands_ieee1275_reboot.lst
 
 cmd-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c gencmdlist.sh
-       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1)
 
 fs-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c genfslist.sh
-       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1)
 
 
 reboot_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1416,15 +1398,15 @@ UNDSYMFILES += und-halt.lst
 
 halt.mod: pre-halt.o mod-halt.o
        -rm -f $@
-       $(CC) $(halt_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-halt.o: halt_mod-commands_ieee1275_halt.o
        -rm -f $@
-       $(CC) $(halt_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-halt.o: mod-halt.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
 
 mod-halt.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1)
@@ -1439,10 +1421,10 @@ und-halt.lst: pre-halt.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 halt_mod-commands_ieee1275_halt.o: commands/ieee1275/halt.c
-       $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_TARGET_CFLAGS) -c -o $@ $<
 
 halt_mod-commands_ieee1275_halt.d: commands/ieee1275/halt.c
-       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -M $<          | sed 's,halt\.o[ :]*,halt_mod-commands_ieee1275_halt.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_TARGET_CFLAGS) -M $<      | sed 's,halt\.o[ :]*,halt_mod-commands_ieee1275_halt.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include halt_mod-commands_ieee1275_halt.d
 
@@ -1451,10 +1433,10 @@ COMMANDFILES += cmd-halt_mod-commands_ieee1275_halt.lst
 FSFILES += fs-halt_mod-commands_ieee1275_halt.lst
 
 cmd-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c gencmdlist.sh
-       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1)
 
 fs-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c genfslist.sh
-       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1)
 
 
 halt_mod_CFLAGS = $(COMMON_CFLAGS)
index 7424635fe7ae9afedbf7bf1f75ee6898ad8734d0..5f819cddb54dddc7c650e1d095eb51a815369013 100644 (file)
@@ -28,7 +28,6 @@ pkgdata_PROGRAMS = kernel.elf
 # Utilities.
 bin_UTILITIES = grub-emu
 sbin_UTILITIES = grub-mkimage
-noinst_UTILITIES = genmoddep
 
 # For grub-mkimage.
 grub_mkimage_SOURCES = util/powerpc/ieee1275/grub-mkimage.c util/misc.c \
@@ -73,9 +72,6 @@ kernel_elf_ASFLAGS = $(COMMON_ASFLAGS)
 kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \
        -Wl,-N,-S,-Ttext,0x200000,-Bstatic
 
-# For genmoddep.
-genmoddep_SOURCES = util/genmoddep.c
-
 # Scripts.
 sbin_SCRIPTS = grub-install
 
index 50c58830890f7d60c38ad51530bcaf20e3f55992..4b7342f158be774908994269e17df18dc35467ab 100644 (file)
@@ -31,7 +31,6 @@ pkgdata_PROGRAMS = kernel.elf
 
 # Utilities.
 #bin_UTILITIES = grub-emu grub-mkimage
-noinst_UTILITIES = genmoddep
 
 # For grub-mkimage.
 grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \
@@ -74,189 +73,189 @@ CLEANFILES += kernel.elf kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern
 MOSTLYCLEANFILES += kernel_elf-kern_sparc64_ieee1275_init.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_sparc64_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_sparc64_dl.d kernel_elf-kernel_elf_symlist.d kernel_elf-kern_sparc64_cache.d kernel_elf-kern_parser.d
 
 kernel.elf: kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o
-       $(CC) -o $@ $^ $(LDFLAGS) $(kernel_elf_LDFLAGS)
+       $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS)
 
 kernel_elf-kern_sparc64_ieee1275_init.o: kern/sparc64/ieee1275/init.c
-       $(CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_sparc64_ieee1275_init.d: kern/sparc64/ieee1275/init.c
-       set -e;           $(CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<        | sed 's,init\.o[ :]*,kernel_elf-kern_sparc64_ieee1275_init.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,init\.o[ :]*,kernel_elf-kern_sparc64_ieee1275_init.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_sparc64_ieee1275_init.d
 
 kernel_elf-kern_ieee1275_ieee1275.o: kern/ieee1275/ieee1275.c
-       $(CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_ieee1275_ieee1275.d: kern/ieee1275/ieee1275.c
-       set -e;           $(CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<        | sed 's,ieee1275\.o[ :]*,kernel_elf-kern_ieee1275_ieee1275.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,ieee1275\.o[ :]*,kernel_elf-kern_ieee1275_ieee1275.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_ieee1275_ieee1275.d
 
 kernel_elf-kern_main.o: kern/main.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_main.d: kern/main.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,main\.o[ :]*,kernel_elf-kern_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,main\.o[ :]*,kernel_elf-kern_main.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_main.d
 
 kernel_elf-kern_device.o: kern/device.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_device.d: kern/device.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,device\.o[ :]*,kernel_elf-kern_device.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,device\.o[ :]*,kernel_elf-kern_device.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_device.d
 
 kernel_elf-kern_disk.o: kern/disk.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_disk.d: kern/disk.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,disk\.o[ :]*,kernel_elf-kern_disk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,disk\.o[ :]*,kernel_elf-kern_disk.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_disk.d
 
 kernel_elf-kern_dl.o: kern/dl.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_dl.d: kern/dl.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,dl\.o[ :]*,kernel_elf-kern_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,dl\.o[ :]*,kernel_elf-kern_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_dl.d
 
 kernel_elf-kern_file.o: kern/file.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_file.d: kern/file.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,file\.o[ :]*,kernel_elf-kern_file.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,file\.o[ :]*,kernel_elf-kern_file.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_file.d
 
 kernel_elf-kern_fs.o: kern/fs.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_fs.d: kern/fs.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,fs\.o[ :]*,kernel_elf-kern_fs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,fs\.o[ :]*,kernel_elf-kern_fs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_fs.d
 
 kernel_elf-kern_err.o: kern/err.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_err.d: kern/err.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,err\.o[ :]*,kernel_elf-kern_err.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,err\.o[ :]*,kernel_elf-kern_err.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_err.d
 
 kernel_elf-kern_misc.o: kern/misc.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_misc.d: kern/misc.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,kernel_elf-kern_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,misc\.o[ :]*,kernel_elf-kern_misc.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_misc.d
 
 kernel_elf-kern_mm.o: kern/mm.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_mm.d: kern/mm.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,mm\.o[ :]*,kernel_elf-kern_mm.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,mm\.o[ :]*,kernel_elf-kern_mm.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_mm.d
 
 kernel_elf-kern_loader.o: kern/loader.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_loader.d: kern/loader.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,loader\.o[ :]*,kernel_elf-kern_loader.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,loader\.o[ :]*,kernel_elf-kern_loader.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_loader.d
 
 kernel_elf-kern_rescue.o: kern/rescue.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_rescue.d: kern/rescue.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,rescue\.o[ :]*,kernel_elf-kern_rescue.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,rescue\.o[ :]*,kernel_elf-kern_rescue.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_rescue.d
 
 kernel_elf-kern_term.o: kern/term.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_term.d: kern/term.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,term\.o[ :]*,kernel_elf-kern_term.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,term\.o[ :]*,kernel_elf-kern_term.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_term.d
 
 kernel_elf-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c
-       $(CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-term_ieee1275_ofconsole.d: term/ieee1275/ofconsole.c
-       set -e;           $(CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<        | sed 's,ofconsole\.o[ :]*,kernel_elf-term_ieee1275_ofconsole.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,ofconsole\.o[ :]*,kernel_elf-term_ieee1275_ofconsole.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include kernel_elf-term_ieee1275_ofconsole.d
 
 kernel_elf-kern_sparc64_ieee1275_openfw.o: kern/sparc64/ieee1275/openfw.c
-       $(CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_sparc64_ieee1275_openfw.d: kern/sparc64/ieee1275/openfw.c
-       set -e;           $(CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<        | sed 's,openfw\.o[ :]*,kernel_elf-kern_sparc64_ieee1275_openfw.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,openfw\.o[ :]*,kernel_elf-kern_sparc64_ieee1275_openfw.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_sparc64_ieee1275_openfw.d
 
 kernel_elf-disk_ieee1275_ofdisk.o: disk/ieee1275/ofdisk.c
-       $(CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-disk_ieee1275_ofdisk.d: disk/ieee1275/ofdisk.c
-       set -e;           $(CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<        | sed 's,ofdisk\.o[ :]*,kernel_elf-disk_ieee1275_ofdisk.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,ofdisk\.o[ :]*,kernel_elf-disk_ieee1275_ofdisk.o $@ : ,g' > $@;        [ -s $@ ] || rm -f $@
 
 -include kernel_elf-disk_ieee1275_ofdisk.d
 
 kernel_elf-kern_partition.o: kern/partition.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_partition.d: kern/partition.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,partition\.o[ :]*,kernel_elf-kern_partition.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,partition\.o[ :]*,kernel_elf-kern_partition.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_partition.d
 
 kernel_elf-kern_env.o: kern/env.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_env.d: kern/env.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,env\.o[ :]*,kernel_elf-kern_env.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,env\.o[ :]*,kernel_elf-kern_env.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_env.d
 
 kernel_elf-kern_sparc64_dl.o: kern/sparc64/dl.c
-       $(CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_sparc64_dl.d: kern/sparc64/dl.c
-       set -e;           $(CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,dl\.o[ :]*,kernel_elf-kern_sparc64_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,dl\.o[ :]*,kernel_elf-kern_sparc64_dl.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_sparc64_dl.d
 
 kernel_elf-kernel_elf_symlist.o: kernel_elf_symlist.c
-       $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kernel_elf_symlist.d: kernel_elf_symlist.c
-       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<        | sed 's,kernel_elf_symlist\.o[ :]*,kernel_elf-kernel_elf_symlist.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<           | sed 's,kernel_elf_symlist\.o[ :]*,kernel_elf-kernel_elf_symlist.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kernel_elf_symlist.d
 
 kernel_elf-kern_sparc64_cache.o: kern/sparc64/cache.S
-       $(CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_sparc64_cache.d: kern/sparc64/cache.S
-       set -e;           $(CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,cache\.o[ :]*,kernel_elf-kern_sparc64_cache.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,cache\.o[ :]*,kernel_elf-kern_sparc64_cache.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_sparc64_cache.d
 
 kernel_elf-kern_parser.o: kern/parser.c
-       $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -c -o $@ $<
 
 kernel_elf-kern_parser.d: kern/parser.c
-       set -e;           $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_elf_CFLAGS) -M $<          | sed 's,parser\.o[ :]*,kernel_elf-kern_parser.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -M $<     | sed 's,parser\.o[ :]*,kernel_elf-kern_parser.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include kernel_elf-kern_parser.d
 
@@ -265,23 +264,6 @@ kernel_elf_CFLAGS = $(COMMON_CFLAGS)
 kernel_elf_ASFLAGS = $(COMMON_ASFLAGS)
 kernel_elf_LDFLAGS = -mno-app-regs -nostdlib -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc
 
-# For genmoddep.
-genmoddep_SOURCES = util/genmoddep.c
-CLEANFILES += genmoddep genmoddep-util_genmoddep.o
-MOSTLYCLEANFILES += genmoddep-util_genmoddep.d
-
-genmoddep: genmoddep-util_genmoddep.o
-       $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(genmoddep_LDFLAGS)
-
-genmoddep-util_genmoddep.o: util/genmoddep.c
-       $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(genmoddep_CFLAGS) -c -o $@ $<
-
-genmoddep-util_genmoddep.d: util/genmoddep.c
-       set -e;           $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(genmoddep_CFLAGS) -M $<           | sed 's,genmoddep\.o[ :]*,genmoddep-util_genmoddep.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
-
--include genmoddep-util_genmoddep.d
-
-
 # Modules.
 #_linux.mod linux.mod
 pkgdata_MODULES = fat.mod ufs.mod ext2.mod minix.mod \
@@ -303,15 +285,15 @@ UNDSYMFILES += und-fshelp.lst
 
 fshelp.mod: pre-fshelp.o mod-fshelp.o
        -rm -f $@
-       $(CC) $(fshelp_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-fshelp.o: fshelp_mod-fs_fshelp.o
        -rm -f $@
-       $(CC) $(fshelp_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-fshelp.o: mod-fshelp.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -c -o $@ $<
 
 mod-fshelp.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'fshelp' $< > $@ || (rm -f $@; exit 1)
@@ -326,10 +308,10 @@ und-fshelp.lst: pre-fshelp.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 fshelp_mod-fs_fshelp.o: fs/fshelp.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_TARGET_CFLAGS) -c -o $@ $<
 
 fshelp_mod-fs_fshelp.d: fs/fshelp.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -M $<      | sed 's,fshelp\.o[ :]*,fshelp_mod-fs_fshelp.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_TARGET_CFLAGS) -M $<          | sed 's,fshelp\.o[ :]*,fshelp_mod-fs_fshelp.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include fshelp_mod-fs_fshelp.d
 
@@ -338,10 +320,10 @@ COMMANDFILES += cmd-fshelp_mod-fs_fshelp.lst
 FSFILES += fs-fshelp_mod-fs_fshelp.lst
 
 cmd-fshelp_mod-fs_fshelp.lst: fs/fshelp.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh fshelp > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh fshelp > $@ || (rm -f $@; exit 1)
 
 fs-fshelp_mod-fs_fshelp.lst: fs/fshelp.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fshelp_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh fshelp > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh fshelp > $@ || (rm -f $@; exit 1)
 
 
 fshelp_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -359,15 +341,15 @@ UNDSYMFILES += und-fat.lst
 
 fat.mod: pre-fat.o mod-fat.o
        -rm -f $@
-       $(CC) $(fat_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-fat.o: fat_mod-fs_fat.o
        -rm -f $@
-       $(CC) $(fat_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-fat.o: mod-fat.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $<
 
 mod-fat.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'fat' $< > $@ || (rm -f $@; exit 1)
@@ -382,10 +364,10 @@ und-fat.lst: pre-fat.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 fat_mod-fs_fat.o: fs/fat.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_TARGET_CFLAGS) -c -o $@ $<
 
 fat_mod-fs_fat.d: fs/fat.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -M $<         | sed 's,fat\.o[ :]*,fat_mod-fs_fat.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_TARGET_CFLAGS) -M $<     | sed 's,fat\.o[ :]*,fat_mod-fs_fat.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include fat_mod-fs_fat.d
 
@@ -394,10 +376,10 @@ COMMANDFILES += cmd-fat_mod-fs_fat.lst
 FSFILES += fs-fat_mod-fs_fat.lst
 
 cmd-fat_mod-fs_fat.lst: fs/fat.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh fat > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh fat > $@ || (rm -f $@; exit 1)
 
 fs-fat_mod-fs_fat.lst: fs/fat.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh fat > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh fat > $@ || (rm -f $@; exit 1)
 
 
 fat_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -415,15 +397,15 @@ UNDSYMFILES += und-ext2.lst
 
 ext2.mod: pre-ext2.o mod-ext2.o
        -rm -f $@
-       $(CC) $(ext2_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-ext2.o: ext2_mod-fs_ext2.o
        -rm -f $@
-       $(CC) $(ext2_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-ext2.o: mod-ext2.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $<
 
 mod-ext2.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'ext2' $< > $@ || (rm -f $@; exit 1)
@@ -438,10 +420,10 @@ und-ext2.lst: pre-ext2.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 ext2_mod-fs_ext2.o: fs/ext2.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_TARGET_CFLAGS) -c -o $@ $<
 
 ext2_mod-fs_ext2.d: fs/ext2.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -M $<        | sed 's,ext2\.o[ :]*,ext2_mod-fs_ext2.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_TARGET_CFLAGS) -M $<    | sed 's,ext2\.o[ :]*,ext2_mod-fs_ext2.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include ext2_mod-fs_ext2.d
 
@@ -450,10 +432,10 @@ COMMANDFILES += cmd-ext2_mod-fs_ext2.lst
 FSFILES += fs-ext2_mod-fs_ext2.lst
 
 cmd-ext2_mod-fs_ext2.lst: fs/ext2.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh ext2 > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh ext2 > $@ || (rm -f $@; exit 1)
 
 fs-ext2_mod-fs_ext2.lst: fs/ext2.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh ext2 > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh ext2 > $@ || (rm -f $@; exit 1)
 
 
 ext2_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -471,15 +453,15 @@ UNDSYMFILES += und-ufs.lst
 
 ufs.mod: pre-ufs.o mod-ufs.o
        -rm -f $@
-       $(CC) $(ufs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-ufs.o: ufs_mod-fs_ufs.o
        -rm -f $@
-       $(CC) $(ufs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-ufs.o: mod-ufs.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -c -o $@ $<
 
 mod-ufs.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'ufs' $< > $@ || (rm -f $@; exit 1)
@@ -494,10 +476,10 @@ und-ufs.lst: pre-ufs.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 ufs_mod-fs_ufs.o: fs/ufs.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_TARGET_CFLAGS) -c -o $@ $<
 
 ufs_mod-fs_ufs.d: fs/ufs.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -M $<         | sed 's,ufs\.o[ :]*,ufs_mod-fs_ufs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_TARGET_CFLAGS) -M $<     | sed 's,ufs\.o[ :]*,ufs_mod-fs_ufs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include ufs_mod-fs_ufs.d
 
@@ -506,10 +488,10 @@ COMMANDFILES += cmd-ufs_mod-fs_ufs.lst
 FSFILES += fs-ufs_mod-fs_ufs.lst
 
 cmd-ufs_mod-fs_ufs.lst: fs/ufs.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh ufs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh ufs > $@ || (rm -f $@; exit 1)
 
 fs-ufs_mod-fs_ufs.lst: fs/ufs.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ufs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh ufs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh ufs > $@ || (rm -f $@; exit 1)
 
 
 ufs_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -527,15 +509,15 @@ UNDSYMFILES += und-minix.lst
 
 minix.mod: pre-minix.o mod-minix.o
        -rm -f $@
-       $(CC) $(minix_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-minix.o: minix_mod-fs_minix.o
        -rm -f $@
-       $(CC) $(minix_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-minix.o: mod-minix.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -c -o $@ $<
 
 mod-minix.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'minix' $< > $@ || (rm -f $@; exit 1)
@@ -550,10 +532,10 @@ und-minix.lst: pre-minix.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 minix_mod-fs_minix.o: fs/minix.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_TARGET_CFLAGS) -c -o $@ $<
 
 minix_mod-fs_minix.d: fs/minix.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -M $<       | sed 's,minix\.o[ :]*,minix_mod-fs_minix.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_TARGET_CFLAGS) -M $<           | sed 's,minix\.o[ :]*,minix_mod-fs_minix.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include minix_mod-fs_minix.d
 
@@ -562,10 +544,10 @@ COMMANDFILES += cmd-minix_mod-fs_minix.lst
 FSFILES += fs-minix_mod-fs_minix.lst
 
 cmd-minix_mod-fs_minix.lst: fs/minix.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh minix > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh minix > $@ || (rm -f $@; exit 1)
 
 fs-minix_mod-fs_minix.lst: fs/minix.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(minix_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh minix > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh minix > $@ || (rm -f $@; exit 1)
 
 
 minix_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -583,15 +565,15 @@ UNDSYMFILES += und-hfs.lst
 
 hfs.mod: pre-hfs.o mod-hfs.o
        -rm -f $@
-       $(CC) $(hfs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-hfs.o: hfs_mod-fs_hfs.o
        -rm -f $@
-       $(CC) $(hfs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-hfs.o: mod-hfs.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -c -o $@ $<
 
 mod-hfs.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'hfs' $< > $@ || (rm -f $@; exit 1)
@@ -606,10 +588,10 @@ und-hfs.lst: pre-hfs.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 hfs_mod-fs_hfs.o: fs/hfs.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_TARGET_CFLAGS) -c -o $@ $<
 
 hfs_mod-fs_hfs.d: fs/hfs.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -M $<         | sed 's,hfs\.o[ :]*,hfs_mod-fs_hfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_TARGET_CFLAGS) -M $<     | sed 's,hfs\.o[ :]*,hfs_mod-fs_hfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include hfs_mod-fs_hfs.d
 
@@ -618,10 +600,10 @@ COMMANDFILES += cmd-hfs_mod-fs_hfs.lst
 FSFILES += fs-hfs_mod-fs_hfs.lst
 
 cmd-hfs_mod-fs_hfs.lst: fs/hfs.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh hfs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh hfs > $@ || (rm -f $@; exit 1)
 
 fs-hfs_mod-fs_hfs.lst: fs/hfs.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(hfs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh hfs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh hfs > $@ || (rm -f $@; exit 1)
 
 
 hfs_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -639,15 +621,15 @@ UNDSYMFILES += und-jfs.lst
 
 jfs.mod: pre-jfs.o mod-jfs.o
        -rm -f $@
-       $(CC) $(jfs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-jfs.o: jfs_mod-fs_jfs.o
        -rm -f $@
-       $(CC) $(jfs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-jfs.o: mod-jfs.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -c -o $@ $<
 
 mod-jfs.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'jfs' $< > $@ || (rm -f $@; exit 1)
@@ -662,10 +644,10 @@ und-jfs.lst: pre-jfs.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 jfs_mod-fs_jfs.o: fs/jfs.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_TARGET_CFLAGS) -c -o $@ $<
 
 jfs_mod-fs_jfs.d: fs/jfs.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -M $<         | sed 's,jfs\.o[ :]*,jfs_mod-fs_jfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_TARGET_CFLAGS) -M $<     | sed 's,jfs\.o[ :]*,jfs_mod-fs_jfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include jfs_mod-fs_jfs.d
 
@@ -674,10 +656,10 @@ COMMANDFILES += cmd-jfs_mod-fs_jfs.lst
 FSFILES += fs-jfs_mod-fs_jfs.lst
 
 cmd-jfs_mod-fs_jfs.lst: fs/jfs.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh jfs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh jfs > $@ || (rm -f $@; exit 1)
 
 fs-jfs_mod-fs_jfs.lst: fs/jfs.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(jfs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh jfs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh jfs > $@ || (rm -f $@; exit 1)
 
 
 jfs_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -700,15 +682,15 @@ UNDSYMFILES += und-xfs.lst
 
 xfs.mod: pre-xfs.o mod-xfs.o
        -rm -f $@
-       $(CC) $(xfs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-xfs.o: xfs_mod-fs_xfs.o
        -rm -f $@
-       $(CC) $(xfs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-xfs.o: mod-xfs.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -c -o $@ $<
 
 mod-xfs.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'xfs' $< > $@ || (rm -f $@; exit 1)
@@ -723,10 +705,10 @@ und-xfs.lst: pre-xfs.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 xfs_mod-fs_xfs.o: fs/xfs.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_TARGET_CFLAGS) -c -o $@ $<
 
 xfs_mod-fs_xfs.d: fs/xfs.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -M $<         | sed 's,xfs\.o[ :]*,xfs_mod-fs_xfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_TARGET_CFLAGS) -M $<     | sed 's,xfs\.o[ :]*,xfs_mod-fs_xfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include xfs_mod-fs_xfs.d
 
@@ -735,10 +717,10 @@ COMMANDFILES += cmd-xfs_mod-fs_xfs.lst
 FSFILES += fs-xfs_mod-fs_xfs.lst
 
 cmd-xfs_mod-fs_xfs.lst: fs/xfs.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh xfs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh xfs > $@ || (rm -f $@; exit 1)
 
 fs-xfs_mod-fs_xfs.lst: fs/xfs.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(xfs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh xfs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh xfs > $@ || (rm -f $@; exit 1)
 
 
 xfs_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -756,15 +738,15 @@ UNDSYMFILES += und-affs.lst
 
 affs.mod: pre-affs.o mod-affs.o
        -rm -f $@
-       $(CC) $(affs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-affs.o: affs_mod-fs_affs.o
        -rm -f $@
-       $(CC) $(affs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-affs.o: mod-affs.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -c -o $@ $<
 
 mod-affs.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'affs' $< > $@ || (rm -f $@; exit 1)
@@ -779,10 +761,10 @@ und-affs.lst: pre-affs.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 affs_mod-fs_affs.o: fs/affs.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_TARGET_CFLAGS) -c -o $@ $<
 
 affs_mod-fs_affs.d: fs/affs.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -M $<        | sed 's,affs\.o[ :]*,affs_mod-fs_affs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_TARGET_CFLAGS) -M $<    | sed 's,affs\.o[ :]*,affs_mod-fs_affs.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include affs_mod-fs_affs.d
 
@@ -791,10 +773,10 @@ COMMANDFILES += cmd-affs_mod-fs_affs.lst
 FSFILES += fs-affs_mod-fs_affs.lst
 
 cmd-affs_mod-fs_affs.lst: fs/affs.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh affs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh affs > $@ || (rm -f $@; exit 1)
 
 fs-affs_mod-fs_affs.lst: fs/affs.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(affs_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh affs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh affs > $@ || (rm -f $@; exit 1)
 
 
 affs_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -812,15 +794,15 @@ UNDSYMFILES += und-sfs.lst
 
 sfs.mod: pre-sfs.o mod-sfs.o
        -rm -f $@
-       $(CC) $(sfs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-sfs.o: sfs_mod-fs_sfs.o
        -rm -f $@
-       $(CC) $(sfs_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-sfs.o: mod-sfs.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -c -o $@ $<
 
 mod-sfs.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'sfs' $< > $@ || (rm -f $@; exit 1)
@@ -835,10 +817,10 @@ und-sfs.lst: pre-sfs.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 sfs_mod-fs_sfs.o: fs/sfs.c
-       $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_TARGET_CFLAGS) -c -o $@ $<
 
 sfs_mod-fs_sfs.d: fs/sfs.c
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -M $<         | sed 's,sfs\.o[ :]*,sfs_mod-fs_sfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_TARGET_CFLAGS) -M $<     | sed 's,sfs\.o[ :]*,sfs_mod-fs_sfs.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include sfs_mod-fs_sfs.d
 
@@ -847,10 +829,10 @@ COMMANDFILES += cmd-sfs_mod-fs_sfs.lst
 FSFILES += fs-sfs_mod-fs_sfs.lst
 
 cmd-sfs_mod-fs_sfs.lst: fs/sfs.c gencmdlist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh sfs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh sfs > $@ || (rm -f $@; exit 1)
 
 fs-sfs_mod-fs_sfs.lst: fs/sfs.c genfslist.sh
-       set -e;           $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(sfs_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh sfs > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh sfs > $@ || (rm -f $@; exit 1)
 
 
 sfs_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -883,15 +865,15 @@ UNDSYMFILES += und-normal.lst
 
 normal.mod: pre-normal.o mod-normal.o
        -rm -f $@
-       $(CC) $(normal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-normal.o: normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o normal_mod-grub_script_tab.o
        -rm -f $@
-       $(CC) $(normal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-normal.o: mod-normal.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
 
 mod-normal.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1)
@@ -906,10 +888,10 @@ und-normal.lst: pre-normal.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 normal_mod-normal_arg.o: normal/arg.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_arg.d: normal/arg.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,arg\.o[ :]*,normal_mod-normal_arg.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,arg\.o[ :]*,normal_mod-normal_arg.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_arg.d
 
@@ -918,17 +900,17 @@ COMMANDFILES += cmd-normal_mod-normal_arg.lst
 FSFILES += fs-normal_mod-normal_arg.lst
 
 cmd-normal_mod-normal_arg.lst: normal/arg.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_arg.lst: normal/arg.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_cmdline.o: normal/cmdline.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_cmdline.d: normal/cmdline.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,cmdline\.o[ :]*,normal_mod-normal_cmdline.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,cmdline\.o[ :]*,normal_mod-normal_cmdline.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_cmdline.d
 
@@ -937,17 +919,17 @@ COMMANDFILES += cmd-normal_mod-normal_cmdline.lst
 FSFILES += fs-normal_mod-normal_cmdline.lst
 
 cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_cmdline.lst: normal/cmdline.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_command.o: normal/command.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_command.d: normal/command.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,command\.o[ :]*,normal_mod-normal_command.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,command\.o[ :]*,normal_mod-normal_command.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_command.d
 
@@ -956,17 +938,17 @@ COMMANDFILES += cmd-normal_mod-normal_command.lst
 FSFILES += fs-normal_mod-normal_command.lst
 
 cmd-normal_mod-normal_command.lst: normal/command.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_command.lst: normal/command.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_completion.o: normal/completion.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_completion.d: normal/completion.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,completion\.o[ :]*,normal_mod-normal_completion.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,completion\.o[ :]*,normal_mod-normal_completion.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_completion.d
 
@@ -975,17 +957,17 @@ COMMANDFILES += cmd-normal_mod-normal_completion.lst
 FSFILES += fs-normal_mod-normal_completion.lst
 
 cmd-normal_mod-normal_completion.lst: normal/completion.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_completion.lst: normal/completion.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_execute.o: normal/execute.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_execute.d: normal/execute.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,execute\.o[ :]*,normal_mod-normal_execute.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,execute\.o[ :]*,normal_mod-normal_execute.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_execute.d
 
@@ -994,17 +976,17 @@ COMMANDFILES += cmd-normal_mod-normal_execute.lst
 FSFILES += fs-normal_mod-normal_execute.lst
 
 cmd-normal_mod-normal_execute.lst: normal/execute.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_execute.lst: normal/execute.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_function.o: normal/function.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_function.d: normal/function.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,function\.o[ :]*,normal_mod-normal_function.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,function\.o[ :]*,normal_mod-normal_function.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_function.d
 
@@ -1013,17 +995,17 @@ COMMANDFILES += cmd-normal_mod-normal_function.lst
 FSFILES += fs-normal_mod-normal_function.lst
 
 cmd-normal_mod-normal_function.lst: normal/function.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_function.lst: normal/function.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_lexer.o: normal/lexer.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_lexer.d: normal/lexer.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,lexer\.o[ :]*,normal_mod-normal_lexer.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,lexer\.o[ :]*,normal_mod-normal_lexer.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_lexer.d
 
@@ -1032,17 +1014,17 @@ COMMANDFILES += cmd-normal_mod-normal_lexer.lst
 FSFILES += fs-normal_mod-normal_lexer.lst
 
 cmd-normal_mod-normal_lexer.lst: normal/lexer.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_lexer.lst: normal/lexer.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_main.o: normal/main.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_main.d: normal/main.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,main\.o[ :]*,normal_mod-normal_main.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,main\.o[ :]*,normal_mod-normal_main.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_main.d
 
@@ -1051,17 +1033,17 @@ COMMANDFILES += cmd-normal_mod-normal_main.lst
 FSFILES += fs-normal_mod-normal_main.lst
 
 cmd-normal_mod-normal_main.lst: normal/main.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_main.lst: normal/main.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_menu.o: normal/menu.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_menu.d: normal/menu.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,menu\.o[ :]*,normal_mod-normal_menu.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,menu\.o[ :]*,normal_mod-normal_menu.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_menu.d
 
@@ -1070,17 +1052,17 @@ COMMANDFILES += cmd-normal_mod-normal_menu.lst
 FSFILES += fs-normal_mod-normal_menu.lst
 
 cmd-normal_mod-normal_menu.lst: normal/menu.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_menu.lst: normal/menu.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_menu_entry.o: normal/menu_entry.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_menu_entry.d: normal/menu_entry.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,menu_entry\.o[ :]*,normal_mod-normal_menu_entry.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,menu_entry\.o[ :]*,normal_mod-normal_menu_entry.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_menu_entry.d
 
@@ -1089,17 +1071,17 @@ COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst
 FSFILES += fs-normal_mod-normal_menu_entry.lst
 
 cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_misc.o: normal/misc.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_misc.d: normal/misc.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,misc\.o[ :]*,normal_mod-normal_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,misc\.o[ :]*,normal_mod-normal_misc.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_misc.d
 
@@ -1108,17 +1090,17 @@ COMMANDFILES += cmd-normal_mod-normal_misc.lst
 FSFILES += fs-normal_mod-normal_misc.lst
 
 cmd-normal_mod-normal_misc.lst: normal/misc.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_misc.lst: normal/misc.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_script.o: normal/script.c
-       $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-normal_script.d: normal/script.c
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<      | sed 's,script\.o[ :]*,normal_mod-normal_script.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<          | sed 's,script\.o[ :]*,normal_mod-normal_script.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_script.d
 
@@ -1127,17 +1109,17 @@ COMMANDFILES += cmd-normal_mod-normal_script.lst
 FSFILES += fs-normal_mod-normal_script.lst
 
 cmd-normal_mod-normal_script.lst: normal/script.c gencmdlist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_script.lst: normal/script.c genfslist.sh
-       set -e;           $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-normal_sparc64_setjmp.o: normal/sparc64/setjmp.S
-       $(CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_TARGET_ASFLAGS) -c -o $@ $<
 
 normal_mod-normal_sparc64_setjmp.d: normal/sparc64/setjmp.S
-       set -e;           $(CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -M $<    | sed 's,setjmp\.o[ :]*,normal_mod-normal_sparc64_setjmp.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_TARGET_ASFLAGS) -M $<        | sed 's,setjmp\.o[ :]*,normal_mod-normal_sparc64_setjmp.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include normal_mod-normal_sparc64_setjmp.d
 
@@ -1146,17 +1128,17 @@ COMMANDFILES += cmd-normal_mod-normal_sparc64_setjmp.lst
 FSFILES += fs-normal_mod-normal_sparc64_setjmp.lst
 
 cmd-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S gencmdlist.sh
-       set -e;           $(CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_TARGET_ASFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S genfslist.sh
-       set -e;           $(CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -E $<    | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_TARGET_ASFLAGS) -E $<        | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod-grub_script_tab.o: grub_script.tab.c
-       $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 normal_mod-grub_script_tab.d: grub_script.tab.c
-       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $<        | sed 's,grub_script\.tab\.o[ :]*,normal_mod-grub_script_tab.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -M $<    | sed 's,grub_script\.tab\.o[ :]*,normal_mod-grub_script_tab.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include normal_mod-grub_script_tab.d
 
@@ -1165,10 +1147,10 @@ COMMANDFILES += cmd-normal_mod-grub_script_tab.lst
 FSFILES += fs-normal_mod-grub_script_tab.lst
 
 cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c gencmdlist.sh
-       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1)
 
 fs-normal_mod-grub_script_tab.lst: grub_script.tab.c genfslist.sh
-       set -e;           $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1)
 
 
 normal_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1187,15 +1169,15 @@ UNDSYMFILES += und-hello.lst
 
 hello.mod: pre-hello.o mod-hello.o
        -rm -f $@
-       $(CC) $(hello_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-hello.o: hello_mod-hello_hello.o
        -rm -f $@
-       $(CC) $(hello_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-hello.o: mod-hello.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $<
 
 mod-hello.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'hello' $< > $@ || (rm -f $@; exit 1)
@@ -1210,10 +1192,10 @@ und-hello.lst: pre-hello.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 hello_mod-hello_hello.o: hello/hello.c
-       $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_TARGET_CFLAGS) -c -o $@ $<
 
 hello_mod-hello_hello.d: hello/hello.c
-       set -e;           $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -M $<         | sed 's,hello\.o[ :]*,hello_mod-hello_hello.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_TARGET_CFLAGS) -M $<     | sed 's,hello\.o[ :]*,hello_mod-hello_hello.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include hello_mod-hello_hello.d
 
@@ -1222,10 +1204,10 @@ COMMANDFILES += cmd-hello_mod-hello_hello.lst
 FSFILES += fs-hello_mod-hello_hello.lst
 
 cmd-hello_mod-hello_hello.lst: hello/hello.c gencmdlist.sh
-       set -e;           $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh hello > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh hello > $@ || (rm -f $@; exit 1)
 
 fs-hello_mod-hello_hello.lst: hello/hello.c genfslist.sh
-       set -e;           $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh hello > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_TARGET_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh hello > $@ || (rm -f $@; exit 1)
 
 
 hello_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1243,15 +1225,15 @@ UNDSYMFILES += und-boot.lst
 
 boot.mod: pre-boot.o mod-boot.o
        -rm -f $@
-       $(CC) $(boot_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-boot.o: boot_mod-commands_boot.o
        -rm -f $@
-       $(CC) $(boot_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-boot.o: mod-boot.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $<
 
 mod-boot.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'boot' $< > $@ || (rm -f $@; exit 1)
@@ -1266,10 +1248,10 @@ und-boot.lst: pre-boot.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 boot_mod-commands_boot.o: commands/boot.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_TARGET_CFLAGS) -c -o $@ $<
 
 boot_mod-commands_boot.d: commands/boot.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -M $<    | sed 's,boot\.o[ :]*,boot_mod-commands_boot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_TARGET_CFLAGS) -M $<        | sed 's,boot\.o[ :]*,boot_mod-commands_boot.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include boot_mod-commands_boot.d
 
@@ -1278,10 +1260,10 @@ COMMANDFILES += cmd-boot_mod-commands_boot.lst
 FSFILES += fs-boot_mod-commands_boot.lst
 
 cmd-boot_mod-commands_boot.lst: commands/boot.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh boot > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh boot > $@ || (rm -f $@; exit 1)
 
 fs-boot_mod-commands_boot.lst: commands/boot.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(boot_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh boot > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh boot > $@ || (rm -f $@; exit 1)
 
 
 boot_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1299,15 +1281,15 @@ UNDSYMFILES += und-terminal.lst
 
 terminal.mod: pre-terminal.o mod-terminal.o
        -rm -f $@
-       $(CC) $(terminal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-terminal.o: terminal_mod-commands_terminal.o
        -rm -f $@
-       $(CC) $(terminal_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-terminal.o: mod-terminal.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $<
 
 mod-terminal.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'terminal' $< > $@ || (rm -f $@; exit 1)
@@ -1322,10 +1304,10 @@ und-terminal.lst: pre-terminal.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 terminal_mod-commands_terminal.o: commands/terminal.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_TARGET_CFLAGS) -c -o $@ $<
 
 terminal_mod-commands_terminal.d: commands/terminal.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -M $<        | sed 's,terminal\.o[ :]*,terminal_mod-commands_terminal.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_TARGET_CFLAGS) -M $<    | sed 's,terminal\.o[ :]*,terminal_mod-commands_terminal.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include terminal_mod-commands_terminal.d
 
@@ -1334,10 +1316,10 @@ COMMANDFILES += cmd-terminal_mod-commands_terminal.lst
 FSFILES += fs-terminal_mod-commands_terminal.lst
 
 cmd-terminal_mod-commands_terminal.lst: commands/terminal.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh terminal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh terminal > $@ || (rm -f $@; exit 1)
 
 fs-terminal_mod-commands_terminal.lst: commands/terminal.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(terminal_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh terminal > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh terminal > $@ || (rm -f $@; exit 1)
 
 
 terminal_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1355,15 +1337,15 @@ UNDSYMFILES += und-ls.lst
 
 ls.mod: pre-ls.o mod-ls.o
        -rm -f $@
-       $(CC) $(ls_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-ls.o: ls_mod-commands_ls.o
        -rm -f $@
-       $(CC) $(ls_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-ls.o: mod-ls.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $<
 
 mod-ls.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'ls' $< > $@ || (rm -f $@; exit 1)
@@ -1378,10 +1360,10 @@ und-ls.lst: pre-ls.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 ls_mod-commands_ls.o: commands/ls.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_TARGET_CFLAGS) -c -o $@ $<
 
 ls_mod-commands_ls.d: commands/ls.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -M $<      | sed 's,ls\.o[ :]*,ls_mod-commands_ls.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_TARGET_CFLAGS) -M $<          | sed 's,ls\.o[ :]*,ls_mod-commands_ls.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include ls_mod-commands_ls.d
 
@@ -1390,10 +1372,10 @@ COMMANDFILES += cmd-ls_mod-commands_ls.lst
 FSFILES += fs-ls_mod-commands_ls.lst
 
 cmd-ls_mod-commands_ls.lst: commands/ls.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh ls > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh ls > $@ || (rm -f $@; exit 1)
 
 fs-ls_mod-commands_ls.lst: commands/ls.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(ls_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh ls > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh ls > $@ || (rm -f $@; exit 1)
 
 
 ls_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1411,15 +1393,15 @@ UNDSYMFILES += und-cmp.lst
 
 cmp.mod: pre-cmp.o mod-cmp.o
        -rm -f $@
-       $(CC) $(cmp_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-cmp.o: cmp_mod-commands_cmp.o
        -rm -f $@
-       $(CC) $(cmp_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-cmp.o: mod-cmp.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $<
 
 mod-cmp.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'cmp' $< > $@ || (rm -f $@; exit 1)
@@ -1434,10 +1416,10 @@ und-cmp.lst: pre-cmp.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 cmp_mod-commands_cmp.o: commands/cmp.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_TARGET_CFLAGS) -c -o $@ $<
 
 cmp_mod-commands_cmp.d: commands/cmp.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -M $<     | sed 's,cmp\.o[ :]*,cmp_mod-commands_cmp.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_TARGET_CFLAGS) -M $<         | sed 's,cmp\.o[ :]*,cmp_mod-commands_cmp.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include cmp_mod-commands_cmp.d
 
@@ -1446,10 +1428,10 @@ COMMANDFILES += cmd-cmp_mod-commands_cmp.lst
 FSFILES += fs-cmp_mod-commands_cmp.lst
 
 cmd-cmp_mod-commands_cmp.lst: commands/cmp.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh cmp > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh cmp > $@ || (rm -f $@; exit 1)
 
 fs-cmp_mod-commands_cmp.lst: commands/cmp.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cmp_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh cmp > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh cmp > $@ || (rm -f $@; exit 1)
 
 
 cmp_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1467,15 +1449,15 @@ UNDSYMFILES += und-cat.lst
 
 cat.mod: pre-cat.o mod-cat.o
        -rm -f $@
-       $(CC) $(cat_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-cat.o: cat_mod-commands_cat.o
        -rm -f $@
-       $(CC) $(cat_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-cat.o: mod-cat.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $<
 
 mod-cat.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'cat' $< > $@ || (rm -f $@; exit 1)
@@ -1490,10 +1472,10 @@ und-cat.lst: pre-cat.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 cat_mod-commands_cat.o: commands/cat.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_TARGET_CFLAGS) -c -o $@ $<
 
 cat_mod-commands_cat.d: commands/cat.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -M $<     | sed 's,cat\.o[ :]*,cat_mod-commands_cat.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_TARGET_CFLAGS) -M $<         | sed 's,cat\.o[ :]*,cat_mod-commands_cat.o $@ : ,g' > $@;      [ -s $@ ] || rm -f $@
 
 -include cat_mod-commands_cat.d
 
@@ -1502,10 +1484,10 @@ COMMANDFILES += cmd-cat_mod-commands_cat.lst
 FSFILES += fs-cat_mod-commands_cat.lst
 
 cmd-cat_mod-commands_cat.lst: commands/cat.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh cat > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh cat > $@ || (rm -f $@; exit 1)
 
 fs-cat_mod-commands_cat.lst: commands/cat.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(cat_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh cat > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh cat > $@ || (rm -f $@; exit 1)
 
 
 cat_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1523,15 +1505,15 @@ UNDSYMFILES += und-font.lst
 
 font.mod: pre-font.o mod-font.o
        -rm -f $@
-       $(CC) $(font_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-font.o: font_mod-font_manager.o
        -rm -f $@
-       $(CC) $(font_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-font.o: mod-font.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -c -o $@ $<
 
 mod-font.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'font' $< > $@ || (rm -f $@; exit 1)
@@ -1546,10 +1528,10 @@ und-font.lst: pre-font.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 font_mod-font_manager.o: font/manager.c
-       $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_TARGET_CFLAGS) -c -o $@ $<
 
 font_mod-font_manager.d: font/manager.c
-       set -e;           $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -M $<    | sed 's,manager\.o[ :]*,font_mod-font_manager.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_TARGET_CFLAGS) -M $<        | sed 's,manager\.o[ :]*,font_mod-font_manager.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include font_mod-font_manager.d
 
@@ -1558,10 +1540,10 @@ COMMANDFILES += cmd-font_mod-font_manager.lst
 FSFILES += fs-font_mod-font_manager.lst
 
 cmd-font_mod-font_manager.lst: font/manager.c gencmdlist.sh
-       set -e;           $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1)
 
 fs-font_mod-font_manager.lst: font/manager.c genfslist.sh
-       set -e;           $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1)
 
 
 font_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1579,15 +1561,15 @@ UNDSYMFILES += und-amiga.lst
 
 amiga.mod: pre-amiga.o mod-amiga.o
        -rm -f $@
-       $(CC) $(amiga_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-amiga.o: amiga_mod-partmap_amiga.o
        -rm -f $@
-       $(CC) $(amiga_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-amiga.o: mod-amiga.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -c -o $@ $<
 
 mod-amiga.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'amiga' $< > $@ || (rm -f $@; exit 1)
@@ -1602,10 +1584,10 @@ und-amiga.lst: pre-amiga.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 amiga_mod-partmap_amiga.o: partmap/amiga.c
-       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_TARGET_CFLAGS) -c -o $@ $<
 
 amiga_mod-partmap_amiga.d: partmap/amiga.c
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -M $<     | sed 's,amiga\.o[ :]*,amiga_mod-partmap_amiga.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_TARGET_CFLAGS) -M $<         | sed 's,amiga\.o[ :]*,amiga_mod-partmap_amiga.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include amiga_mod-partmap_amiga.d
 
@@ -1614,10 +1596,10 @@ COMMANDFILES += cmd-amiga_mod-partmap_amiga.lst
 FSFILES += fs-amiga_mod-partmap_amiga.lst
 
 cmd-amiga_mod-partmap_amiga.lst: partmap/amiga.c gencmdlist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh amiga > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh amiga > $@ || (rm -f $@; exit 1)
 
 fs-amiga_mod-partmap_amiga.lst: partmap/amiga.c genfslist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(amiga_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh amiga > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh amiga > $@ || (rm -f $@; exit 1)
 
 
 amiga_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1635,15 +1617,15 @@ UNDSYMFILES += und-apple.lst
 
 apple.mod: pre-apple.o mod-apple.o
        -rm -f $@
-       $(CC) $(apple_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-apple.o: apple_mod-partmap_apple.o
        -rm -f $@
-       $(CC) $(apple_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-apple.o: mod-apple.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -c -o $@ $<
 
 mod-apple.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'apple' $< > $@ || (rm -f $@; exit 1)
@@ -1658,10 +1640,10 @@ und-apple.lst: pre-apple.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 apple_mod-partmap_apple.o: partmap/apple.c
-       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_TARGET_CFLAGS) -c -o $@ $<
 
 apple_mod-partmap_apple.d: partmap/apple.c
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -M $<     | sed 's,apple\.o[ :]*,apple_mod-partmap_apple.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_TARGET_CFLAGS) -M $<         | sed 's,apple\.o[ :]*,apple_mod-partmap_apple.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include apple_mod-partmap_apple.d
 
@@ -1670,10 +1652,10 @@ COMMANDFILES += cmd-apple_mod-partmap_apple.lst
 FSFILES += fs-apple_mod-partmap_apple.lst
 
 cmd-apple_mod-partmap_apple.lst: partmap/apple.c gencmdlist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh apple > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh apple > $@ || (rm -f $@; exit 1)
 
 fs-apple_mod-partmap_apple.lst: partmap/apple.c genfslist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(apple_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh apple > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh apple > $@ || (rm -f $@; exit 1)
 
 
 apple_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1691,15 +1673,15 @@ UNDSYMFILES += und-pc.lst
 
 pc.mod: pre-pc.o mod-pc.o
        -rm -f $@
-       $(CC) $(pc_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-pc.o: pc_mod-partmap_pc.o
        -rm -f $@
-       $(CC) $(pc_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-pc.o: mod-pc.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -c -o $@ $<
 
 mod-pc.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'pc' $< > $@ || (rm -f $@; exit 1)
@@ -1714,10 +1696,10 @@ und-pc.lst: pre-pc.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 pc_mod-partmap_pc.o: partmap/pc.c
-       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_TARGET_CFLAGS) -c -o $@ $<
 
 pc_mod-partmap_pc.d: partmap/pc.c
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -M $<        | sed 's,pc\.o[ :]*,pc_mod-partmap_pc.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_TARGET_CFLAGS) -M $<    | sed 's,pc\.o[ :]*,pc_mod-partmap_pc.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include pc_mod-partmap_pc.d
 
@@ -1726,10 +1708,10 @@ COMMANDFILES += cmd-pc_mod-partmap_pc.lst
 FSFILES += fs-pc_mod-partmap_pc.lst
 
 cmd-pc_mod-partmap_pc.lst: partmap/pc.c gencmdlist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh pc > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh pc > $@ || (rm -f $@; exit 1)
 
 fs-pc_mod-partmap_pc.lst: partmap/pc.c genfslist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(pc_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh pc > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh pc > $@ || (rm -f $@; exit 1)
 
 
 pc_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1747,15 +1729,15 @@ UNDSYMFILES += und-sun.lst
 
 sun.mod: pre-sun.o mod-sun.o
        -rm -f $@
-       $(CC) $(sun_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-sun.o: sun_mod-partmap_sun.o
        -rm -f $@
-       $(CC) $(sun_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-sun.o: mod-sun.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -c -o $@ $<
 
 mod-sun.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'sun' $< > $@ || (rm -f $@; exit 1)
@@ -1770,10 +1752,10 @@ und-sun.lst: pre-sun.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 sun_mod-partmap_sun.o: partmap/sun.c
-       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_TARGET_CFLAGS) -c -o $@ $<
 
 sun_mod-partmap_sun.d: partmap/sun.c
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -M $<       | sed 's,sun\.o[ :]*,sun_mod-partmap_sun.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_TARGET_CFLAGS) -M $<           | sed 's,sun\.o[ :]*,sun_mod-partmap_sun.o $@ : ,g' > $@;       [ -s $@ ] || rm -f $@
 
 -include sun_mod-partmap_sun.d
 
@@ -1782,10 +1764,10 @@ COMMANDFILES += cmd-sun_mod-partmap_sun.lst
 FSFILES += fs-sun_mod-partmap_sun.lst
 
 cmd-sun_mod-partmap_sun.lst: partmap/sun.c gencmdlist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh sun > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh sun > $@ || (rm -f $@; exit 1)
 
 fs-sun_mod-partmap_sun.lst: partmap/sun.c genfslist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(sun_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh sun > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh sun > $@ || (rm -f $@; exit 1)
 
 
 sun_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1803,15 +1785,15 @@ UNDSYMFILES += und-acorn.lst
 
 acorn.mod: pre-acorn.o mod-acorn.o
        -rm -f $@
-       $(CC) $(acorn_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-acorn.o: acorn_mod-partmap_acorn.o
        -rm -f $@
-       $(CC) $(acorn_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-acorn.o: mod-acorn.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -c -o $@ $<
 
 mod-acorn.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'acorn' $< > $@ || (rm -f $@; exit 1)
@@ -1826,10 +1808,10 @@ und-acorn.lst: pre-acorn.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 acorn_mod-partmap_acorn.o: partmap/acorn.c
-       $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_TARGET_CFLAGS) -c -o $@ $<
 
 acorn_mod-partmap_acorn.d: partmap/acorn.c
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -M $<     | sed 's,acorn\.o[ :]*,acorn_mod-partmap_acorn.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_TARGET_CFLAGS) -M $<         | sed 's,acorn\.o[ :]*,acorn_mod-partmap_acorn.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include acorn_mod-partmap_acorn.d
 
@@ -1838,10 +1820,10 @@ COMMANDFILES += cmd-acorn_mod-partmap_acorn.lst
 FSFILES += fs-acorn_mod-partmap_acorn.lst
 
 cmd-acorn_mod-partmap_acorn.lst: partmap/acorn.c gencmdlist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -E $<     | sh $(srcdir)/gencmdlist.sh acorn > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/gencmdlist.sh acorn > $@ || (rm -f $@; exit 1)
 
 fs-acorn_mod-partmap_acorn.lst: partmap/acorn.c genfslist.sh
-       set -e;           $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) $(acorn_mod_CFLAGS) -E $<     | sh $(srcdir)/genfslist.sh acorn > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_TARGET_CFLAGS) -E $<         | sh $(srcdir)/genfslist.sh acorn > $@ || (rm -f $@; exit 1)
 
 
 acorn_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1858,15 +1840,15 @@ UNDSYMFILES += und-loopback.lst
 
 loopback.mod: pre-loopback.o mod-loopback.o
        -rm -f $@
-       $(CC) $(loopback_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-loopback.o: loopback_mod-disk_loopback.o
        -rm -f $@
-       $(CC) $(loopback_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-loopback.o: mod-loopback.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -c -o $@ $<
 
 mod-loopback.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'loopback' $< > $@ || (rm -f $@; exit 1)
@@ -1881,10 +1863,10 @@ und-loopback.lst: pre-loopback.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 loopback_mod-disk_loopback.o: disk/loopback.c
-       $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_TARGET_CFLAGS) -c -o $@ $<
 
 loopback_mod-disk_loopback.d: disk/loopback.c
-       set -e;           $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -M $<        | sed 's,loopback\.o[ :]*,loopback_mod-disk_loopback.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_TARGET_CFLAGS) -M $<    | sed 's,loopback\.o[ :]*,loopback_mod-disk_loopback.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include loopback_mod-disk_loopback.d
 
@@ -1893,10 +1875,10 @@ COMMANDFILES += cmd-loopback_mod-disk_loopback.lst
 FSFILES += fs-loopback_mod-disk_loopback.lst
 
 cmd-loopback_mod-disk_loopback.lst: disk/loopback.c gencmdlist.sh
-       set -e;           $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh loopback > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh loopback > $@ || (rm -f $@; exit 1)
 
 fs-loopback_mod-disk_loopback.lst: disk/loopback.c genfslist.sh
-       set -e;           $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) $(loopback_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh loopback > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh loopback > $@ || (rm -f $@; exit 1)
 
 
 loopback_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1914,15 +1896,15 @@ UNDSYMFILES += und-suspend.lst
 
 suspend.mod: pre-suspend.o mod-suspend.o
        -rm -f $@
-       $(CC) $(suspend_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-suspend.o: suspend_mod-commands_ieee1275_suspend.o
        -rm -f $@
-       $(CC) $(suspend_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-suspend.o: mod-suspend.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $<
 
 mod-suspend.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'suspend' $< > $@ || (rm -f $@; exit 1)
@@ -1937,10 +1919,10 @@ und-suspend.lst: pre-suspend.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 suspend_mod-commands_ieee1275_suspend.o: commands/ieee1275/suspend.c
-       $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_TARGET_CFLAGS) -c -o $@ $<
 
 suspend_mod-commands_ieee1275_suspend.d: commands/ieee1275/suspend.c
-       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -M $<       | sed 's,suspend\.o[ :]*,suspend_mod-commands_ieee1275_suspend.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_TARGET_CFLAGS) -M $<           | sed 's,suspend\.o[ :]*,suspend_mod-commands_ieee1275_suspend.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include suspend_mod-commands_ieee1275_suspend.d
 
@@ -1949,10 +1931,10 @@ COMMANDFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst
 FSFILES += fs-suspend_mod-commands_ieee1275_suspend.lst
 
 cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c gencmdlist.sh
-       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -E $<       | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1)
 
 fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c genfslist.sh
-       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(suspend_mod_CFLAGS) -E $<       | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_TARGET_CFLAGS) -E $<           | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1)
 
 
 suspend_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -1970,15 +1952,15 @@ UNDSYMFILES += und-reboot.lst
 
 reboot.mod: pre-reboot.o mod-reboot.o
        -rm -f $@
-       $(CC) $(reboot_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-reboot.o: reboot_mod-commands_ieee1275_reboot.o
        -rm -f $@
-       $(CC) $(reboot_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-reboot.o: mod-reboot.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
 
 mod-reboot.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1)
@@ -1993,10 +1975,10 @@ und-reboot.lst: pre-reboot.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 reboot_mod-commands_ieee1275_reboot.o: commands/ieee1275/reboot.c
-       $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_TARGET_CFLAGS) -c -o $@ $<
 
 reboot_mod-commands_ieee1275_reboot.d: commands/ieee1275/reboot.c
-       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -M $<        | sed 's,reboot\.o[ :]*,reboot_mod-commands_ieee1275_reboot.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_TARGET_CFLAGS) -M $<    | sed 's,reboot\.o[ :]*,reboot_mod-commands_ieee1275_reboot.o $@ : ,g' > $@;    [ -s $@ ] || rm -f $@
 
 -include reboot_mod-commands_ieee1275_reboot.d
 
@@ -2005,10 +1987,10 @@ COMMANDFILES += cmd-reboot_mod-commands_ieee1275_reboot.lst
 FSFILES += fs-reboot_mod-commands_ieee1275_reboot.lst
 
 cmd-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c gencmdlist.sh
-       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1)
 
 fs-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c genfslist.sh
-       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(reboot_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1)
 
 
 reboot_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -2026,15 +2008,15 @@ UNDSYMFILES += und-halt.lst
 
 halt.mod: pre-halt.o mod-halt.o
        -rm -f $@
-       $(CC) $(halt_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-halt.o: halt_mod-commands_ieee1275_halt.o
        -rm -f $@
-       $(CC) $(halt_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-halt.o: mod-halt.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
 
 mod-halt.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1)
@@ -2049,10 +2031,10 @@ und-halt.lst: pre-halt.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 halt_mod-commands_ieee1275_halt.o: commands/ieee1275/halt.c
-       $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_TARGET_CFLAGS) -c -o $@ $<
 
 halt_mod-commands_ieee1275_halt.d: commands/ieee1275/halt.c
-       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -M $<          | sed 's,halt\.o[ :]*,halt_mod-commands_ieee1275_halt.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_TARGET_CFLAGS) -M $<      | sed 's,halt\.o[ :]*,halt_mod-commands_ieee1275_halt.o $@ : ,g' > $@;          [ -s $@ ] || rm -f $@
 
 -include halt_mod-commands_ieee1275_halt.d
 
@@ -2061,10 +2043,10 @@ COMMANDFILES += cmd-halt_mod-commands_ieee1275_halt.lst
 FSFILES += fs-halt_mod-commands_ieee1275_halt.lst
 
 cmd-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c gencmdlist.sh
-       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1)
 
 fs-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c genfslist.sh
-       set -e;           $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) $(halt_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1)
 
 
 halt_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -2082,15 +2064,15 @@ UNDSYMFILES += und-help.lst
 
 help.mod: pre-help.o mod-help.o
        -rm -f $@
-       $(CC) $(help_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-help.o: help_mod-commands_help.o
        -rm -f $@
-       $(CC) $(help_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-help.o: mod-help.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -c -o $@ $<
 
 mod-help.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'help' $< > $@ || (rm -f $@; exit 1)
@@ -2105,10 +2087,10 @@ und-help.lst: pre-help.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 help_mod-commands_help.o: commands/help.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_TARGET_CFLAGS) -c -o $@ $<
 
 help_mod-commands_help.d: commands/help.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -M $<    | sed 's,help\.o[ :]*,help_mod-commands_help.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_TARGET_CFLAGS) -M $<        | sed 's,help\.o[ :]*,help_mod-commands_help.o $@ : ,g' > $@;           [ -s $@ ] || rm -f $@
 
 -include help_mod-commands_help.d
 
@@ -2117,10 +2099,10 @@ COMMANDFILES += cmd-help_mod-commands_help.lst
 FSFILES += fs-help_mod-commands_help.lst
 
 cmd-help_mod-commands_help.lst: commands/help.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh help > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh help > $@ || (rm -f $@; exit 1)
 
 fs-help_mod-commands_help.lst: commands/help.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(help_mod_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh help > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_TARGET_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh help > $@ || (rm -f $@; exit 1)
 
 
 help_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -2148,15 +2130,15 @@ UNDSYMFILES += und-configfile.lst
 
 configfile.mod: pre-configfile.o mod-configfile.o
        -rm -f $@
-       $(CC) $(configfile_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-configfile.o: configfile_mod-commands_configfile.o
        -rm -f $@
-       $(CC) $(configfile_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-configfile.o: mod-configfile.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -c -o $@ $<
 
 mod-configfile.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'configfile' $< > $@ || (rm -f $@; exit 1)
@@ -2171,10 +2153,10 @@ und-configfile.lst: pre-configfile.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 configfile_mod-commands_configfile.o: commands/configfile.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_TARGET_CFLAGS) -c -o $@ $<
 
 configfile_mod-commands_configfile.d: commands/configfile.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -M $<      | sed 's,configfile\.o[ :]*,configfile_mod-commands_configfile.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_TARGET_CFLAGS) -M $<          | sed 's,configfile\.o[ :]*,configfile_mod-commands_configfile.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include configfile_mod-commands_configfile.d
 
@@ -2183,10 +2165,10 @@ COMMANDFILES += cmd-configfile_mod-commands_configfile.lst
 FSFILES += fs-configfile_mod-commands_configfile.lst
 
 cmd-configfile_mod-commands_configfile.lst: commands/configfile.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh configfile > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh configfile > $@ || (rm -f $@; exit 1)
 
 fs-configfile_mod-commands_configfile.lst: commands/configfile.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(configfile_mod_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh configfile > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_TARGET_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh configfile > $@ || (rm -f $@; exit 1)
 
 
 configfile_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -2204,15 +2186,15 @@ UNDSYMFILES += und-search.lst
 
 search.mod: pre-search.o mod-search.o
        -rm -f $@
-       $(CC) $(search_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-search.o: search_mod-commands_search.o
        -rm -f $@
-       $(CC) $(search_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-search.o: mod-search.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -c -o $@ $<
 
 mod-search.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'search' $< > $@ || (rm -f $@; exit 1)
@@ -2227,10 +2209,10 @@ und-search.lst: pre-search.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 search_mod-commands_search.o: commands/search.c
-       $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_TARGET_CFLAGS) -c -o $@ $<
 
 search_mod-commands_search.d: commands/search.c
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -M $<          | sed 's,search\.o[ :]*,search_mod-commands_search.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_TARGET_CFLAGS) -M $<      | sed 's,search\.o[ :]*,search_mod-commands_search.o $@ : ,g' > $@;     [ -s $@ ] || rm -f $@
 
 -include search_mod-commands_search.d
 
@@ -2239,10 +2221,10 @@ COMMANDFILES += cmd-search_mod-commands_search.lst
 FSFILES += fs-search_mod-commands_search.lst
 
 cmd-search_mod-commands_search.lst: commands/search.c gencmdlist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -E $<          | sh $(srcdir)/gencmdlist.sh search > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/gencmdlist.sh search > $@ || (rm -f $@; exit 1)
 
 fs-search_mod-commands_search.lst: commands/search.c genfslist.sh
-       set -e;           $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) $(search_mod_CFLAGS) -E $<          | sh $(srcdir)/genfslist.sh search > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_TARGET_CFLAGS) -E $<      | sh $(srcdir)/genfslist.sh search > $@ || (rm -f $@; exit 1)
 
 
 search_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -2260,15 +2242,15 @@ UNDSYMFILES += und-gzio.lst
 
 gzio.mod: pre-gzio.o mod-gzio.o
        -rm -f $@
-       $(CC) $(gzio_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 pre-gzio.o: gzio_mod-io_gzio.o
        -rm -f $@
-       $(CC) $(gzio_mod_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 mod-gzio.o: mod-gzio.c
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -c -o $@ $<
 
 mod-gzio.c: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh 'gzio' $< > $@ || (rm -f $@; exit 1)
@@ -2283,10 +2265,10 @@ und-gzio.lst: pre-gzio.o
        $(NM) -u -P -p $< | cut -f1 -d' ' >> $@
 
 gzio_mod-io_gzio.o: io/gzio.c
-       $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_TARGET_CFLAGS) -c -o $@ $<
 
 gzio_mod-io_gzio.d: io/gzio.c
-       set -e;           $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -M $<        | sed 's,gzio\.o[ :]*,gzio_mod-io_gzio.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
+       set -e;           $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_TARGET_CFLAGS) -M $<    | sed 's,gzio\.o[ :]*,gzio_mod-io_gzio.o $@ : ,g' > $@;         [ -s $@ ] || rm -f $@
 
 -include gzio_mod-io_gzio.d
 
@@ -2295,10 +2277,10 @@ COMMANDFILES += cmd-gzio_mod-io_gzio.lst
 FSFILES += fs-gzio_mod-io_gzio.lst
 
 cmd-gzio_mod-io_gzio.lst: io/gzio.c gencmdlist.sh
-       set -e;           $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -E $<        | sh $(srcdir)/gencmdlist.sh gzio > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/gencmdlist.sh gzio > $@ || (rm -f $@; exit 1)
 
 fs-gzio_mod-io_gzio.lst: io/gzio.c genfslist.sh
-       set -e;           $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) $(gzio_mod_CFLAGS) -E $<        | sh $(srcdir)/genfslist.sh gzio > $@ || (rm -f $@; exit 1)
+       set -e;           $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_TARGET_CFLAGS) -E $<    | sh $(srcdir)/genfslist.sh gzio > $@ || (rm -f $@; exit 1)
 
 
 gzio_mod_CFLAGS = $(COMMON_CFLAGS)
index 1d7575a1ea5af203b26d7c780893391f6ce1ff90..b64390a38b09a5086eddb2dd3e118ad0528f0c60 100644 (file)
@@ -31,7 +31,6 @@ pkgdata_PROGRAMS = kernel.elf
 
 # Utilities.
 #bin_UTILITIES = grub-emu grub-mkimage
-noinst_UTILITIES = genmoddep
 
 # For grub-mkimage.
 grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \
@@ -75,9 +74,6 @@ kernel_elf_CFLAGS = $(COMMON_CFLAGS)
 kernel_elf_ASFLAGS = $(COMMON_ASFLAGS)
 kernel_elf_LDFLAGS = -mno-app-regs -nostdlib -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc
 
-# For genmoddep.
-genmoddep_SOURCES = util/genmoddep.c
-
 # Modules.
 #_linux.mod linux.mod
 pkgdata_MODULES = fat.mod ufs.mod ext2.mod minix.mod \
index 2575c175cb92a5a4be1d5bfb3d03479a333672b9..e35f5e820f56ec39073816e974ba49b706d7e6bc 100644 (file)
--- a/configure
+++ b/configure
@@ -311,7 +311,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os platform CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT YACC INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE OBJCOPY ac_ct_OBJCOPY STRIP ac_ct_STRIP NM ac_ct_NM LD ac_ct_LD RUBY BUILD_CC CPP EGREP LIBLZO LIBCURSES LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os platform YACC INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK SET_MAKE RUBY CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LIBLZO LIBCURSES TARGET_CC ac_ct_TARGET_CC OBJCOPY ac_ct_OBJCOPY STRIP ac_ct_STRIP NM ac_ct_NM TARGET_CFLAGS TARGET_CPPFLAGS TARGET_LDFLAGS LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -836,6 +836,7 @@ _ACEOF
 System types:
   --build=BUILD     configure for building on BUILD [guessed]
   --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
 _ACEOF
 fi
 
@@ -1320,7 +1321,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
           ac_config_headers="$ac_config_headers config.h"
 
 
-# Checks for build and host systems.
+# Checks for host and target systems.
 ac_aux_dir=
 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
   if test -f $ac_dir/install-sh; then
@@ -1400,12 +1401,45 @@ host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 
 
+echo "$as_me:$LINENO: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_target_alias=$target_alias
+test "x$ac_cv_target_alias" = "x" &&
+  ac_cv_target_alias=$ac_cv_host_alias
+ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
+  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=$ac_cv_target
+target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
 
 case "$host_cpu" in
-  i[3456]86) host_cpu=i386 ;;
-  x86_64) host_cpu=i386 biarch32=1 ;;
+  x86_64) host_m32=1 ;;
+  powerpc64) host_m32=1 ;;
+esac
+
+case "$target_cpu" in
+  i[3456]86) target_cpu=i386 ;;
+  x86_64) target_cpu=i386 target_m32=1 ;;
   powerpc) ;;
-  powerpc64) host_cpu=powerpc biarch32=1;;
+  powerpc64) target_cpu=powerpc target_m32=1;;
   sparc64) ;;
   *) { { echo "$as_me:$LINENO: error: unsupported CPU type" >&5
 echo "$as_me: error: unsupported CPU type" >&2;}
@@ -1422,7 +1456,7 @@ fi;
 
 # Guess the platform if not specified.
 if test "x$with_platform" = x; then
-  case "$host_cpu"-"$host_vendor" in
+  case "$target_cpu"-"$target_vendor" in
     i386-apple) platform=efi ;;
     i386-*) platform=pc ;;
     powerpc-*) platform=ieee1275 ;;
@@ -1436,7 +1470,7 @@ else
 fi
 
 # Sanity check.
-case "$host_cpu"-"$platform" in
+case "$target_cpu"-"$platform" in
   i386-efi) ;;
   i386-pc) ;;
   powerpc-ieee1275) ;;
@@ -1449,11 +1483,250 @@ esac
 
 
 
-# Checks for programs.
-if test "x$CFLAGS" = x; then
-  default_CFLAGS=yes
+#
+# Checks for build programs.
+#
+
+for ac_prog in bison
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_YACC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$YACC"; then
+  ac_cv_prog_YACC="$YACC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_YACC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+YACC=$ac_cv_prog_YACC
+if test -n "$YACC"; then
+  echo "$as_me:$LINENO: result: $YACC" >&5
+echo "${ECHO_T}$YACC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$YACC" && break
+done
+
+if test "x$YACC" = x; then
+  { { echo "$as_me:$LINENO: error: Could not find bison." >&5
+echo "$as_me: error: Could not find bison." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+         if test $ac_prog = install &&
+           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # AIX install.  It has an incompatible calling convention.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+           break 3
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+done
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AWK="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$AWK" && break
+done
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+all:
+       @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+  SET_MAKE=
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+# This is not a "must".
+# Extract the first word of "ruby", so it can be a program name with args.
+set dummy ruby; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_RUBY+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $RUBY in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_RUBY="$RUBY" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_RUBY="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+RUBY=$ac_cv_path_RUBY
+
+if test -n "$RUBY"; then
+  echo "$as_me:$LINENO: result: $RUBY" >&5
+echo "${ECHO_T}$RUBY" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
+
+#
+# Checks for host programs.
+#
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2384,52 +2657,10 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-
-for ac_prog in bison
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_YACC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$YACC"; then
-  ac_cv_prog_YACC="$YACC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_YACC="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-YACC=$ac_cv_prog_YACC
-if test -n "$YACC"; then
-  echo "$as_me:$LINENO: result: $YACC" >&5
-echo "${ECHO_T}$YACC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$YACC" && break
-done
-
-if test "x$YACC" = x; then
-  { { echo "$as_me:$LINENO: error: Could not find bison." >&5
-echo "$as_me: error: Could not find bison." >&2;}
-   { (exit 1); exit 1; }; }
-fi
+# Must be GCC.
+test "x$GCC" = xyes || { { echo "$as_me:$LINENO: error: GCC is required" >&5
+echo "$as_me: error: GCC is required" >&2;}
+   { (exit 1); exit 1; }; }
 
 
 # Check whether --enable-largefile or --disable-largefile was given.
@@ -2797,34 +3028,28 @@ rm -f conftest*
 fi
 
 
-# Must be GCC.
-test "x$GCC" = xyes || { { echo "$as_me:$LINENO: error: GCC is required" >&5
-echo "$as_me: error: GCC is required" >&2;}
-   { (exit 1); exit 1; }; }
-
-if test "x$default_CFLAGS" = xyes; then
-  # debug flags.
-  tmp_CFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \
-               -Wundef -Wstrict-prototypes -g"
-
-  # optimization flags.
-  echo "$as_me:$LINENO: checking whether optimization for size works" >&5
-echo $ECHO_N "checking whether optimization for size works... $ECHO_C" >&6
-if test "${size_flag+set}" = set; then
+# Identify characteristics of the host architecture.
+echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
+if test "${ac_cv_c_bigendian+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-    CFLAGS=-Os
-    cat >conftest.$ac_ext <<_ACEOF
+  # See if sys/param.h defines the BYTE_ORDER macro.
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/param.h>
 
 int
 main ()
 {
+#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
+ bogus endian macros
+#endif
 
   ;
   return 0;
@@ -2852,43 +3077,22 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  size_flag=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-size_flag=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-echo "$as_me:$LINENO: result: $size_flag" >&5
-echo "${ECHO_T}$size_flag" >&6
-  if test "x$size_flag" = xyes; then
-    tmp_CFLAGS="$tmp_CFLAGS -Os"
-  else
-    tmp_CFLAGS="$tmp_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops"
-  fi
-
-  # Force no alignment to save space on i386.
-  if test "x$host_cpu" = xi386; then
-    echo "$as_me:$LINENO: checking whether -falign-loops works" >&5
-echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6
-if test "${falign_loop_flag+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-      CFLAGS="-falign-loops=1"
-      cat >conftest.$ac_ext <<_ACEOF
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/param.h>
 
 int
 main ()
 {
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+#endif
 
   ;
   return 0;
@@ -2916,111 +3120,45 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  falign_loop_flag=yes
+  ac_cv_c_bigendian=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-falign_loop_flag=no
+ac_cv_c_bigendian=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-echo "$as_me:$LINENO: result: $falign_loop_flag" >&5
-echo "${ECHO_T}$falign_loop_flag" >&6
-
-    if test "x$falign_loop_flag" = xyes; then
-      tmp_CFLAGS="$tmp_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
-    else
-      tmp_CFLAGS="$tmp_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
-    fi
-  fi
-
-  if test "x$biarch32" = x1; then
-    tmp_CFLAGS="$tmp_CFLAGS -m32"
-    LDFLAGS="$LDFLAGS -m32"
-
-  fi
-
-  CFLAGS="$tmp_CFLAGS"
-fi
-
-
-# Defined in aclocal.m4.
-
-echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5
-echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" >&6
-if test "${grub_cv_asm_uscore+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat > conftest.c <<\EOF
-int
-func (int *list)
-{
-  *list = 0;
-  return *list;
-}
-EOF
-
-if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } && test -s conftest.s; then
-  true
-else
-  { { echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5
-echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-if grep _func conftest.s >/dev/null 2>&1; then
-  grub_cv_asm_uscore=yes
 else
-  grub_cv_asm_uscore=no
-fi
-
-rm -f conftest*
-fi
-
-
-if test "x$grub_cv_asm_uscore" = xyes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ASM_USCORE $grub_cv_asm_uscore
-_ACEOF
-
-fi
-
-echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5
-echo "${ECHO_T}$grub_cv_asm_uscore" >&6
-
-if test "x$host_cpu" = xi386; then
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-echo "$as_me:$LINENO: checking if start is defined by the compiler" >&5
-echo $ECHO_N "checking if start is defined by the compiler... $ECHO_C" >&6
-if test "${grub_cv_check_start_symbol+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+# It does not; compile a test program.
+if test "$cross_compiling" = yes; then
+  # try to guess the endianness by grepping values into an object file
+  ac_cv_c_bigendian=unknown
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
+short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
+short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
 int
 main ()
 {
-asm ("incl start")
+ _ascii (); _ebcdic ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -3034,31 +3172,29 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  grub_cv_check_start_symbol=yes
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
+  ac_cv_c_bigendian=yes
+fi
+if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+  if test "$ac_cv_c_bigendian" = unknown; then
+    ac_cv_c_bigendian=no
+  else
+    # finding both strings is unlikely to happen, but who knows?
+    ac_cv_c_bigendian=unknown
+  fi
+fi
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-grub_cv_check_start_symbol=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
 fi
-
-
-echo "$as_me:$LINENO: result: $grub_cv_check_start_symbol" >&5
-echo "${ECHO_T}$grub_cv_check_start_symbol" >&6
-
-echo "$as_me:$LINENO: checking if _start is defined by the compiler" >&5
-echo $ECHO_N "checking if _start is defined by the compiler... $ECHO_C" >&6
-if test "${grub_cv_check_uscore_start_symbol+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -3066,271 +3202,316 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
 int
 main ()
 {
-asm ("incl _start")
-  ;
-  return 0;
+  /* Are we little or big endian?  From Harbison&Steele.  */
+  union
+  {
+    long l;
+    char c[sizeof (long)];
+  } u;
+  u.l = 1;
+  exit (u.c[sizeof (long) - 1] == 1);
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
+rm -f conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (eval $ac_link) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  grub_cv_check_uscore_start_symbol=yes
+  ac_cv_c_bigendian=no
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-grub_cv_check_uscore_start_symbol=no
+( exit $ac_status )
+ac_cv_c_bigendian=yes
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+echo "${ECHO_T}$ac_cv_c_bigendian" >&6
+case $ac_cv_c_bigendian in
+  yes)
 
-
-echo "$as_me:$LINENO: result: $grub_cv_check_uscore_start_symbol" >&5
-echo "${ECHO_T}$grub_cv_check_uscore_start_symbol" >&6
-
-
-
-
-if test "x$grub_cv_check_start_symbol" = xyes; then
-  cat >>confdefs.h <<\_ACEOF
-#define START_SYMBOL start
-_ACEOF
-
-elif test "x$grub_cv_check_uscore_start_symbol" = xyes; then
-  cat >>confdefs.h <<\_ACEOF
-#define START_SYMBOL _start
+cat >>confdefs.h <<\_ACEOF
+#define WORDS_BIGENDIAN 1
 _ACEOF
+ ;;
+  no)
+     ;;
+  *)
+    { { echo "$as_me:$LINENO: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&5
+echo "$as_me: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
 
-else
-  { { echo "$as_me:$LINENO: error: neither start nor _start is defined" >&5
-echo "$as_me: error: neither start nor _start is defined" >&2;}
-   { (exit 1); exit 1; }; }
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
 fi
-
-
-echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5
-echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" >&6
-if test "${grub_cv_check_uscore_uscore_bss_start_symbol+set}" = set; then
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-int
-main ()
-{
-asm ("incl __bss_start")
-  ;
-  return 0;
-}
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  grub_cv_check_uscore_uscore_bss_start_symbol=yes
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-grub_cv_check_uscore_uscore_bss_start_symbol=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+  # Broken: fails on valid input.
+continue
 fi
+rm -f conftest.err conftest.$ac_ext
 
-
-echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5
-echo "${ECHO_T}$grub_cv_check_uscore_uscore_bss_start_symbol" >&6
-
-echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5
-echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" >&6
-if test "${grub_cv_check_edata_symbol+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-int
-main ()
-{
-asm ("incl edata")
-  ;
-  return 0;
-}
+#include <ac_nonexistent.h>
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  grub_cv_check_edata_symbol=yes
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-grub_cv_check_edata_symbol=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+  # Passes both tests.
+ac_preproc_ok=:
+break
 fi
+rm -f conftest.err conftest.$ac_ext
 
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
 
-echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5
-echo "${ECHO_T}$grub_cv_check_edata_symbol" >&6
+    done
+    ac_cv_prog_CPP=$CPP
 
-echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5
-echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" >&6
-if test "${grub_cv_check_uscore_edata_symbol+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+  CPP=$ac_cv_prog_CPP
 else
+  ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-int
-main ()
-{
-asm ("incl _edata")
-  ;
-  return 0;
-}
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  grub_cv_check_uscore_edata_symbol=yes
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-grub_cv_check_uscore_edata_symbol=no
+  # Broken: fails on valid input.
+continue
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-
-
-echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5
-echo "${ECHO_T}$grub_cv_check_uscore_edata_symbol" >&6
-
-
-
+rm -f conftest.err conftest.$ac_ext
 
-if test "x$grub_cv_check_uscore_uscore_bss_start_symbol" = xyes; then
-  cat >>confdefs.h <<\_ACEOF
-#define BSS_START_SYMBOL __bss_start
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-
-elif test "x$grub_cv_check_edata_symbol" = xyes; then
-  cat >>confdefs.h <<\_ACEOF
-#define BSS_START_SYMBOL edata
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
 _ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-elif test "x$grub_cv_check_uscore_edata_symbol" = xyes; then
-  cat >>confdefs.h <<\_ACEOF
-#define BSS_START_SYMBOL _edata
-_ACEOF
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
 
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
 else
-  { { echo "$as_me:$LINENO: error: none of __bss_start, edata or _edata is defined" >&5
-echo "$as_me: error: none of __bss_start, edata or _edata is defined" >&2;}
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
 
-echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5
-echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" >&6
-if test "${grub_cv_check_end_symbol+set}" = set; then
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -3339,18 +3520,22 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
 
 int
 main ()
 {
-asm ("incl end")
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -3364,31 +3549,67 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  grub_cv_check_end_symbol=yes
+  ac_cv_header_stdc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-grub_cv_check_end_symbol=no
+ac_cv_header_stdc=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
 fi
+rm -f conftest*
 
+fi
 
-echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5
-echo "${ECHO_T}$grub_cv_check_end_symbol" >&6
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
 
-echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5
-echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" >&6
-if test "${grub_cv_check_uscore_end_symbol+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -3396,206 +3617,140 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
 
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
 int
 main ()
 {
-asm ("incl _end")
-  ;
-  return 0;
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
+rm -f conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  (eval $ac_link) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  grub_cv_check_uscore_end_symbol=yes
+  :
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-grub_cv_check_uscore_end_symbol=no
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
 fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
 
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
 
-echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5
-echo "${ECHO_T}$grub_cv_check_uscore_end_symbol" >&6
+fi
 
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
 
 
 
-if test "x$grub_cv_check_end_symbol" = xyes; then
-  cat >>confdefs.h <<\_ACEOF
-#define END_SYMBOL end
-_ACEOF
 
-elif test "x$grub_cv_check_uscore_end_symbol" = xyes; then
-  cat >>confdefs.h <<\_ACEOF
-#define END_SYMBOL _end
-_ACEOF
 
-else
-  { { echo "$as_me:$LINENO: error: neither end nor _end is defined" >&5
-echo "$as_me: error: neither end nor _end is defined" >&2;}
-   { (exit 1); exit 1; }; }
-fi
 
-fi
 
-if test "x$host_cpu" = xi386; then
 
-echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5
-echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" >&6
-if test "${grub_cv_i386_asm_prefix_requirement+set}" = set; then
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.s <<\EOF
-       .code16
-l1:    addr32  movb    %al, l1
-EOF
-
-if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } && test -s conftest.o; then
-  grub_cv_i386_asm_prefix_requirement=yes
-else
-  grub_cv_i386_asm_prefix_requirement=no
-fi
-
-rm -f conftest*
-fi
-
-
-if test "x$grub_cv_i386_asm_prefix_requirement" = xyes; then
-  grub_tmp_addr32="addr32"
-  grub_tmp_data32="data32"
-else
-  grub_tmp_addr32="addr32;"
-  grub_tmp_data32="data32;"
-fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define ADDR32 $grub_tmp_addr32
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
 
-
-cat >>confdefs.h <<_ACEOF
-#define DATA32 $grub_tmp_data32
+#include <$ac_header>
 _ACEOF
-
-
-echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5
-echo "${ECHO_T}$grub_cv_i386_asm_prefix_requirement" >&6
-
-
-echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5
-echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" >&6
-if test "${grub_cv_i386_asm_addr32+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat > conftest.s.in <<\EOF
-       .code16
-l1:    @ADDR32@        movb    %al, l1
-EOF
-
-if test "x$grub_cv_i386_asm_prefix_requirement" = xyes; then
-  sed -e s/@ADDR32@/addr32/ < conftest.s.in > conftest.s
-else
-  sed -e s/@ADDR32@/addr32\;/ < conftest.s.in > conftest.s
-fi
-
-if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } && test -s conftest.o; then
-  grub_cv_i386_asm_addr32=yes
-else
-  grub_cv_i386_asm_addr32=no
-fi
-
-rm -f conftest*
-fi
-
-
-echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5
-echo "${ECHO_T}$grub_cv_i386_asm_addr32" >&6
-
-echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5
-echo $ECHO_N "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... $ECHO_C" >&6
-if test "${grub_cv_i386_asm_absolute_without_asterisk+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat > conftest.s <<\EOF
-       lcall   *(offset)
-offset:
-       .long   0
-       .word   0
-EOF
-
-if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } && test -s conftest.o; then
-  grub_cv_i386_asm_absolute_without_asterisk=no
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
 else
-  grub_cv_i386_asm_absolute_without_asterisk=yes
-fi
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-rm -f conftest*
+eval "$as_ac_Header=no"
 fi
-
-
-if test "x$grub_cv_i386_asm_absolute_without_asterisk" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define ABSOLUTE_WITHOUT_ASTERISK 1
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5
-echo "${ECHO_T}$grub_cv_i386_asm_absolute_without_asterisk" >&6
+done
 
-echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5
-echo $ECHO_N "checking if GCC has the regparm=3 bug... $ECHO_C" >&6
-if test "${grub_cv_i386_check_nested_functions+set}" = set; then
+
+echo "$as_me:$LINENO: checking for void *" >&5
+echo $ECHO_N "checking for void *... $ECHO_C" >&6
+if test "${ac_cv_type_void_p+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -3603,702 +3758,490 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-static int
-test (int *n)
-{
-  return *n == -1;
-}
-
-static int
-testfunc (int __attribute__ ((__regparm__ (3))) (*hook) (int a, int b, int *c))
-{
-  int a = 0;
-  int b = 0;
-  int c = -1;
-  return hook (a, b, &c);
-}
-
+$ac_includes_default
 int
-main (void)
+main ()
 {
-  int __attribute__ ((__regparm__ (3))) nestedfunc (int a, int b, int *c)
-    {
-      return a == b && test (c);
-    }
-  return testfunc (nestedfunc) ? 0 : 1;
+if ((void * *) 0)
+  return 0;
+if (sizeof (void *))
+  return 0;
+  ;
+  return 0;
 }
-
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  grub_cv_i386_check_nested_functions=no
+  ac_cv_type_void_p=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-grub_cv_i386_check_nested_functions=yes
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ac_cv_type_void_p=no
 fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5
+echo "${ECHO_T}$ac_cv_type_void_p" >&6
 
-
-echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5
-echo "${ECHO_T}$grub_cv_i386_check_nested_functions" >&6
-
-if test "x$grub_cv_i386_check_nested_functions" = xyes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (2)))
-_ACEOF
-
+echo "$as_me:$LINENO: checking size of void *" >&5
+echo $ECHO_N "checking size of void *... $ECHO_C" >&6
+if test "${ac_cv_sizeof_void_p+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-cat >>confdefs.h <<\_ACEOF
-#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (2)))
+  if test "$ac_cv_type_void_p" = yes; then
+  # The cast to unsigned long works around a bug in the HP C Compiler
+  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+  # This bug is HP SR number 8606223364.
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)];
+test_array [0] = 0
 
-fi
-
-else
-
-cat >>confdefs.h <<\_ACEOF
-#define NESTED_FUNC_ATTR
+  ;
+  return 0;
+}
 _ACEOF
-
-fi
-
-# Find a good install program.  We prefer a C program (faster),
-# so one script is as good as another.  But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
-if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in
-  ./ | .// | /cC/* | \
-  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
-  /usr/ucb/* ) ;;
-  *)
-    # OSF1 and SCO ODT 3.0 have their own names for install.
-    # Don't use installbsd from OSF since it installs stuff as root
-    # by default.
-    for ac_prog in ginstall scoinst install; do
-      for ac_exec_ext in '' $ac_executable_extensions; do
-       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
-         if test $ac_prog = install &&
-           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-           # AIX install.  It has an incompatible calling convention.
-           :
-         elif test $ac_prog = install &&
-           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-           # program-specific install script used by HP pwplus--don't use.
-           :
-         else
-           ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-           break 3
-         fi
-       fi
-      done
-    done
-    ;;
-esac
-done
-
-
-fi
-  if test "${ac_cv_path_install+set}" = set; then
-    INSTALL=$ac_cv_path_install
-  else
-    # As a last resort, use the slow shell script.  We don't cache a
-    # path for INSTALL within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the path is relative.
-    INSTALL=$ac_install_sh
-  fi
-fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.make <<\_ACEOF
-all:
-       @echo 'ac_maketemp="$(MAKE)"'
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
-  eval ac_cv_prog_make_${ac_make}_set=yes
-else
-  eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftest.make
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-  SET_MAKE=
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-  SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args.
-set dummy ${ac_tool_prefix}objcopy; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_OBJCOPY+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$OBJCOPY"; then
-  ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-OBJCOPY=$ac_cv_prog_OBJCOPY
-if test -n "$OBJCOPY"; then
-  echo "$as_me:$LINENO: result: $OBJCOPY" >&5
-echo "${ECHO_T}$OBJCOPY" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_OBJCOPY"; then
-  ac_ct_OBJCOPY=$OBJCOPY
-  # Extract the first word of "objcopy", so it can be a program name with args.
-set dummy objcopy; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_OBJCOPY"; then
-  ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_OBJCOPY="objcopy"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY
-if test -n "$ac_ct_OBJCOPY"; then
-  echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5
-echo "${ECHO_T}$ac_ct_OBJCOPY" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  OBJCOPY=$ac_ct_OBJCOPY
-else
-  OBJCOPY="$ac_cv_prog_OBJCOPY"
-fi
-
-echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5
-echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6
-if test "${grub_cv_prog_objcopy_absolute+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat > conftest.c <<\EOF
-void
-cmain (void)
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
 {
-   *((int *) 0x1000) = 2;
-}
-EOF
+static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)];
+test_array [0] = 0
 
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest.o; then :
-else
-  { { echo "$as_me:$LINENO: error: ${CC-cc} cannot compile C source code" >&5
-echo "$as_me: error: ${CC-cc} cannot compile C source code" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-grub_cv_prog_objcopy_absolute=yes
-for link_addr in 2000 8000 7C00; do
-  if { ac_try='${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then :
-  else
-    { { echo "$as_me:$LINENO: error: ${CC-cc} cannot link at address $link_addr" >&5
-echo "$as_me: error: ${CC-cc} cannot link at address $link_addr" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-  if { ac_try='${OBJCOPY-objcopy} -O binary conftest.exec conftest'
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then :
-  else
-    { { echo "$as_me:$LINENO: error: ${OBJCOPY-objcopy} cannot create binary files" >&5
-echo "$as_me: error: ${OBJCOPY-objcopy} cannot create binary files" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-  if test ! -f conftest.old || { ac_try='cmp -s conftest.old conftest'
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr $ac_mid + 1`
+                   if test $ac_lo -le $ac_mid; then
+                     ac_lo= ac_hi=
+                     break
+                   fi
+                   ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-    mv -f conftest conftest.old
-  else
-    grub_cv_prog_objcopy_absolute=no
-    break
-  fi
-done
-rm -f conftest*
-fi
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)];
+test_array [0] = 0
 
-echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5
-echo "${ECHO_T}$grub_cv_prog_objcopy_absolute" >&6
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-if test "x$grub_cv_prog_objcopy_absolute" = xno; then
-  { { echo "$as_me:$LINENO: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&5
-echo "$as_me: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&2;}
-   { (exit 1); exit 1; }; }
+ac_hi=`expr '(' $ac_mid ')' - 1`
+                      if test $ac_mid -le $ac_hi; then
+                        ac_lo= ac_hi=
+                        break
+                      fi
+                      ac_mid=`expr 2 '*' $ac_mid`
 fi
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_lo= ac_hi=
 fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)];
+test_array [0] = 0
 
-fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid
 else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  STRIP=$ac_ct_STRIP
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_void_p=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (void *), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
 else
-  STRIP="$ac_cv_prog_STRIP"
-fi
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args.
-set dummy ${ac_tool_prefix}nm; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_NM+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$NM"; then
-  ac_cv_prog_NM="$NM" # Let the user override the test.
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
 else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_NM="${ac_tool_prefix}nm"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+long longval () { return (long) (sizeof (void *)); }
+unsigned long ulongval () { return (long) (sizeof (void *)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
 
-fi
-fi
-NM=$ac_cv_prog_NM
-if test -n "$NM"; then
-  echo "$as_me:$LINENO: result: $NM" >&5
-echo "${ECHO_T}$NM" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    exit (1);
+  if (((long) (sizeof (void *))) < 0)
+    {
+      long i = longval ();
+      if (i != ((long) (sizeof (void *))))
+       exit (1);
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long i = ulongval ();
+      if (i != ((long) (sizeof (void *))))
+       exit (1);
+      fprintf (f, "%lu\n", i);
+    }
+  exit (ferror (f) || fclose (f) != 0);
 
-fi
-if test -z "$ac_cv_prog_NM"; then
-  ac_ct_NM=$NM
-  # Extract the first word of "nm", so it can be a program name with args.
-set dummy nm; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_NM+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_NM"; then
-  ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test.
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_void_p=`cat conftest.val`
 else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_NM="nm"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+( exit $ac_status )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (void *), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
 fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-ac_ct_NM=$ac_cv_prog_ac_ct_NM
-if test -n "$ac_ct_NM"; then
-  echo "$as_me:$LINENO: result: $ac_ct_NM" >&5
-echo "${ECHO_T}$ac_ct_NM" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  NM=$ac_ct_NM
-else
-  NM="$ac_cv_prog_NM"
 fi
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ld; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_LD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$LD"; then
-  ac_cv_prog_LD="$LD" # Let the user override the test.
+rm -f conftest.val
 else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_LD="${ac_tool_prefix}ld"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
+  ac_cv_sizeof_void_p=0
 fi
-LD=$ac_cv_prog_LD
-if test -n "$LD"; then
-  echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
 fi
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5
+echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
+_ACEOF
 
-fi
-if test -z "$ac_cv_prog_LD"; then
-  ac_ct_LD=$LD
-  # Extract the first word of "ld", so it can be a program name with args.
-set dummy ld; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
+
+echo "$as_me:$LINENO: checking for long" >&5
+echo $ECHO_N "checking for long... $ECHO_C" >&6
+if test "${ac_cv_type_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$ac_ct_LD"; then
-  ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((long *) 0)
+  return 0;
+if (sizeof (long))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_long=yes
 else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_LD="ld"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_type_long=no
 fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-ac_ct_LD=$ac_cv_prog_ac_ct_LD
-if test -n "$ac_ct_LD"; then
-  echo "$as_me:$LINENO: result: $ac_ct_LD" >&5
-echo "${ECHO_T}$ac_ct_LD" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  LD=$ac_ct_LD
-else
-  LD="$ac_cv_prog_LD"
-fi
-
+echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
+echo "${ECHO_T}$ac_cv_type_long" >&6
 
-# This is not a "must".
-# Extract the first word of "ruby", so it can be a program name with args.
-set dummy ruby; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_RUBY+set}" = set; then
+echo "$as_me:$LINENO: checking size of long" >&5
+echo $ECHO_N "checking size of long... $ECHO_C" >&6
+if test "${ac_cv_sizeof_long+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $RUBY in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_RUBY="$RUBY" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_RUBY="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  ;;
-esac
-fi
-RUBY=$ac_cv_path_RUBY
-
-if test -n "$RUBY"; then
-  echo "$as_me:$LINENO: result: $RUBY" >&5
-echo "${ECHO_T}$RUBY" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-
-# For cross-compiling.
-if test "x$build" != "x$host"; then
-  for ac_prog in gcc egcs cc
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_BUILD_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$BUILD_CC"; then
-  ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_BUILD_CC="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-BUILD_CC=$ac_cv_prog_BUILD_CC
-if test -n "$BUILD_CC"; then
-  echo "$as_me:$LINENO: result: $BUILD_CC" >&5
-echo "${ECHO_T}$BUILD_CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$BUILD_CC" && break
-done
-test -n "$BUILD_CC" || BUILD_CC="{ { echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set BUILD_CC manually." >&5
-echo "$as_me: error: none of gcc, egcs and cc is found. set BUILD_CC manually." >&2;}
-   { (exit 1); exit 1; }; }"
-
-else
-  BUILD_CC="$CC"
-
-fi
-
-# Test the C compiler for the build environment.
-tmp_CC="$CC"
-tmp_CFLAGS="$CFLAGS"
-tmp_LDFLAGS="$LDFLAGS"
-tmp_CPPFLAGS="$CPPFLAGS"
-CC="$BUILD_CC"
-CFLAGS="$BUILD_CFLAGS"
-CPPFLAGS="$BUILD_CPPFLAGS"
-LDFLAGS="$BUILD_LDFLAGS"
-
-# Identify characteristics of the build architecture.
-echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
-echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
-if test "${ac_cv_c_bigendian+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  # See if sys/param.h defines the BYTE_ORDER macro.
+  if test "$ac_cv_type_long" = yes; then
+  # The cast to unsigned long works around a bug in the HP C Compiler
+  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+  # This bug is HP SR number 8606223364.
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/param.h>
-
+$ac_includes_default
 int
 main ()
 {
-#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
- bogus endian macros
-#endif
+static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
+test_array [0] = 0
 
   ;
   return 0;
@@ -4326,22 +4269,20 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  # It does; now see whether it defined to BIG_ENDIAN or not.
-cat >conftest.$ac_ext <<_ACEOF
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/param.h>
-
+$ac_includes_default
 int
 main ()
 {
-#if BYTE_ORDER != BIG_ENDIAN
- not big endian
-#endif
+static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
+test_array [0] = 0
 
   ;
   return 0;
@@ -4369,38 +4310,37 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_c_bigendian=yes
+  ac_hi=$ac_mid; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_c_bigendian=no
+ac_lo=`expr $ac_mid + 1`
+                   if test $ac_lo -le $ac_mid; then
+                     ac_lo= ac_hi=
+                     break
+                   fi
+                   ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-# It does not; compile a test program.
-if test "$cross_compiling" = yes; then
-  # try to guess the endianness by grepping values into an object file
-  ac_cv_c_bigendian=unknown
-  cat >conftest.$ac_ext <<_ACEOF
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
-short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
+$ac_includes_default
 int
 main ()
 {
- _ascii (); _ebcdic ();
+static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
+test_array [0] = 0
+
   ;
   return 0;
 }
@@ -4427,364 +4367,324 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
-  ac_cv_c_bigendian=yes
-fi
-if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
-  if test "$ac_cv_c_bigendian" = unknown; then
-    ac_cv_c_bigendian=no
-  else
-    # finding both strings is unlikely to happen, but who knows?
-    ac_cv_c_bigendian=unknown
-  fi
-fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+$ac_includes_default
 int
 main ()
 {
-  /* Are we little or big endian?  From Harbison&Steele.  */
-  union
-  {
-    long l;
-    char c[sizeof (long)];
-  } u;
-  u.l = 1;
-  exit (u.c[sizeof (long) - 1] == 1);
+static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_c_bigendian=no
+  ac_lo=$ac_mid; break
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-ac_cv_c_bigendian=yes
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+ac_hi=`expr '(' $ac_mid ')' - 1`
+                      if test $ac_mid -le $ac_hi; then
+                        ac_lo= ac_hi=
+                        break
+                      fi
+                      ac_mid=`expr 2 '*' $ac_mid`
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
-echo "${ECHO_T}$ac_cv_c_bigendian" >&6
-case $ac_cv_c_bigendian in
-  yes)
-
-cat >>confdefs.h <<\_ACEOF
-#define WORDS_BIGENDIAN 1
-_ACEOF
- ;;
-  no)
-     ;;
-  *)
-    { { echo "$as_me:$LINENO: error: unknown endianness
-presetting ac_cv_c_bigendian=no (or yes) will help" >&5
-echo "$as_me: error: unknown endianness
-presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
-  CPP=
+ac_lo= ac_hi=
 fi
-if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-      # Double quotes because CPP needs to be expanded
-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-                    Syntax error
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  :
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  # Broken: fails on valid input.
-continue
+ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
-rm -f conftest.err conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether non-existent headers
-  # can be detected and how.
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_long=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
+else
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <ac_nonexistent.h>
+$ac_includes_default
+long longval () { return (long) (sizeof (long)); }
+unsigned long ulongval () { return (long) (sizeof (long)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    exit (1);
+  if (((long) (sizeof (long))) < 0)
+    {
+      long i = longval ();
+      if (i != ((long) (sizeof (long))))
+       exit (1);
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long i = ulongval ();
+      if (i != ((long) (sizeof (long))))
+       exit (1);
+      fprintf (f, "%lu\n", i);
+    }
+  exit (ferror (f) || fclose (f) != 0);
+
+  ;
+  return 0;
+}
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  # Broken: success on invalid input.
-continue
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_long=`cat conftest.val`
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  # Passes both tests.
-ac_preproc_ok=:
-break
+( exit $ac_status )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
 fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  break
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+fi
+rm -f conftest.val
+else
+  ac_cv_sizeof_long=0
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long" >&6
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
 
-    done
-    ac_cv_prog_CPP=$CPP
 
+if test "x$host_m32" = x1; then
+  # Force 32-bit mode.
+  CFLAGS="$CFLAGS -m32"
+  LDFLAGS="$LDFLAGS -m32"
 fi
-  CPP=$ac_cv_prog_CPP
+
+# Check LZO when compiling for the i386-pc.
+if test "$target_cpu"-"$platform" = i386-pc; then
+  # There are three possibilities. LZO version 2 installed with the name
+  # liblzo2, with the name liblzo, and LZO version 1.
+  echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5
+echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6
+if test "${ac_cv_lib_lzo2___lzo_init_v2+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_prog_CPP=$CPP
-fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-llzo2  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
 #endif
-                    Syntax error
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char __lzo_init_v2 ();
+int
+main ()
+{
+__lzo_init_v2 ();
+  ;
+  return 0;
+}
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  :
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_lzo2___lzo_init_v2=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  # Broken: fails on valid input.
-continue
+ac_cv_lib_lzo2___lzo_init_v2=no
 fi
-rm -f conftest.err conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether non-existent headers
-  # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  # Broken: success on invalid input.
-continue
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
-else
-  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5
+echo "${ECHO_T}$ac_cv_lib_lzo2___lzo_init_v2" >&6
+if test $ac_cv_lib_lzo2___lzo_init_v2 = yes; then
+  LIBLZO="-llzo2"
 else
-  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
-    fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
-
-
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
-if test "${ac_cv_header_stdc+set}" = set; then
+  echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5
+echo $ECHO_N "checking for __lzo_init_v2 in -llzo... $ECHO_C" >&6
+if test "${ac_cv_lib_lzo___lzo_init_v2+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-llzo  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
 
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char __lzo_init_v2 ();
 int
 main ()
 {
-
+__lzo_init_v2 ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -4798,159 +4698,230 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_header_stdc=yes
+  ac_cv_lib_lzo___lzo_init_v2=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_stdc=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
+ac_cv_lib_lzo___lzo_init_v2=no
 fi
-rm -f conftest*
-
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then
-  :
+echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5
+echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init_v2" >&6
+if test $ac_cv_lib_lzo___lzo_init_v2 = yes; then
+  LIBLZO="-llzo"
 else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
-  :
+  echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5
+echo $ECHO_N "checking for __lzo_init2 in -llzo... $ECHO_C" >&6
+if test "${ac_cv_lib_lzo___lzo_init2+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-llzo  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <ctype.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-                  (('a' <= (c) && (c) <= 'i') \
-                    || ('j' <= (c) && (c) <= 'r') \
-                    || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
 
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char __lzo_init2 ();
 int
 main ()
 {
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-       || toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
+__lzo_init2 ();
+  ;
+  return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
+rm -f conftest.$ac_objext conftest$ac_exeext
 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  :
+  ac_cv_lib_lzo___lzo_init2=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ac_cv_lib_lzo___lzo_init2=no
 fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5
+echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init2" >&6
+if test $ac_cv_lib_lzo___lzo_init2 = yes; then
+  LIBLZO="-llzo"
+else
+  { { echo "$as_me:$LINENO: error: LZO library version 1.02 or later is required" >&5
+echo "$as_me: error: LZO library version 1.02 or later is required" >&2;}
+   { (exit 1); exit 1; }; }
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
-if test $ac_cv_header_stdc = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
+fi
 
 fi
 
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
 
+  LIBS="$LIBS $LIBLZO"
+  echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5
+echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6
+if test "${ac_cv_func_lzo1x_999_compress+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define lzo1x_999_compress to an innocuous variant, in case <limits.h> declares lzo1x_999_compress.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define lzo1x_999_compress innocuous_lzo1x_999_compress
 
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char lzo1x_999_compress (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef lzo1x_999_compress
 
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char lzo1x_999_compress ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_lzo1x_999_compress) || defined (__stub___lzo1x_999_compress)
+choke me
+#else
+char (*f) () = lzo1x_999_compress;
+#endif
+#ifdef __cplusplus
+}
+#endif
 
+int
+main ()
+{
+return f != lzo1x_999_compress;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_lzo1x_999_compress=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_func_lzo1x_999_compress=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5
+echo "${ECHO_T}$ac_cv_func_lzo1x_999_compress" >&6
+if test $ac_cv_func_lzo1x_999_compress = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: LZO1X-999 must be enabled" >&5
+echo "$as_me: error: LZO1X-999 must be enabled" >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
 
+  # LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h.
 
 
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-                 inttypes.h stdint.h unistd.h
+for ac_header in lzo/lzo1x.h lzo1x.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
@@ -4975,17 +4946,100 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_Header=yes"
+  ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_Header=no"
+ac_header_compiler=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------- ##
+## Report this to bug-grub@gnu.org ##
+## ------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
 echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
@@ -4995,33 +5049,41 @@ fi
 
 done
 
+fi
 
-echo "$as_me:$LINENO: checking for void *" >&5
-echo $ECHO_N "checking for void *... $ECHO_C" >&6
-if test "${ac_cv_type_void_p+set}" = set; then
+# Check for curses.
+echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5
+echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" >&6
+if test "${ac_cv_lib_ncurses_wgetch+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lncurses  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char wgetch ();
 int
 main ()
 {
-if ((void * *) 0)
-  return 0;
-if (sizeof (void *))
-  return 0;
+wgetch ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -5035,56 +5097,60 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_type_void_p=yes
+  ac_cv_lib_ncurses_wgetch=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_void_p=no
+ac_cv_lib_ncurses_wgetch=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5
-echo "${ECHO_T}$ac_cv_type_void_p" >&6
-
-echo "$as_me:$LINENO: checking size of void *" >&5
-echo $ECHO_N "checking size of void *... $ECHO_C" >&6
-if test "${ac_cv_sizeof_void_p+set}" = set; then
+echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5
+echo "${ECHO_T}$ac_cv_lib_ncurses_wgetch" >&6
+if test $ac_cv_lib_ncurses_wgetch = yes; then
+  LIBCURSES="-lncurses"
+else
+  echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5
+echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" >&6
+if test "${ac_cv_lib_curses_wgetch+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_void_p" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcurses  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char wgetch ();
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)];
-test_array [0] = 0
-
+wgetch ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -5098,30 +5164,60 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_lib_curses_wgetch=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_curses_wgetch=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5
+echo "${ECHO_T}$ac_cv_lib_curses_wgetch" >&6
+if test $ac_cv_lib_curses_wgetch = yes; then
+  LIBCURSES="-lcurses"
+fi
+
+fi
+
+
+
+# Check for headers.
+
+
+
+for ac_header in ncurses/curses.h ncurses.h curses.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -5145,491 +5241,726 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
+  ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr $ac_mid + 1`
-                   if test $ac_lo -le $ac_mid; then
-                     ac_lo= ac_hi=
-                     break
-                   fi
-                   ac_mid=`expr 2 '*' $ac_mid + 1`
+ac_header_compiler=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
 
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)];
-test_array [0] = 0
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-  ;
-  return 0;
-}
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------- ##
+## Report this to bug-grub@gnu.org ##
+## ------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
+
+fi
+
+done
+
+
+#
+# Check for target programs.
+#
+
+# For cross-compiling.
+if test "x$target" != "x$host"; then
+  # XXX this depends on the implementation of autoconf!
+  tmp_ac_tool_prefix="$ac_tool_prefix"
+  ac_tool_prefix=$target_alias-
+
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in gcc egcs cc
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_TARGET_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$TARGET_CC"; then
+  ac_cv_prog_TARGET_CC="$TARGET_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_TARGET_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+TARGET_CC=$ac_cv_prog_TARGET_CC
+if test -n "$TARGET_CC"; then
+  echo "$as_me:$LINENO: result: $TARGET_CC" >&5
+echo "${ECHO_T}$TARGET_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$TARGET_CC" && break
+  done
+fi
+if test -z "$TARGET_CC"; then
+  ac_ct_TARGET_CC=$TARGET_CC
+  for ac_prog in gcc egcs cc
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_TARGET_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_TARGET_CC"; then
+  ac_cv_prog_ac_ct_TARGET_CC="$ac_ct_TARGET_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_TARGET_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_TARGET_CC=$ac_cv_prog_ac_ct_TARGET_CC
+if test -n "$ac_ct_TARGET_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5
+echo "${ECHO_T}$ac_ct_TARGET_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_TARGET_CC" && break
+done
+test -n "$ac_ct_TARGET_CC" || ac_ct_TARGET_CC="{ { echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5
+echo "$as_me: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&2;}
+   { (exit 1); exit 1; }; }"
+
+  TARGET_CC=$ac_ct_TARGET_CC
+fi
+
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objcopy; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_OBJCOPY+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$OBJCOPY"; then
+  ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+OBJCOPY=$ac_cv_prog_OBJCOPY
+if test -n "$OBJCOPY"; then
+  echo "$as_me:$LINENO: result: $OBJCOPY" >&5
+echo "${ECHO_T}$OBJCOPY" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_OBJCOPY"; then
+  ac_ct_OBJCOPY=$OBJCOPY
+  # Extract the first word of "objcopy", so it can be a program name with args.
+set dummy objcopy; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_OBJCOPY"; then
+  ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OBJCOPY="objcopy"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY
+if test -n "$ac_ct_OBJCOPY"; then
+  echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5
+echo "${ECHO_T}$ac_ct_OBJCOPY" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  OBJCOPY=$ac_ct_OBJCOPY
+else
+  OBJCOPY="$ac_cv_prog_OBJCOPY"
+fi
+
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  STRIP=$ac_ct_STRIP
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nm; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_NM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$NM"; then
+  ac_cv_prog_NM="$NM" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_NM="${ac_tool_prefix}nm"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+NM=$ac_cv_prog_NM
+if test -n "$NM"; then
+  echo "$as_me:$LINENO: result: $NM" >&5
+echo "${ECHO_T}$NM" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_NM"; then
+  ac_ct_NM=$NM
+  # Extract the first word of "nm", so it can be a program name with args.
+set dummy nm; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_NM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_NM"; then
+  ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_NM="nm"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_NM=$ac_cv_prog_ac_ct_NM
+if test -n "$ac_ct_NM"; then
+  echo "$as_me:$LINENO: result: $ac_ct_NM" >&5
+echo "${ECHO_T}$ac_ct_NM" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  NM=$ac_ct_NM
+else
+  NM="$ac_cv_prog_NM"
+fi
+
+
+  ac_tool_prefix="$tmp_ac_tool_prefix"
+else
+  if test "x$TARGET_CC" = x; then
+    TARGET_CC=$CC
+  fi
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objcopy; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_OBJCOPY+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$OBJCOPY"; then
+  ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+OBJCOPY=$ac_cv_prog_OBJCOPY
+if test -n "$OBJCOPY"; then
+  echo "$as_me:$LINENO: result: $OBJCOPY" >&5
+echo "${ECHO_T}$OBJCOPY" >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-                      if test $ac_mid -le $ac_hi; then
-                        ac_lo= ac_hi=
-                        break
-                      fi
-                      ac_mid=`expr 2 '*' $ac_mid`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
+if test -z "$ac_cv_prog_OBJCOPY"; then
+  ac_ct_OBJCOPY=$OBJCOPY
+  # Extract the first word of "objcopy", so it can be a program name with args.
+set dummy objcopy; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  if test -n "$ac_ct_OBJCOPY"; then
+  ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OBJCOPY="objcopy"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 
-ac_lo= ac_hi=
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
+ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY
+if test -n "$ac_ct_OBJCOPY"; then
+  echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5
+echo "${ECHO_T}$ac_ct_OBJCOPY" >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+  OBJCOPY=$ac_ct_OBJCOPY
+else
+  OBJCOPY="$ac_cv_prog_OBJCOPY"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_void_p=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (void *), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
+
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-long longval () { return (long) (sizeof (void *)); }
-unsigned long ulongval () { return (long) (sizeof (void *)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (void *))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (void *))))
-       exit (1);
-      fprintf (f, "%ld\n", i);
-    }
-  else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (void *))))
-       exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_void_p=`cat conftest.val`
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
 
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (void *), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
 fi
 fi
-rm -f conftest.val
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
 else
-  ac_cv_sizeof_void_p=0
-fi
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5
-echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
-_ACEOF
 
+  STRIP=$ac_ct_STRIP
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
 
-echo "$as_me:$LINENO: checking for long" >&5
-echo $ECHO_N "checking for long... $ECHO_C" >&6
-if test "${ac_cv_type_long+set}" = set; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nm; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_NM+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-if ((long *) 0)
-  return 0;
-if (sizeof (long))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_long=yes
+  if test -n "$NM"; then
+  ac_cv_prog_NM="$NM" # Let the user override the test.
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_NM="${ac_tool_prefix}nm"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 
-ac_cv_type_long=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
-echo "${ECHO_T}$ac_cv_type_long" >&6
+NM=$ac_cv_prog_NM
+if test -n "$NM"; then
+  echo "$as_me:$LINENO: result: $NM" >&5
+echo "${ECHO_T}$NM" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
 
-echo "$as_me:$LINENO: checking size of long" >&5
-echo $ECHO_N "checking size of long... $ECHO_C" >&6
-if test "${ac_cv_sizeof_long+set}" = set; then
+fi
+if test -z "$ac_cv_prog_NM"; then
+  ac_ct_NM=$NM
+  # Extract the first word of "nm", so it can be a program name with args.
+set dummy nm; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_NM+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$ac_cv_type_long" = yes; then
-  # The cast to unsigned long works around a bug in the HP C Compiler
-  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-  # This bug is HP SR number 8606223364.
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=$ac_mid; break
+  if test -n "$ac_ct_NM"; then
+  ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test.
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_NM="nm"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 
-ac_lo=`expr $ac_mid + 1`
-                   if test $ac_lo -le $ac_mid; then
-                     ac_lo= ac_hi=
-                     break
-                   fi
-                   ac_mid=`expr 2 '*' $ac_mid + 1`
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
+fi
+ac_ct_NM=$ac_cv_prog_ac_ct_NM
+if test -n "$ac_ct_NM"; then
+  echo "$as_me:$LINENO: result: $ac_ct_NM" >&5
+echo "${ECHO_T}$ac_ct_NM" >&6
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
-test_array [0] = 0
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
+  NM=$ac_ct_NM
+else
+  NM="$ac_cv_prog_NM"
+fi
+
+fi
+
+
+
+# Test the C compiler for the target environment.
+tmp_CC="$CC"
+tmp_CFLAGS="$CFLAGS"
+tmp_LDFLAGS="$LDFLAGS"
+tmp_CPPFLAGS="$CPPFLAGS"
+CC="$TARGET_CC"
+CFLAGS="$TARGET_CFLAGS"
+CPPFLAGS="$TARGET_CPPFLAGS"
+LDFLAGS="$TARGET_LDFLAGS"
+
+if test "x$TARGET_CFLAGS" = x; then
+  # debug flags.
+  TARGET_CFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \
+                 -Wundef -Wstrict-prototypes -g"
+
+  # optimization flags.
+  echo "$as_me:$LINENO: checking whether optimization for size works" >&5
+echo $ECHO_N "checking whether optimization for size works... $ECHO_C" >&6
+if test "${size_flag+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+    CFLAGS=-Os
     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
-test_array [0] = 0
 
   ;
   return 0;
@@ -5657,44 +5988,43 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_lo=$ac_mid; break
+  size_flag=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_hi=`expr '(' $ac_mid ')' - 1`
-                      if test $ac_mid -le $ac_hi; then
-                        ac_lo= ac_hi=
-                        break
-                      fi
-                      ac_mid=`expr 2 '*' $ac_mid`
+size_flag=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo= ac_hi=
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
-  cat >conftest.$ac_ext <<_ACEOF
+echo "$as_me:$LINENO: result: $size_flag" >&5
+echo "${ECHO_T}$size_flag" >&6
+  if test "x$size_flag" = xyes; then
+    TARGET_CFLAGS="$TARGET_CFLAGS -Os"
+  else
+    TARGET_CFLAGS="$TARGET_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops"
+  fi
+
+  # Force no alignment to save space on i386.
+  if test "x$target_cpu" = xi386; then
+    echo "$as_me:$LINENO: checking whether -falign-loops works" >&5
+echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6
+if test "${falign_loop_flag+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+      CFLAGS="-falign-loops=1"
+      cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
-test_array [0] = 0
 
   ;
   return 0;
@@ -5722,138 +6052,176 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_hi=$ac_mid
+  falign_loop_flag=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_lo=`expr '(' $ac_mid ')' + 1`
+falign_loop_flag=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in
-?*) ac_cv_sizeof_long=$ac_lo;;
-'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long), 77
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; } ;;
-esac
-else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $falign_loop_flag" >&5
+echo "${ECHO_T}$falign_loop_flag" >&6
+
+    if test "x$falign_loop_flag" = xyes; then
+      TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
+    else
+      TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
+    fi
+  fi
+fi
+
+if test "x$target_m32" = x1; then
+  # Force 32-bit mode.
+  TARGET_CFLAGS="$TARGET_CFLAGS -m32"
+  TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
+fi
+
+
+
+
+
+# Defined in aclocal.m4.
+echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5
+echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6
+if test "${grub_cv_prog_objcopy_absolute+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-long longval () { return (long) (sizeof (long)); }
-unsigned long ulongval () { return (long) (sizeof (long)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
+  cat > conftest.c <<\EOF
+void
+cmain (void)
 {
+   *((int *) 0x1000) = 2;
+}
+EOF
 
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    exit (1);
-  if (((long) (sizeof (long))) < 0)
-    {
-      long i = longval ();
-      if (i != ((long) (sizeof (long))))
-       exit (1);
-      fprintf (f, "%ld\n", i);
-    }
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest.o; then :
+else
+  { { echo "$as_me:$LINENO: error: ${CC-cc} cannot compile C source code" >&5
+echo "$as_me: error: ${CC-cc} cannot compile C source code" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+grub_cv_prog_objcopy_absolute=yes
+for link_addr in 2000 8000 7C00; do
+  if { ac_try='${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then :
   else
-    {
-      unsigned long i = ulongval ();
-      if (i != ((long) (sizeof (long))))
-       exit (1);
-      fprintf (f, "%lu\n", i);
-    }
-  exit (ferror (f) || fclose (f) != 0);
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+    { { echo "$as_me:$LINENO: error: ${CC-cc} cannot link at address $link_addr" >&5
+echo "$as_me: error: ${CC-cc} cannot link at address $link_addr" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  if { ac_try='${OBJCOPY-objcopy} -O binary conftest.exec conftest'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  (exit $ac_status); }; }; then :
+  else
+    { { echo "$as_me:$LINENO: error: ${OBJCOPY-objcopy} cannot create binary files" >&5
+echo "$as_me: error: ${OBJCOPY-objcopy} cannot create binary files" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  if test ! -f conftest.old || { ac_try='cmp -s conftest.old conftest'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_long=`cat conftest.val`
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+    mv -f conftest conftest.old
+  else
+    grub_cv_prog_objcopy_absolute=no
+    break
+  fi
+done
+rm -f conftest*
+fi
 
-( exit $ac_status )
-{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (long), 77
-See \`config.log' for more details." >&2;}
+echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5
+echo "${ECHO_T}$grub_cv_prog_objcopy_absolute" >&6
+
+if test "x$grub_cv_prog_objcopy_absolute" = xno; then
+  { { echo "$as_me:$LINENO: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&5
+echo "$as_me: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&2;}
    { (exit 1); exit 1; }; }
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+
+
+echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5
+echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" >&6
+if test "${grub_cv_asm_uscore+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat > conftest.c <<\EOF
+int
+func (int *list)
+{
+  *list = 0;
+  return *list;
+}
+EOF
+
+if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } && test -s conftest.s; then
+  true
+else
+  { { echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5
+echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;}
+   { (exit 1); exit 1; }; }
 fi
-rm -f conftest.val
+
+if grep _func conftest.s >/dev/null 2>&1; then
+  grub_cv_asm_uscore=yes
 else
-  ac_cv_sizeof_long=0
+  grub_cv_asm_uscore=no
 fi
+
+rm -f conftest*
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
-echo "${ECHO_T}$ac_cv_sizeof_long" >&6
+
+
+if test "x$grub_cv_asm_uscore" = xyes; then
+
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG $ac_cv_sizeof_long
+#define HAVE_ASM_USCORE $grub_cv_asm_uscore
 _ACEOF
 
+fi
 
+echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5
+echo "${ECHO_T}$grub_cv_asm_uscore" >&6
 
-# Check LZO when compiling for the i386.
-if test "x$host_cpu" = xi386; then
-  # There are three possibilities. LZO version 2 installed with the name
-  # liblzo2, with the name liblzo, and LZO version 1.
-  echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5
-echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6
-if test "${ac_cv_lib_lzo2___lzo_init_v2+set}" = set; then
+if test "x$target_cpu" = xi386; then
+
+echo "$as_me:$LINENO: checking if start is defined by the compiler" >&5
+echo $ECHO_N "checking if start is defined by the compiler... $ECHO_C" >&6
+if test "${grub_cv_check_start_symbol+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-llzo2  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char __lzo_init_v2 ();
 int
 main ()
 {
-__lzo_init_v2 ();
+asm ("incl start")
   ;
   return 0;
 }
@@ -5880,47 +6248,37 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_lzo2___lzo_init_v2=yes
+  grub_cv_check_start_symbol=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_lzo2___lzo_init_v2=no
+grub_cv_check_start_symbol=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5
-echo "${ECHO_T}$ac_cv_lib_lzo2___lzo_init_v2" >&6
-if test $ac_cv_lib_lzo2___lzo_init_v2 = yes; then
-  LIBLZO="-llzo2"
-else
-  echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5
-echo $ECHO_N "checking for __lzo_init_v2 in -llzo... $ECHO_C" >&6
-if test "${ac_cv_lib_lzo___lzo_init_v2+set}" = set; then
+
+
+echo "$as_me:$LINENO: result: $grub_cv_check_start_symbol" >&5
+echo "${ECHO_T}$grub_cv_check_start_symbol" >&6
+
+echo "$as_me:$LINENO: checking if _start is defined by the compiler" >&5
+echo $ECHO_N "checking if _start is defined by the compiler... $ECHO_C" >&6
+if test "${grub_cv_check_uscore_start_symbol+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-llzo  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char __lzo_init_v2 ();
 int
 main ()
 {
-__lzo_init_v2 ();
+asm ("incl _start")
   ;
   return 0;
 }
@@ -5947,47 +6305,57 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_lzo___lzo_init_v2=yes
+  grub_cv_check_uscore_start_symbol=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_lzo___lzo_init_v2=no
+grub_cv_check_uscore_start_symbol=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5
-echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init_v2" >&6
-if test $ac_cv_lib_lzo___lzo_init_v2 = yes; then
-  LIBLZO="-llzo"
+
+
+echo "$as_me:$LINENO: result: $grub_cv_check_uscore_start_symbol" >&5
+echo "${ECHO_T}$grub_cv_check_uscore_start_symbol" >&6
+
+
+
+
+if test "x$grub_cv_check_start_symbol" = xyes; then
+  cat >>confdefs.h <<\_ACEOF
+#define START_SYMBOL start
+_ACEOF
+
+elif test "x$grub_cv_check_uscore_start_symbol" = xyes; then
+  cat >>confdefs.h <<\_ACEOF
+#define START_SYMBOL _start
+_ACEOF
+
 else
-  echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5
-echo $ECHO_N "checking for __lzo_init2 in -llzo... $ECHO_C" >&6
-if test "${ac_cv_lib_lzo___lzo_init2+set}" = set; then
+  { { echo "$as_me:$LINENO: error: neither start nor _start is defined" >&5
+echo "$as_me: error: neither start nor _start is defined" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5
+echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" >&6
+if test "${grub_cv_check_uscore_uscore_bss_start_symbol+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-llzo  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char __lzo_init2 ();
 int
 main ()
 {
-__lzo_init2 ();
+asm ("incl __bss_start")
   ;
   return 0;
 }
@@ -6014,36 +6382,24 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_lzo___lzo_init2=yes
+  grub_cv_check_uscore_uscore_bss_start_symbol=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_lzo___lzo_init2=no
+grub_cv_check_uscore_uscore_bss_start_symbol=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5
-echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init2" >&6
-if test $ac_cv_lib_lzo___lzo_init2 = yes; then
-  LIBLZO="-llzo"
-else
-  { { echo "$as_me:$LINENO: error: LZO library version 1.02 or later is required" >&5
-echo "$as_me: error: LZO library version 1.02 or later is required" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
 fi
 
-fi
 
+echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5
+echo "${ECHO_T}$grub_cv_check_uscore_uscore_bss_start_symbol" >&6
 
-  LIBS="$LIBS $LIBLZO"
-  echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5
-echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6
-if test "${ac_cv_func_lzo1x_999_compress+set}" = set; then
+echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5
+echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" >&6
+if test "${grub_cv_check_edata_symbol+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -6052,47 +6408,11 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define lzo1x_999_compress to an innocuous variant, in case <limits.h> declares lzo1x_999_compress.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define lzo1x_999_compress innocuous_lzo1x_999_compress
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char lzo1x_999_compress (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef lzo1x_999_compress
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char lzo1x_999_compress ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_lzo1x_999_compress) || defined (__stub___lzo1x_999_compress)
-choke me
-#else
-char (*f) () = lzo1x_999_compress;
-#endif
-#ifdef __cplusplus
-}
-#endif
 
 int
 main ()
 {
-return f != lzo1x_999_compress;
+asm ("incl edata")
   ;
   return 0;
 }
@@ -6119,57 +6439,44 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_func_lzo1x_999_compress=yes
+  grub_cv_check_edata_symbol=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_lzo1x_999_compress=no
+grub_cv_check_edata_symbol=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5
-echo "${ECHO_T}$ac_cv_func_lzo1x_999_compress" >&6
-if test $ac_cv_func_lzo1x_999_compress = yes; then
-  :
-else
-  { { echo "$as_me:$LINENO: error: LZO1X-999 must be enabled" >&5
-echo "$as_me: error: LZO1X-999 must be enabled" >&2;}
-   { (exit 1); exit 1; }; }
-fi
 
 
-  # LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h.
-
+echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5
+echo "${ECHO_T}$grub_cv_check_edata_symbol" >&6
 
-for ac_header in lzo/lzo1x.h lzo1x.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5
+echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" >&6
+if test "${grub_cv_check_uscore_edata_symbol+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
+
+int
+main ()
+{
+asm ("incl _edata")
+  ;
+  return 0;
+}
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -6183,143 +6490,68 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
+  (exit $ac_status); }; }; then
+  grub_cv_check_uscore_edata_symbol=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
+grub_cv_check_uscore_edata_symbol=no
 fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to bug-grub@gnu.org ##
-## ------------------------------- ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+
+echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5
+echo "${ECHO_T}$grub_cv_check_uscore_edata_symbol" >&6
+
+
+
+
+if test "x$grub_cv_check_uscore_uscore_bss_start_symbol" = xyes; then
+  cat >>confdefs.h <<\_ACEOF
+#define BSS_START_SYMBOL __bss_start
 _ACEOF
 
-fi
+elif test "x$grub_cv_check_edata_symbol" = xyes; then
+  cat >>confdefs.h <<\_ACEOF
+#define BSS_START_SYMBOL edata
+_ACEOF
 
-done
+elif test "x$grub_cv_check_uscore_edata_symbol" = xyes; then
+  cat >>confdefs.h <<\_ACEOF
+#define BSS_START_SYMBOL _edata
+_ACEOF
 
+else
+  { { echo "$as_me:$LINENO: error: none of __bss_start, edata or _edata is defined" >&5
+echo "$as_me: error: none of __bss_start, edata or _edata is defined" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
-# Check for curses.
-echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5
-echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" >&6
-if test "${ac_cv_lib_ncurses_wgetch+set}" = set; then
+
+echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5
+echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" >&6
+if test "${grub_cv_check_end_symbol+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lncurses  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char wgetch ();
 int
 main ()
 {
-wgetch ();
+asm ("incl end")
   ;
   return 0;
 }
@@ -6346,47 +6578,37 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_ncurses_wgetch=yes
+  grub_cv_check_end_symbol=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_ncurses_wgetch=no
+grub_cv_check_end_symbol=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5
-echo "${ECHO_T}$ac_cv_lib_ncurses_wgetch" >&6
-if test $ac_cv_lib_ncurses_wgetch = yes; then
-  LIBCURSES="-lncurses"
-else
-  echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5
-echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" >&6
-if test "${ac_cv_lib_curses_wgetch+set}" = set; then
+
+
+echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5
+echo "${ECHO_T}$grub_cv_check_end_symbol" >&6
+
+echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5
+echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" >&6
+if test "${grub_cv_check_uscore_end_symbol+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcurses  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char wgetch ();
 int
 main ()
 {
-wgetch ();
+asm ("incl _end")
   ;
   return 0;
 }
@@ -6412,182 +6634,257 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_curses_wgetch=yes
+  (exit $ac_status); }; }; then
+  grub_cv_check_uscore_end_symbol=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+grub_cv_check_uscore_end_symbol=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5
+echo "${ECHO_T}$grub_cv_check_uscore_end_symbol" >&6
+
+
+
+
+if test "x$grub_cv_check_end_symbol" = xyes; then
+  cat >>confdefs.h <<\_ACEOF
+#define END_SYMBOL end
+_ACEOF
+
+elif test "x$grub_cv_check_uscore_end_symbol" = xyes; then
+  cat >>confdefs.h <<\_ACEOF
+#define END_SYMBOL _end
+_ACEOF
+
+else
+  { { echo "$as_me:$LINENO: error: neither end nor _end is defined" >&5
+echo "$as_me: error: neither end nor _end is defined" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5
+echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" >&6
+if test "${grub_cv_i386_asm_prefix_requirement+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat > conftest.s <<\EOF
+       .code16
+l1:    addr32  movb    %al, l1
+EOF
+
+if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } && test -s conftest.o; then
+  grub_cv_i386_asm_prefix_requirement=yes
+else
+  grub_cv_i386_asm_prefix_requirement=no
+fi
+
+rm -f conftest*
+fi
+
+
+if test "x$grub_cv_i386_asm_prefix_requirement" = xyes; then
+  grub_tmp_addr32="addr32"
+  grub_tmp_data32="data32"
+else
+  grub_tmp_addr32="addr32;"
+  grub_tmp_data32="data32;"
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define ADDR32 $grub_tmp_addr32
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define DATA32 $grub_tmp_data32
+_ACEOF
+
+
+echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5
+echo "${ECHO_T}$grub_cv_i386_asm_prefix_requirement" >&6
+
+
+echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5
+echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" >&6
+if test "${grub_cv_i386_asm_addr32+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat > conftest.s.in <<\EOF
+       .code16
+l1:    @ADDR32@        movb    %al, l1
+EOF
+
+if test "x$grub_cv_i386_asm_prefix_requirement" = xyes; then
+  sed -e s/@ADDR32@/addr32/ < conftest.s.in > conftest.s
+else
+  sed -e s/@ADDR32@/addr32\;/ < conftest.s.in > conftest.s
+fi
+
+if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } && test -s conftest.o; then
+  grub_cv_i386_asm_addr32=yes
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_curses_wgetch=no
+  grub_cv_i386_asm_addr32=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+
+rm -f conftest*
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5
-echo "${ECHO_T}$ac_cv_lib_curses_wgetch" >&6
-if test $ac_cv_lib_curses_wgetch = yes; then
-  LIBCURSES="-lcurses"
+
+
+echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5
+echo "${ECHO_T}$grub_cv_i386_asm_addr32" >&6
+
+echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5
+echo $ECHO_N "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... $ECHO_C" >&6
+if test "${grub_cv_i386_asm_absolute_without_asterisk+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat > conftest.s <<\EOF
+       lcall   *(offset)
+offset:
+       .long   0
+       .word   0
+EOF
+
+if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } && test -s conftest.o; then
+  grub_cv_i386_asm_absolute_without_asterisk=no
+else
+  grub_cv_i386_asm_absolute_without_asterisk=yes
 fi
 
+rm -f conftest*
 fi
 
 
+if test "x$grub_cv_i386_asm_absolute_without_asterisk" = xyes; then
 
-# Check for headers.
+cat >>confdefs.h <<\_ACEOF
+#define ABSOLUTE_WITHOUT_ASTERISK 1
+_ACEOF
 
+fi
 
+echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5
+echo "${ECHO_T}$grub_cv_i386_asm_absolute_without_asterisk" >&6
 
-for ac_header in ncurses/curses.h ncurses.h curses.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5
+echo $ECHO_N "checking if GCC has the regparm=3 bug... $ECHO_C" >&6
+if test "${grub_cv_i386_check_nested_functions+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
+
+static int
+test (int *n)
+{
+  return *n == -1;
+}
+
+static int
+testfunc (int __attribute__ ((__regparm__ (3))) (*hook) (int a, int b, int *c))
+{
+  int a = 0;
+  int b = 0;
+  int c = -1;
+  return hook (a, b, &c);
+}
+
+int
+main (void)
+{
+  int __attribute__ ((__regparm__ (3))) nestedfunc (int a, int b, int *c)
+    {
+      return a == b && test (c);
+    }
+  return testfunc (nestedfunc) ? 0 : 1;
+}
+
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_header_compiler=yes
+  grub_cv_i386_check_nested_functions=no
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+( exit $ac_status )
+grub_cv_i386_check_nested_functions=yes
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
 
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
+
+echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5
+echo "${ECHO_T}$grub_cv_i386_check_nested_functions" >&6
+
+if test "x$grub_cv_i386_check_nested_functions" = xyes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (2)))
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
+
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
+cat >>confdefs.h <<\_ACEOF
+#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (2)))
+_ACEOF
+
 fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------- ##
-## Report this to bug-grub@gnu.org ##
-## ------------------------------- ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+cat >>confdefs.h <<\_ACEOF
+#define NESTED_FUNC_ATTR
 _ACEOF
 
 fi
 
-done
-
-
 # Restore the flags.
 CC="$tmp_CC"
 CFLAGS="$tmp_CFLAGS"
@@ -6606,7 +6903,7 @@ _ACEOF
 fi;
 
 # Output files.
-                    ac_config_links="$ac_config_links include/grub/cpu:include/grub/$host_cpu include/grub/machine:include/grub/$host_cpu/$platform"
+                    ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform"
 
                               ac_config_files="$ac_config_files Makefile gensymlist.sh genkernsyms.sh"
 
@@ -7144,8 +7441,8 @@ do
   "gensymlist.sh" ) CONFIG_FILES="$CONFIG_FILES gensymlist.sh" ;;
   "genkernsyms.sh" ) CONFIG_FILES="$CONFIG_FILES genkernsyms.sh" ;;
   "stamp-h" ) CONFIG_FILES="$CONFIG_FILES stamp-h" ;;
-  "include/grub/cpu" ) CONFIG_LINKS="$CONFIG_LINKS include/grub/cpu:include/grub/$host_cpu" ;;
-  "include/grub/machine" ) CONFIG_LINKS="$CONFIG_LINKS include/grub/machine:include/grub/$host_cpu/$platform" ;;
+  "include/grub/cpu" ) CONFIG_LINKS="$CONFIG_LINKS include/grub/cpu:include/grub/$target_cpu" ;;
+  "include/grub/machine" ) CONFIG_LINKS="$CONFIG_LINKS include/grub/machine:include/grub/$target_cpu/$platform" ;;
   "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
@@ -7240,7 +7537,18 @@ s,@host@,$host,;t t
 s,@host_cpu@,$host_cpu,;t t
 s,@host_vendor@,$host_vendor,;t t
 s,@host_os@,$host_os,;t t
+s,@target@,$target,;t t
+s,@target_cpu@,$target_cpu,;t t
+s,@target_vendor@,$target_vendor,;t t
+s,@target_os@,$target_os,;t t
 s,@platform@,$platform,;t t
+s,@YACC@,$YACC,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@AWK@,$AWK,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@RUBY@,$RUBY,;t t
 s,@CC@,$CC,;t t
 s,@CFLAGS@,$CFLAGS,;t t
 s,@LDFLAGS@,$LDFLAGS,;t t
@@ -7248,25 +7556,21 @@ s,@CPPFLAGS@,$CPPFLAGS,;t t
 s,@ac_ct_CC@,$ac_ct_CC,;t t
 s,@EXEEXT@,$EXEEXT,;t t
 s,@OBJEXT@,$OBJEXT,;t t
-s,@YACC@,$YACC,;t t
-s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s,@INSTALL_DATA@,$INSTALL_DATA,;t t
-s,@SET_MAKE@,$SET_MAKE,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@LIBLZO@,$LIBLZO,;t t
+s,@LIBCURSES@,$LIBCURSES,;t t
+s,@TARGET_CC@,$TARGET_CC,;t t
+s,@ac_ct_TARGET_CC@,$ac_ct_TARGET_CC,;t t
 s,@OBJCOPY@,$OBJCOPY,;t t
 s,@ac_ct_OBJCOPY@,$ac_ct_OBJCOPY,;t t
 s,@STRIP@,$STRIP,;t t
 s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
 s,@NM@,$NM,;t t
 s,@ac_ct_NM@,$ac_ct_NM,;t t
-s,@LD@,$LD,;t t
-s,@ac_ct_LD@,$ac_ct_LD,;t t
-s,@RUBY@,$RUBY,;t t
-s,@BUILD_CC@,$BUILD_CC,;t t
-s,@CPP@,$CPP,;t t
-s,@EGREP@,$EGREP,;t t
-s,@LIBLZO@,$LIBLZO,;t t
-s,@LIBCURSES@,$LIBCURSES,;t t
+s,@TARGET_CFLAGS@,$TARGET_CFLAGS,;t t
+s,@TARGET_CPPFLAGS@,$TARGET_CPPFLAGS,;t t
+s,@TARGET_LDFLAGS@,$TARGET_LDFLAGS,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF
index 6982931c0ce3d888aa43d685b7696d892df4085b..959ec01712367e9b0a12b14c798392b94ce1b095 100644 (file)
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
+dnl This configure script is complicated, because GRUB needs to deal
+dnl with three potentially different types:
+dnl
+dnl   build  -- the environment for building GRUB
+dnl   host   -- the environment for running utilities
+dnl   target -- the environment for running GRUB
+dnl
+dnl In addition, GRUB needs to deal with a platform specification
+dnl which specifies the system running GRUB, such as firmware.
+dnl This is necessary because the target type in autoconf does not
+dnl describe such a system very well.
+dnl
+dnl The current strategy is to use variables with no prefix (such as
+dnl CC, CFLAGS, etc.) for the host type as well as the build type,
+dnl because GRUB does not need to use those variables for the build
+dnl type, so there is no conflict. Variables with the prefix "TARGET_"
+dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target
+dnl type.
+
+
 AC_INIT(GRUB, 1.93, [bug-grub@gnu.org])
 AC_PREREQ(2.53)
 AC_CONFIG_SRCDIR([include/grub/dl.h])
 AC_CONFIG_HEADER([config.h])
 
-# Checks for build and host systems.
-AC_CANONICAL_BUILD
+# Checks for host and target systems.
 AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
 
 case "$host_cpu" in
-  i[[3456]]86) host_cpu=i386 ;;
-  x86_64) host_cpu=i386 biarch32=1 ;;
+  x86_64) host_m32=1 ;;
+  powerpc64) host_m32=1 ;;
+esac
+
+case "$target_cpu" in
+  i[[3456]]86) target_cpu=i386 ;;
+  x86_64) target_cpu=i386 target_m32=1 ;;
   powerpc) ;;
-  powerpc64) host_cpu=powerpc biarch32=1;;
+  powerpc64) target_cpu=powerpc target_m32=1;;
   sparc64) ;;
   *) AC_MSG_ERROR([unsupported CPU type]) ;;
 esac
@@ -36,7 +61,7 @@ AC_ARG_WITH([platform],
 
 # Guess the platform if not specified.
 if test "x$with_platform" = x; then
-  case "$host_cpu"-"$host_vendor" in
+  case "$target_cpu"-"$target_vendor" in
     i386-apple) platform=efi ;;
     i386-*) platform=pc ;;
     powerpc-*) platform=ieee1275 ;;
@@ -48,7 +73,7 @@ else
 fi
 
 # Sanity check.
-case "$host_cpu"-"$platform" in
+case "$target_cpu"-"$platform" in
   i386-efi) ;;
   i386-pc) ;;
   powerpc-ieee1275) ;;
@@ -56,30 +81,113 @@ case "$host_cpu"-"$platform" in
   *) AC_MSG_ERROR([unsupported machine type]) ;;
 esac
 
-AC_SUBST(host_cpu)
+AC_SUBST(target_cpu)
 AC_SUBST(platform)
 
-# Checks for programs.
-if test "x$CFLAGS" = x; then
-  default_CFLAGS=yes
-fi
-
-AC_PROG_CC
+#
+# Checks for build programs.
+#
 
 AC_CHECK_PROGS([YACC], [bison])
 if test "x$YACC" = x; then
   AC_MSG_ERROR([Could not find bison.])
 fi
 
-AC_SYS_LARGEFILE
+AC_PROG_INSTALL
+AC_PROG_AWK
+AC_PROG_MAKE_SET
+
+# This is not a "must".
+AC_PATH_PROG(RUBY, ruby)
 
+#
+# Checks for host programs.
+#
+
+AC_PROG_CC
 # Must be GCC.
 test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
 
-if test "x$default_CFLAGS" = xyes; then
+AC_SYS_LARGEFILE
+
+# Identify characteristics of the host architecture.
+AC_C_BIGENDIAN
+AC_CHECK_SIZEOF(void *)
+AC_CHECK_SIZEOF(long)
+
+if test "x$host_m32" = x1; then
+  # Force 32-bit mode.
+  CFLAGS="$CFLAGS -m32"
+  LDFLAGS="$LDFLAGS -m32"
+fi
+
+# Check LZO when compiling for the i386-pc.
+if test "$target_cpu"-"$platform" = i386-pc; then
+  # There are three possibilities. LZO version 2 installed with the name
+  # liblzo2, with the name liblzo, and LZO version 1.
+  AC_CHECK_LIB(lzo2, __lzo_init_v2, [LIBLZO="-llzo2"],
+    AC_CHECK_LIB(lzo, __lzo_init_v2, [LIBLZO="-llzo"],
+      AC_CHECK_LIB(lzo, __lzo_init2, [LIBLZO="-llzo"],
+              AC_MSG_ERROR([LZO library version 1.02 or later is required]))))
+  AC_SUBST(LIBLZO)
+  LIBS="$LIBS $LIBLZO"
+  AC_CHECK_FUNC(lzo1x_999_compress, , 
+               [AC_MSG_ERROR([LZO1X-999 must be enabled])])
+
+  # LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h.
+  AC_CHECK_HEADERS(lzo/lzo1x.h lzo1x.h)
+fi
+
+# Check for curses.
+AC_CHECK_LIB(ncurses, wgetch, [LIBCURSES="-lncurses"],
+  [AC_CHECK_LIB(curses, wgetch, [LIBCURSES="-lcurses"])])
+AC_SUBST(LIBCURSES)
+
+# Check for headers.
+AC_CHECK_HEADERS(ncurses/curses.h ncurses.h curses.h)
+
+#
+# Check for target programs.
+#
+
+# For cross-compiling.
+if test "x$target" != "x$host"; then
+  # XXX this depends on the implementation of autoconf!
+  tmp_ac_tool_prefix="$ac_tool_prefix"
+  ac_tool_prefix=$target_alias-
+
+  AC_CHECK_TOOLS(TARGET_CC, [gcc egcs cc],
+                 [AC_MSG_ERROR([none of gcc, egcs and cc is found. set TARGET_CC manually.])])
+  AC_CHECK_TOOL(OBJCOPY, objcopy)
+  AC_CHECK_TOOL(STRIP, strip)
+  AC_CHECK_TOOL(NM, nm)
+
+  ac_tool_prefix="$tmp_ac_tool_prefix"
+else
+  if test "x$TARGET_CC" = x; then
+    TARGET_CC=$CC
+  fi
+  AC_CHECK_TOOL(OBJCOPY, objcopy)
+  AC_CHECK_TOOL(STRIP, strip)
+  AC_CHECK_TOOL(NM, nm)
+fi
+AC_SUBST(TARGET_CC)
+
+
+# Test the C compiler for the target environment.
+tmp_CC="$CC"
+tmp_CFLAGS="$CFLAGS"
+tmp_LDFLAGS="$LDFLAGS"
+tmp_CPPFLAGS="$CPPFLAGS"
+CC="$TARGET_CC"
+CFLAGS="$TARGET_CFLAGS"
+CPPFLAGS="$TARGET_CPPFLAGS"
+LDFLAGS="$TARGET_LDFLAGS"
+
+if test "x$TARGET_CFLAGS" = x; then
   # debug flags.
-  tmp_CFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \
-               -Wundef -Wstrict-prototypes -g"
+  TARGET_CFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \
+                 -Wundef -Wstrict-prototypes -g"
 
   # optimization flags.
   AC_CACHE_CHECK([whether optimization for size works], size_flag, [
@@ -87,44 +195,43 @@ if test "x$default_CFLAGS" = xyes; then
     AC_TRY_COMPILE(, , size_flag=yes, size_flag=no)
   ])
   if test "x$size_flag" = xyes; then
-    tmp_CFLAGS="$tmp_CFLAGS -Os"
+    TARGET_CFLAGS="$TARGET_CFLAGS -Os"
   else
-    tmp_CFLAGS="$tmp_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops"
+    TARGET_CFLAGS="$TARGET_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops"
   fi
 
   # Force no alignment to save space on i386.
-  if test "x$host_cpu" = xi386; then
+  if test "x$target_cpu" = xi386; then
     AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [
       CFLAGS="-falign-loops=1"
       AC_TRY_COMPILE(, , [falign_loop_flag=yes], [falign_loop_flag=no])
     ])
 
     if test "x$falign_loop_flag" = xyes; then
-      tmp_CFLAGS="$tmp_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
+      TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
     else
-      tmp_CFLAGS="$tmp_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
+      TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
     fi
   fi
+fi
 
-  if test "x$biarch32" = x1; then
-    tmp_CFLAGS="$tmp_CFLAGS -m32"
-    LDFLAGS="$LDFLAGS -m32"
-    AC_SUBST(LDFLAGS)
-  fi
-
-  CFLAGS="$tmp_CFLAGS"
+if test "x$target_m32" = x1; then
+  # Force 32-bit mode.
+  TARGET_CFLAGS="$TARGET_CFLAGS -m32"
+  TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
 fi
-AC_SUBST(CFLAGS)
+
+AC_SUBST(TARGET_CFLAGS)
+AC_SUBST(TARGET_CPPFLAGS)
+AC_SUBST(TARGET_LDFLAGS)
 
 # Defined in aclocal.m4.
+grub_PROG_OBJCOPY_ABSOLUTE
 grub_ASM_USCORE
-if test "x$host_cpu" = xi386; then
+if test "x$target_cpu" = xi386; then
   grub_CHECK_START_SYMBOL
   grub_CHECK_BSS_START_SYMBOL
   grub_CHECK_END_SYMBOL
-fi
-
-if test "x$host_cpu" = xi386; then
   grub_I386_ASM_PREFIX_REQUIREMENT
   grub_I386_ASM_ADDR32
   grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK
@@ -133,66 +240,6 @@ else
   AC_DEFINE([NESTED_FUNC_ATTR], [], [Catch gcc bug])
 fi
 
-AC_PROG_INSTALL
-AC_PROG_MAKE_SET
-AC_CHECK_TOOL(OBJCOPY, objcopy)
-grub_PROG_OBJCOPY_ABSOLUTE
-AC_CHECK_TOOL(STRIP, strip)
-AC_CHECK_TOOL(NM, nm)
-AC_CHECK_TOOL(LD, ld)
-
-# This is not a "must".
-AC_PATH_PROG(RUBY, ruby)
-
-# For cross-compiling.
-if test "x$build" != "x$host"; then
-  AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc],
-                [AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])])
-else
-  BUILD_CC="$CC"
-  AC_SUBST(BUILD_CC)
-fi
-
-# Test the C compiler for the build environment.
-tmp_CC="$CC"
-tmp_CFLAGS="$CFLAGS"
-tmp_LDFLAGS="$LDFLAGS"
-tmp_CPPFLAGS="$CPPFLAGS"
-CC="$BUILD_CC"
-CFLAGS="$BUILD_CFLAGS"
-CPPFLAGS="$BUILD_CPPFLAGS"
-LDFLAGS="$BUILD_LDFLAGS"
-
-# Identify characteristics of the build architecture.
-AC_C_BIGENDIAN
-AC_CHECK_SIZEOF(void *)
-AC_CHECK_SIZEOF(long)
-
-# Check LZO when compiling for the i386.
-if test "x$host_cpu" = xi386; then
-  # There are three possibilities. LZO version 2 installed with the name
-  # liblzo2, with the name liblzo, and LZO version 1.
-  AC_CHECK_LIB(lzo2, __lzo_init_v2, [LIBLZO="-llzo2"],
-    AC_CHECK_LIB(lzo, __lzo_init_v2, [LIBLZO="-llzo"],
-      AC_CHECK_LIB(lzo, __lzo_init2, [LIBLZO="-llzo"],
-              AC_MSG_ERROR([LZO library version 1.02 or later is required]))))
-  AC_SUBST(LIBLZO)
-  LIBS="$LIBS $LIBLZO"
-  AC_CHECK_FUNC(lzo1x_999_compress, , 
-               [AC_MSG_ERROR([LZO1X-999 must be enabled])])
-
-  # LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h.
-  AC_CHECK_HEADERS(lzo/lzo1x.h lzo1x.h)
-fi
-
-# Check for curses.
-AC_CHECK_LIB(ncurses, wgetch, [LIBCURSES="-lncurses"],
-  [AC_CHECK_LIB(curses, wgetch, [LIBCURSES="-lcurses"])])
-AC_SUBST(LIBCURSES)
-
-# Check for headers.
-AC_CHECK_HEADERS(ncurses/curses.h ncurses.h curses.h)
-
 # Restore the flags.
 CC="$tmp_CC"
 CFLAGS="$tmp_CFLAGS"
@@ -207,8 +254,8 @@ AC_ARG_ENABLE([mm-debug],
                          [Define to 1 if you enable memory manager debugging.])])
 
 # Output files.
-AC_CONFIG_LINKS([include/grub/cpu:include/grub/$host_cpu
-       include/grub/machine:include/grub/$host_cpu/$platform])
+AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu
+       include/grub/machine:include/grub/$target_cpu/$platform])
 AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh])
 AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
 AC_OUTPUT
index 7c08b3f4679a4aa605359d86efbc58e227f38362..6d72860ab8d1a3f8d598affa7a31f8f144067af2 100644 (file)
--- a/genmk.rb
+++ b/genmk.rb
@@ -1,6 +1,6 @@
 #! /usr/bin/ruby -w
 #
-# Copyright (C) 2002,2003,2004,2005  Free Software Foundation, Inc.
+# Copyright (C) 2002,2003,2004,2005,2006  Free Software Foundation, Inc.
 #
 # This genmk.rb is free software; the author
 # gives unlimited permission to copy and/or distribute it,
@@ -60,22 +60,22 @@ MOSTLYCLEANFILES += #{deps_str}
        $(OBJCOPY) -O binary -R .note -R .comment $< $@
 
 #{exe}: #{objs_str}
-       $(CC) -o $@ $^ $(LDFLAGS) $(#{prefix}_LDFLAGS)
+       $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(#{prefix}_LDFLAGS)
 
 " + objs.collect_with_index do |obj, i|
       src = sources[i]
       fake_obj = File.basename(src).suffix('o')
       dep = deps[i]
-      flag = if /\.c$/ =~ src then 'CFLAGS' else 'ASFLAGS' end
+      flag = if /\.c$/ =~ src then 'TARGET_CFLAGS' else 'TARGET_ASFLAGS' end
       extra_flags = if /\.S$/ =~ src then '-DASM_FILE=1' else '' end
       dir = File.dirname(src)
       
       "#{obj}: #{src}
-       $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) #{extra_flags} $(#{flag}) $(#{prefix}_#{flag}) -c -o $@ $<
+       $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(#{flag}) $(#{prefix}_#{flag}) -c -o $@ $<
 
 #{dep}: #{src}
        set -e; \
-         $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) #{extra_flags} $(#{flag}) $(#{prefix}_#{flag}) -M $< \
+         $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(#{flag}) $(#{prefix}_#{flag}) -M $< \
          | sed 's,#{Regexp.quote(fake_obj)}[ :]*,#{obj} $@ : ,g' > $@; \
          [ -s $@ ] || rm -f $@
 
@@ -121,15 +121,15 @@ UNDSYMFILES += #{undsym}
 
 #{@name}: #{pre_obj} #{mod_obj}
        -rm -f $@
-       $(CC) $(#{prefix}_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
        $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@
 
 #{pre_obj}: #{objs_str}
        -rm -f $@
-       $(CC) $(#{prefix}_LDFLAGS) $(LDFLAGS) -Wl,-r,-d -o $@ $^
+       $(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
 
 #{mod_obj}: #{mod_src}
-       $(CC) $(CPPFLAGS) $(CFLAGS) $(#{prefix}_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(#{prefix}_CFLAGS) -c -o $@ $<
 
 #{mod_src}: moddep.lst genmodsrc.sh
        sh $(srcdir)/genmodsrc.sh '#{mod_name}' $< > $@ || (rm -f $@; exit 1)
@@ -149,15 +149,15 @@ endif
       command = 'cmd-' + obj.suffix('lst')
       fs = 'fs-' + obj.suffix('lst')
       dep = deps[i]
-      flag = if /\.c$/ =~ src then 'CFLAGS' else 'ASFLAGS' end
+      flag = if /\.c$/ =~ src then 'TARGET_CFLAGS' else 'TARGET_ASFLAGS' end
       dir = File.dirname(src)
 
       "#{obj}: #{src}
-       $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(#{flag}) $(#{prefix}_#{flag}) -c -o $@ $<
+       $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(#{flag}) $(#{prefix}_#{flag}) -c -o $@ $<
 
 #{dep}: #{src}
        set -e; \
-         $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(#{flag}) $(#{prefix}_#{flag}) -M $< \
+         $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(#{flag}) $(#{prefix}_#{flag}) -M $< \
          | sed 's,#{Regexp.quote(fake_obj)}[ :]*,#{obj} $@ : ,g' > $@; \
          [ -s $@ ] || rm -f $@
 
@@ -169,12 +169,12 @@ FSFILES += #{fs}
 
 #{command}: #{src} gencmdlist.sh
        set -e; \
-         $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(#{flag}) $(#{prefix}_#{flag}) -E $< \
+         $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(#{flag}) $(#{prefix}_#{flag}) -E $< \
          | sh $(srcdir)/gencmdlist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1)
 
 #{fs}: #{src} genfslist.sh
        set -e; \
-         $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(#{flag}) $(#{prefix}_#{flag}) -E $< \
+         $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(#{flag}) $(#{prefix}_#{flag}) -E $< \
          | sh $(srcdir)/genfslist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1)
 
 
@@ -204,7 +204,7 @@ class Utility
 MOSTLYCLEANFILES += #{deps_str}
 
 #{@name}: #{objs_str}
-       $(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(#{prefix}_LDFLAGS)
+       $(CC) -o $@ $^ $(LDFLAGS) $(#{prefix}_LDFLAGS)
 
 " + objs.collect_with_index do |obj, i|
       src = sources[i]
@@ -213,11 +213,11 @@ MOSTLYCLEANFILES += #{deps_str}
       dir = File.dirname(src)
 
       "#{obj}: #{src}
-       $(BUILD_CC) -I#{dir} -I$(srcdir)/#{dir} $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(#{prefix}_CFLAGS) -c -o $@ $<
+       $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(#{prefix}_CFLAGS) -c -o $@ $<
 
 #{dep}: #{src}
        set -e; \
-         $(BUILD_CC) -I#{dir} -I$(srcdir)/#{dir} $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DGRUB_UTIL=1 $(#{prefix}_CFLAGS) -M $< \
+         $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(#{prefix}_CFLAGS) -M $< \
          | sed 's,#{Regexp.quote(fake_obj)}[ :]*,#{obj} $@ : ,g' > $@; \
          [ -s $@ ] || rm -f $@
 
@@ -249,7 +249,7 @@ class Program
 MOSTLYCLEANFILES += #{deps_str}
 
 #{@name}: #{objs_str}
-       $(CC) -o $@ $^ $(LDFLAGS) $(#{prefix}_LDFLAGS)
+       $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(#{prefix}_LDFLAGS)
 
 " + objs.collect_with_index do |obj, i|
       src = sources[i]
@@ -258,11 +258,11 @@ MOSTLYCLEANFILES += #{deps_str}
       dir = File.dirname(src)
 
       "#{obj}: #{src}
-       $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(CFLAGS) $(#{prefix}_CFLAGS) -c -o $@ $<
+       $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(#{prefix}_CFLAGS) -c -o $@ $<
 
 #{dep}: #{src}
        set -e; \
-         $(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(CFLAGS) $(#{prefix}_CFLAGS) -M $< \
+         $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(#{prefix}_CFLAGS) -M $< \
          | sed 's,#{Regexp.quote(fake_obj)}[ :]*,#{obj} $@ : ,g' > $@; \
          [ -s $@ ] || rm -f $@
 
diff --git a/genmoddep.awk b/genmoddep.awk
new file mode 100644 (file)
index 0000000..c079b36
--- /dev/null
@@ -0,0 +1,62 @@
+#! /usr/bin/awk -f
+#
+# Copyright (C) 2006  Free Software Foundation, Inc.
+#
+# This genmoddep.awk is free software; the author
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# Read defined symbols from stdin.
+BEGIN {
+  while (getline <"/dev/stdin") {
+    symtab[$1] = $2
+  }
+}
+
+# The first line contains a module name.
+FNR == 1 {
+  module = $1
+  next
+};
+
+# The rest is undefined symbols.
+{
+  if ($1 in symtab) {
+    modtab[module] = modtab[module] " " symtab[$1];
+  }
+  else {
+    printf "%s in %s is not defined\n", $1, module >"/dev/stderr";
+    error++;
+    exit;
+  }
+}
+
+# Output the result.
+END {
+  if (error == 1)
+    exit 1;
+  
+  for (mod in modtab) {
+    # Remove duplications.
+    split(modtab[mod], depmods, " ");
+    for (depmod in uniqmods) {
+      delete uniqmods[depmod];
+    }
+    for (i in depmods) {
+      depmod = depmods[i];
+      # Ignore kernel, as always loaded.
+      if (depmod != "kernel")
+       uniqmods[depmod] = 1;
+    }
+    modlist = ""
+    for (depmod in uniqmods) {
+      modlist = modlist " " depmod;
+    }
+    printf "%s:%s\n", mod, modlist;
+  }
+}
index 2190a844132b90424d1c660c045f2b9df69e5937..5c4c79255af7a9510e24a45fe700f5d1f1678cad 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2002  Free Software Foundation, Inc.
+ *  Copyright (C) 2002,2006  Free Software Foundation, Inc.
  *
  *  GRUB is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
 #define GRUB_TYPES_CPU_HEADER  1
 
 /* The size of void *.  */
-#define GRUB_HOST_SIZEOF_VOID_P        4
+#define GRUB_TARGET_SIZEOF_VOID_P      4
 
 /* The size of long.  */
-#define GRUB_HOST_SIZEOF_LONG  4
+#define GRUB_TARGET_SIZEOF_LONG                4
 
 /* i386 is little-endian.  */
-#undef GRUB_HOST_WORDS_BIGENDIAN
+#undef GRUB_TARGET_WORDS_BIGENDIAN
 
 #endif /* ! GRUB_TYPES_CPU_HEADER */
index 9f1a3d1a53dc256d22a0e779cb8ef53bf7f4ef1f..cf912538d86bc38b83768a364ea542bce31f37b7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2002, 2004  Free Software Foundation, Inc.
+ *  Copyright (C) 2002,2004,2006  Free Software Foundation, Inc.
  *
  *  GRUB is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
 #define GRUB_TYPES_CPU_HEADER  1
 
 /* The size of void *.  */
-#define GRUB_HOST_SIZEOF_VOID_P        4
+#define GRUB_TARGET_SIZEOF_VOID_P      4
 
 /* The size of long.  */
-#define GRUB_HOST_SIZEOF_LONG  4
+#define GRUB_TARGET_SIZEOF_LONG                4
 
 /* powerpc is big-endian.  */
-#define GRUB_HOST_WORDS_BIGENDIAN      1
+#define GRUB_TARGET_WORDS_BIGENDIAN    1
 
 
 #endif /* ! GRUB_TYPES_CPU_HEADER */
index 56237da978ee645daf443bef0bd5809841c40f08..a37a0bacb495aa7cb0e9002079180280ad5ac93b 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2002, 2004  Free Software Foundation, Inc.
+ *  Copyright (C) 2002,2004,2006  Free Software Foundation, Inc.
  *
  *  GRUB is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
 #define GRUB_TYPES_CPU_HEADER  1
 
 /* The size of void *.  */
-#define GRUB_HOST_SIZEOF_VOID_P        8
+#define GRUB_TARGET_SIZEOF_VOID_P      8
 
 /* The size of long.  */
-#define GRUB_HOST_SIZEOF_LONG  8
+#define GRUB_TARGET_SIZEOF_LONG                8
 
 /* sparc64 is big-endian.  */
-#define GRUB_HOST_WORDS_BIGENDIAN      1
+#define GRUB_TARGET_WORDS_BIGENDIAN    1
 
 
 #endif /* ! GRUB_TYPES_CPU_HEADER */
index 08d58d6f6191d1be187b3b5ed87a088cc08f0694..cb07f2aa8ea29c1eff9ba3e5d0844e2ba5360362 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2002, 2005  Free Software Foundation, Inc.
+ *  Copyright (C) 2002,2005,2006  Free Software Foundation, Inc.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -32,9 +32,9 @@
 #  undef GRUB_CPU_WORDS_BIGENDIAN
 # endif
 #else /* ! GRUB_UTIL */
-# define GRUB_CPU_SIZEOF_VOID_P        GRUB_HOST_SIZEOF_VOID_P
-# define GRUB_CPU_SIZEOF_LONG  GRUB_HOST_SIZEOF_LONG
-# ifdef GRUB_HOST_WORDS_BIGENDIAN
+# define GRUB_CPU_SIZEOF_VOID_P        GRUB_TARGET_SIZEOF_VOID_P
+# define GRUB_CPU_SIZEOF_LONG  GRUB_TARGET_SIZEOF_LONG
+# ifdef GRUB_TARGET_WORDS_BIGENDIAN
 #  define GRUB_CPU_WORDS_BIGENDIAN     1
 # else
 #  undef GRUB_CPU_WORDS_BIGENDIAN
@@ -69,7 +69,7 @@ typedef unsigned long long    grub_uint64_t;
 #endif
 
 /* Misc types.  */
-#if GRUB_HOST_SIZEOF_VOID_P == 8
+#if SIZEOF_VOID_P == 8
 typedef grub_uint64_t  grub_host_addr_t;
 typedef grub_uint64_t  grub_host_off_t;
 typedef grub_uint64_t  grub_host_size_t;
index 3035214a2428b7a486f92c2e8ccf4d027ddcbaf0..c696695db1fed5ebbe2dc042dba4c4e4c94d3c5f 100644 (file)
--- a/kern/dl.c
+++ b/kern/dl.c
@@ -30,7 +30,7 @@
 #include <grub/env.h>
 #include <grub/cache.h>
 
-#if GRUB_HOST_SIZEOF_VOID_P == 4
+#if GRUB_CPU_SIZEOF_VOID_P == 4
 
 typedef Elf32_Word Elf_Word;
 typedef Elf32_Addr Elf_Addr;
@@ -41,7 +41,7 @@ typedef Elf32_Sym Elf_Sym;
 # define ELF_ST_BIND(val)      ELF32_ST_BIND (val)
 # define ELF_ST_TYPE(val)      ELF32_ST_TYPE (val)
 
-#elif GRUB_HOST_SIZEOF_VOID_P == 8
+#elif GRUB_CPU_SIZEOF_VOID_P == 8
 
 typedef Elf64_Word Elf_Word;
 typedef Elf64_Addr Elf_Addr;
index 2715efef489214060902b66b20fbd8e8639b4aa0..a98f06f666d2fd1b87f382c24c50e8ca7cd72844 100644 (file)
@@ -61,7 +61,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address,
   grub_efi_status_t status;
   grub_efi_boot_services_t *b;
 
-#if GRUB_HOST_SIZEOF_VOID_P < 8
+#if GRUB_CPU_SIZEOF_VOID_P < 8
   /* Limit the memory access to less than 4GB for 32-bit platforms.  */
   if (address > 0xffffffff)
     return 0;
@@ -220,7 +220,7 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map,
        desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size))
     {
       if (desc->type == GRUB_EFI_CONVENTIONAL_MEMORY
-#if GRUB_HOST_SIZEOF_VOID_P < 8
+#if GRUB_CPU_SIZEOF_VOID_P < 8
          && desc->physical_start <= 0xffffffff
 #endif
          && desc->physical_start + PAGES_TO_BYTES (desc->num_pages) > 0x100000
@@ -236,7 +236,7 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map,
              desc->physical_start = 0x100000;
            }
          
-#if GRUB_HOST_SIZEOF_VOID_P < 8
+#if GRUB_CPU_SIZEOF_VOID_P < 8
          if (BYTES_TO_PAGES (filtered_desc->physical_start)
              + filtered_desc->num_pages
              > BYTES_TO_PAGES (0x100000000LL))
diff --git a/util/genmoddep.c b/util/genmoddep.c
deleted file mode 100644 (file)
index 9edd063..0000000
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2002  Free Software Foundation, Inc.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-#define BUF_SIZE       1024
-#define SYMTAB_SIZE    509
-
-struct symbol
-{
-  const char *name;
-  const char *mod;
-  struct symbol *next;
-};
-
-struct module
-{
-  const char *name;
-  struct module *next;
-};
-
-static char buf[BUF_SIZE];
-static struct symbol *symtab[SYMTAB_SIZE];
-
-static void
-err (const char *fmt, ...)
-{
-  va_list ap;
-
-  fprintf (stderr, "genmoddep: error: ");
-  
-  va_start (ap, fmt);
-  vfprintf (stderr, fmt, ap);
-  va_end (ap);
-
-  fputc ('\n', stderr);
-  exit (1);
-}
-
-static void *
-xmalloc (size_t size)
-{
-  void *p;
-
-  p = malloc (size);
-  if (! p)
-    err ("out of memory");
-
-  return p;
-}
-
-static char *
-xstrdup (const char *str)
-{
-  char *s;
-  size_t len;
-
-  len = strlen (str);
-  s = (char *) xmalloc (len + 1);
-  memcpy (s, str, len + 1);
-
-  return s;
-}
-
-static void
-chomp (char *str)
-{
-  int end;
-  
-  end = strlen (str) - 1;
-  if (end < 0)
-    err ("empty string");
-
-  if (str[end] == '\n')
-    str[end] = '\0';
-}
-
-static unsigned
-symbol_hash (const char *s)
-{
-  unsigned key = 0;
-
-  while (*s)
-    key = key * 65599 + *s++;
-
-  return (key + (key >> 5)) % SYMTAB_SIZE;
-}
-
-static struct symbol *
-get_symbol (const char *name)
-{
-  unsigned k;
-  struct symbol *sym;
-  
-  k = symbol_hash (name);
-  for (sym = symtab[k]; sym; sym = sym->next)
-    if (strcmp (sym->name, name) == 0)
-      return sym;
-
-  return 0;
-}
-
-static void
-add_symbol (const char *name, const char *mod)
-{
-  unsigned k;
-  struct symbol *sym;
-
-  if (get_symbol (name))
-    err ("duplicated symbol: %s", name);
-  
-  sym = (struct symbol *) xmalloc (sizeof (*sym));
-  sym->name = xstrdup (name);
-  sym->mod = xstrdup (mod);
-
-  k = symbol_hash (name);
-  sym->next = symtab[k];
-  symtab[k] = sym;
-}
-
-static void
-free_symbols (void)
-{
-  int i;
-
-  for (i = 0; i < SYMTAB_SIZE; i++)
-    {
-      struct symbol *p, *q;
-
-      p = symtab[i];
-      while (p)
-       {
-         q = p->next;
-         free ((void *) p->name);
-         free ((void *) p->mod);
-         free (p);
-         p = q;
-       }
-    }
-}
-
-static void
-read_defined_symbols (FILE *fp)
-{
-  while (fgets (buf, sizeof (buf), fp))
-    {
-      char *p;
-
-      if (! *buf)
-       err ("empty symbol name: %s", buf);
-      
-      p = strchr (buf, ' ');
-      if (! p)
-       err ("invalid line format: %s", buf);
-
-      p++;
-      
-      if (! *p)
-       err ("empty module name: %s", buf);
-
-      *(p - 1) = '\0';
-      chomp (p);
-      
-      add_symbol (buf, p);
-    }
-}
-
-static void
-add_module (struct module **head, const char *name)
-{
-  struct module *mod;
-
-  for (mod = *head; mod; mod = mod->next)
-    if (strcmp (mod->name, name) == 0)
-      return;
-
-  mod = (struct module *) xmalloc (sizeof (*mod));
-  mod->name = xstrdup (name);
-
-  mod->next = *head;
-  *head = mod;
-}
-
-static void
-free_modules (struct module *head)
-{
-  struct module *next;
-
-  while (head)
-    {
-      next = head->next;
-      free ((void *) head->name);
-      free (head);
-      head = next;
-    }
-}
-
-static void
-find_dependencies (FILE *fp)
-{
-  char *mod_name;
-  struct module *mod_list = 0;
-  struct module *mod;
-  
-  if (! fgets (buf, sizeof (buf), fp) || buf[0] == '\n' || buf[0] == '\0')
-    err ("no module name");
-
-  chomp (buf);
-  mod_name = xstrdup (buf);
-
-  while (fgets (buf, sizeof (buf), fp))
-    {
-      struct symbol *sym;
-      
-      chomp (buf);
-      sym = get_symbol (buf);
-      if (! sym)
-       err ("%s in %s is not defined", buf, mod_name);
-
-      add_module (&mod_list, sym->mod);
-    }
-
-  printf ("%s:", mod_name);
-  
-  for (mod = mod_list; mod; mod = mod->next)
-    if (strcmp (mod->name, "kernel") != 0)
-      printf (" %s", mod->name);
-  
-  putchar ('\n');
-
-  free_modules (mod_list);
-}
-
-int
-main (int argc, char *argv[])
-{
-  int i;
-  
-  /* First, get defined symbols.  */
-  read_defined_symbols (stdin);
-
-  /* Second, find the dependecies.  */
-  for (i = 1; i < argc; i++)
-    {
-      FILE *fp;
-
-      fp = fopen (argv[i], "r");
-      if (! fp)
-       err ("cannot open %s", argv[i]);
-
-      find_dependencies (fp);
-
-      fclose (fp);
-    }
-
-  /* Last, free memory.  */
-  free_symbols ();
-  
-  return 0;
-}
index 0e0bb55e71db1b4f67f2830484cee2e6962439ab..418ec7fedd5e0c0232901429bfd5737ef64a285e 100644 (file)
@@ -26,9 +26,9 @@ libdir=@libdir@
 PACKAGE_NAME=@PACKAGE_NAME@
 PACKAGE_TARNAME=@PACKAGE_TARNAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
-host_cpu=@host_cpu@
+target_cpu=@target_cpu@
 platform=@platform@
-pkglibdir=${libdir}/${PACKAGE_TARNAME}/${host_cpu}-${platform}
+pkglibdir=${libdir}/${PACKAGE_TARNAME}/${target_cpu}-${platform}
 
 grub_setup=${sbindir}/grub-setup
 grub_mkimage=${bindir}/grub-mkimage
index 81ddb62637966c263511713d696d1d4c1450ca40..7c7da02996d37477dff255622f458cd878af17f7 100644 (file)
@@ -28,11 +28,11 @@ libdir=@libdir@
 PACKAGE_NAME=@PACKAGE_NAME@
 PACKAGE_TARNAME=@PACKAGE_TARNAME@
 PACKAGE_VERSION=@PACKAGE_VERSION@
-host_cpu=@host_cpu@
+target_cpu=@target_cpu@
 platform=@platform@
-pkglibdir=${libdir}/${PACKAGE_TARNAME}/${host_cpu}-${platform}
+pkglibdir=${libdir}/${PACKAGE_TARNAME}/${target_cpu}-${platform}
 
-grub_mkimage=${sbindir}/grub-mkimage
+grub_mkimage=${bindir}/grub-mkimage
 rootdir=
 grub_prefix=/boot/grub
 modules=