From 15355c7d2f740c3ebe9ba9127b694d6a3ec2328e Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 21 Jun 2009 17:24:30 +0000 Subject: [PATCH] 2009-06-21 Robert Millan 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. --- ChangeLog | 9 +++++++++ genmk.rb | 4 +++- kern/i386/coreboot/startup.S | 2 -- kern/i386/ieee1275/startup.S | 2 -- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c9bfe50f5..0a580763e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-06-21 Robert Millan + + 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 Load BSD ELF modules diff --git a/genmk.rb b/genmk.rb index 36f40201c..e3866c150 100644 --- a/genmk.rb +++ b/genmk.rb @@ -280,10 +280,12 @@ MOSTLYCLEANFILES += #{deps_str} 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} " diff --git a/kern/i386/coreboot/startup.S b/kern/i386/coreboot/startup.S index b14171e6f..fc53a8542 100644 --- a/kern/i386/coreboot/startup.S +++ b/kern/i386/coreboot/startup.S @@ -16,8 +16,6 @@ * along with GRUB. If not, see . */ -#define ASM_FILE 1 - #include #include #include diff --git a/kern/i386/ieee1275/startup.S b/kern/i386/ieee1275/startup.S index 3b030b1b4..dfbfab594 100644 --- a/kern/i386/ieee1275/startup.S +++ b/kern/i386/ieee1275/startup.S @@ -16,8 +16,6 @@ * along with GRUB. If not, see . */ -#define ASM_FILE 1 - #include #include #include