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.
This commit is contained in:
parent
f09771a102
commit
b977bf01b3
25 changed files with 3718 additions and 3578 deletions
38
genmk.rb
38
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 $@
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue