[2353] 2009-06-21 Robert Millan <[email protected]>

Robert Millan <[email protected]> Sun, 21 Jun 2009 17:24:30 +0000
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2353
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2353
Author:   robertmh
Date:     2009-06-21 17:24:30 +0000 (Sun, 21 Jun 2009)
Log Message:
-----------
2009-06-21  Robert Millan  <[email protected]>

        Fix asm file handling on ELF, and remove workarounds.

        * genmk.rb (class Programs): Detect assembly files, and set ASFLAGS
        and -DASM_FILE=1 appropiately (copied from `class Images' stanza).
        * kern/i386/ieee1275/startup.S (ASM_FILE): Remove macro.
        * kern/i386/coreboot/startup.S (ASM_FILE): Likewise.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/genmk.rb
    trunk/grub2/kern/i386/coreboot/startup.S
    trunk/grub2/kern/i386/ieee1275/startup.S

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-06-21 15:48:10 UTC (rev 2352)
+++ trunk/grub2/ChangeLog	2009-06-21 17:24:30 UTC (rev 2353)
@@ -1,3 +1,12 @@
+2009-06-21  Robert Millan  <[email protected]>
+
+	Fix asm file handling on ELF, and remove workarounds.
+
+	* genmk.rb (class Programs): Detect assembly files, and set ASFLAGS
+	and -DASM_FILE=1 appropiately (copied from `class Images' stanza).
+	* kern/i386/ieee1275/startup.S (ASM_FILE): Remove macro.
+	* kern/i386/coreboot/startup.S (ASM_FILE): Likewise.
+
 2009-06-21  Vladimir Serbinenko  <[email protected]>
 
 	Load BSD ELF modules

Modified: trunk/grub2/genmk.rb
===================================================================
--- trunk/grub2/genmk.rb	2009-06-21 15:48:10 UTC (rev 2352)
+++ trunk/grub2/genmk.rb	2009-06-21 17:24:30 UTC (rev 2353)
@@ -280,10 +280,12 @@
       src = sources[i]
       fake_obj = File.basename(src).suffix('o')
       dep = deps[i]
+      flag = if /\.c$/ =~ src then 'CFLAGS' else 'ASFLAGS' end
+      extra_flags = if /\.S$/ =~ src then '-DASM_FILE=1' else '' end
       dir = File.dirname(src)
 
       "#{obj}: #{src} $(#{src}_DEPENDENCIES)
-	$(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(#{prefix}_CFLAGS) -MD -c -o $@ $<
+	$(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -MD -c -o $@ $<
 -include #{dep}
 
 "

Modified: trunk/grub2/kern/i386/coreboot/startup.S
===================================================================
--- trunk/grub2/kern/i386/coreboot/startup.S	2009-06-21 15:48:10 UTC (rev 2352)
+++ trunk/grub2/kern/i386/coreboot/startup.S	2009-06-21 17:24:30 UTC (rev 2353)
@@ -16,8 +16,6 @@
  *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#define ASM_FILE	1
-
 #include <grub/symbol.h>
 #include <grub/machine/memory.h>
 #include <grub/cpu/linux.h>

Modified: trunk/grub2/kern/i386/ieee1275/startup.S
===================================================================
--- trunk/grub2/kern/i386/ieee1275/startup.S	2009-06-21 15:48:10 UTC (rev 2352)
+++ trunk/grub2/kern/i386/ieee1275/startup.S	2009-06-21 17:24:30 UTC (rev 2353)
@@ -16,8 +16,6 @@
  *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#define ASM_FILE	1
-
 #include <grub/symbol.h>
 #include <grub/machine/memory.h>
 #include <grub/cpu/linux.h>