[PATCH] Let GCC generate deps with -MD.

2006-08-12 Thread Johan Rydberg
Hi,

Instead of generating the dependencies separately it can be done the
first time a file is compiled, with the -MD option to GCC.  

Comments?

2006-08-12  Johan Rydberg  <[EMAIL PROTECTED]>

* genmk.rb: Let GCC generate dependenceies the first time it
compiles a file; using the -MD option.

Index: genmk.rb
===
RCS file: /sources/grub/grub2/genmk.rb,v
retrieving revision 1.25
diff -u -r1.25 genmk.rb
--- genmk.rb	2 Jun 2006 19:33:58 -	1.25
+++ genmk.rb	12 Aug 2006 15:47:35 -
@@ -71,14 +71,7 @@
   dir = File.dirname(src)
   
   "#{obj}: #{src}
-	$(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -c -o $@ $<
-
-#{dep}: #{src}
-	set -e; \
-	  $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -M $< \
-	  | sed 's,#{Regexp.quote(fake_obj)}[ :]*,#{obj} $@ : ,g' > $@; \
-	  [ -s $@ ] || rm -f $@
-
+	$(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -MD -c -o $@ $<
 -include #{dep}
 
 "
@@ -153,14 +146,7 @@
   dir = File.dirname(src)
 
   "#{obj}: #{src}
-	$(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -c -o $@ $<
-
-#{dep}: #{src}
-	set -e; \
-	  $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -M $< \
-	  | sed 's,#{Regexp.quote(fake_obj)}[ :]*,#{obj} $@ : ,g' > $@; \
-	  [ -s $@ ] || rm -f $@
-
+	$(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -MD -c -o $@ $<
 -include #{dep}
 
 CLEANFILES += #{command} #{fs}
@@ -213,14 +199,7 @@
   dir = File.dirname(src)
 
   "#{obj}: #{src}
-	$(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(#{prefix}_CFLAGS) -c -o $@ $<
-
-#{dep}: #{src}
-	set -e; \
-	  $(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 $@
-
+	$(CC) -I#{dir} -I$(srcdir)/#{dir} $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(#{prefix}_CFLAGS) -MD -c -o $@ $<
 -include #{dep}
 
 "
@@ -258,14 +237,7 @@
   dir = File.dirname(src)
 
   "#{obj}: #{src}
-	$(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(#{prefix}_CFLAGS) -c -o $@ $<
-
-#{dep}: #{src}
-	set -e; \
-	  $(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 $@
-
+	$(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(#{prefix}_CFLAGS) -MD -c -o $@ $<
 -include #{dep}
 
 "
___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: EFI disk probing problem

2006-08-12 Thread Johan Rydberg
"Yoshinori K. Okuji" <[EMAIL PROTECTED]> writes:

> I don't remember precisely, but I think I only added disk devices but not 
> partition devices. On your system, don't disk devices as well as partition 
> devices get enumerated?

I'm not 100% sure about this, but I think EFI does not have to add a
disk device node if there is only a single logical partition on the
disk.

~j



___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel


Re: [PATCH] Let GCC generate deps with -MD.

2006-08-12 Thread Hollis Blanchard
On Sat, 2006-08-12 at 18:07 +0200, Johan Rydberg wrote:
> 
> Instead of generating the dependencies separately it can be done the
> first time a file is compiled, with the -MD option to GCC.  

Just curious... does this solve the problem that occurs when you delete
a .c file?

-Hollis



___
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel