summaryrefslogtreecommitdiffstats
path: root/arch/mips/Makefile
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-10-27 00:13:34 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-10-27 00:13:34 +0000
commite9c015f2d9d7008d0f67ac360866b2b8cf3d4567 (patch)
tree906a3fb667428660a80d9ce644113155f433ddf0 /arch/mips/Makefile
parentd21d609525a9a18f08ccc8bfda5cf8cf2366a070 (diff)
Make the default ld.script a generated file to keep maintenance
reasonably easy.
Diffstat (limited to 'arch/mips/Makefile')
-rw-r--r--arch/mips/Makefile13
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 92c6d81f7..b707452dc 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -17,8 +17,10 @@
#
ifdef CONFIG_CPU_LITTLE_ENDIAN
tool-prefix = mipsel-linux-
+output-format = elf32-littlemips
else
tool-prefix = mips-linux-
+output-format = elf32-bigmips
endif
ifdef CONFIG_CROSSCOMPILE
@@ -194,11 +196,11 @@ endif
# none has been choosen above.
#
ifndef LINKSCRIPT
-ifndef CONFIG_CPU_LITTLE_ENDIAN
-LINKSCRIPT = arch/mips/ld.script.big
-else
-LINKSCRIPT = arch/mips/ld.script.little
-endif
+vmlinux: arch/$(ARCH)/ld.script
+
+arch/$(ARCH)/ld.script: arch/$(ARCH)/ld.script.in
+ sed 's/@@OUTPUT_FORMAT@@/$(output-format)/' <$< >$@
+LINKSCRIPT = arch/mips/ld.script
endif
LINKFLAGS += -T $(word 1,$(LINKSCRIPT))
@@ -240,6 +242,7 @@ zdisk: vmlinux
archclean:
@$(MAKEBOOT) clean
+ rm -f arch/$(ARCH)/ld.script
$(MAKE) -C arch/$(ARCH)/kernel clean
$(MAKE) -C arch/$(ARCH)/tools clean
$(MAKE) -C arch/mips/baget clean