From: "Mikael Starvik" <mikael.starvik@axis.com>
To: <linux-kernel@vger.kernel.org>
Cc: <akpm@linux-foundation.org>
Subject: [PATCH 2.6.20 1/14] CRIS architecture update - Build system
Date: Sun, 22 Apr 2007 21:24:34 +0200 [thread overview]
Message-ID: <BFECAF9E178F144FAEF2BF4CE739C66803BEEE17@exmail1.se.axis.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 158 bytes --]
The attached patch improves the CRIS build system by allowing out-of-tree objdir everywhere
Signed-off-by: Mikael Starvik <starvik@axis.com>
/Mikael
[-- Attachment #2: cris1_make.patch --]
[-- Type: application/octet-stream, Size: 6143 bytes --]
diff -urNP --exclude='*.cvsignore' ../linux/arch/cris/arch-v10/boot/compressed/Makefile linux-2.6/arch/cris/arch-v10/boot/compressed/Makefile
--- ../linux/arch/cris/arch-v10/boot/compressed/Makefile 2007-02-04 19:44:54.000000000 +0100
+++ linux-2.6/arch/cris/arch-v10/boot/compressed/Makefile 2006-10-11 17:47:04.000000000 +0200
@@ -1,45 +1,34 @@
#
-# create a compressed vmlinuz image from the binary vmlinux.bin file
+# arch/cris/arch-v10/boot/compressed/Makefile
#
-target = $(target_compressed_dir)
-src = $(src_compressed_dir)
CC = gcc-cris -melf $(LINUXINCLUDE)
CFLAGS = -O2
LD = ld-cris
+LDFLAGS = -T $(obj)/decompress.ld
+OBJECTS = $(obj)/head.o $(obj)/misc.o
OBJCOPY = objcopy-cris
OBJCOPYFLAGS = -O binary --remove-section=.bss
-OBJECTS = $(target)/head.o $(target)/misc.o
-# files to compress
-SYSTEM = $(objtree)/vmlinux.bin
+quiet_cmd_image = BUILD $@
+cmd_image = cat $(obj)/decompress.bin $(obj)/piggy.gz > $@
-all: $(target_compressed_dir)/vmlinuz
+targets := vmlinux piggy.gz decompress.o decompress.bin
-$(target)/decompress.bin: $(OBJECTS)
- $(LD) -T $(src)/decompress.ld -o $(target)/decompress.o $(OBJECTS)
- $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/decompress.o $(target)/decompress.bin
+$(obj)/decompress.o: $(OBJECTS) FORCE
+ $(call if_changed,ld)
-# Create vmlinuz image in top-level build directory
-$(target_compressed_dir)/vmlinuz: $(target) piggy.img $(target)/decompress.bin
- @echo " COMPR vmlinux.bin --> vmlinuz"
- @cat $(target)/decompress.bin piggy.img > $(target_compressed_dir)/vmlinuz
- @rm -f piggy.img
+$(obj)/decompress.bin: $(obj)/decompress.o FORCE
+ $(call if_changed,objcopy)
-$(target)/head.o: $(src)/head.S
- $(CC) -D__ASSEMBLY__ -traditional -c $< -o $@
+$(obj)/head.o: $(obj)/head.S .config
+ @$(CC) -D__ASSEMBLY__ -traditional -c $< -o $@
-$(target)/misc.o: $(src)/misc.c
- $(CC) -D__KERNEL__ -c $< -o $@
+$(obj)/misc.o: $(obj)/misc.c .config
+ @$(CC) -D__KERNEL__ -c $< -o $@
-# gzip the kernel image
-
-piggy.img: $(SYSTEM)
- @cat $(SYSTEM) | gzip -f -9 > piggy.img
-
-$(target):
- mkdir -p $(target)
-
-clean:
- rm -f piggy.img $(objtree)/vmlinuz
+$(obj)/vmlinux: $(obj)/piggy.gz $(obj)/decompress.bin FORCE
+ $(call if_changed,image)
+$(obj)/piggy.gz: $(obj)/../Image FORCE
+ $(call if_changed,gzip)
diff -urNP --exclude='*.cvsignore' ../linux/arch/cris/arch-v10/boot/Makefile linux-2.6/arch/cris/arch-v10/boot/Makefile
--- ../linux/arch/cris/arch-v10/boot/Makefile 2007-02-04 19:44:54.000000000 +0100
+++ linux-2.6/arch/cris/arch-v10/boot/Makefile 2006-11-29 17:05:40.000000000 +0100
@@ -1,13 +1,21 @@
#
-# arch/cris/boot/Makefile
+# arch/cris/arch-v10/boot/Makefile
#
-target = $(target_boot_dir)
-src = $(src_boot_dir)
-zImage: compressed/vmlinuz
+OBJCOPY = objcopy-cris
+OBJCOPYFLAGS = -O binary --remove-section=.bss
-compressed/vmlinuz:
- @$(MAKE) -f $(src)/compressed/Makefile $(target_compressed_dir)/vmlinuz
+subdir- := compressed rescue
+targets := Image
-clean:
- @$(MAKE) -f $(src)/compressed/Makefile clean
+$(obj)/Image: vmlinux FORCE
+ $(call if_changed,objcopy)
+ @echo ' Kernel: $@ is ready'
+
+$(obj)/compressed/vmlinux: $(obj)/Image FORCE
+ $(Q)$(MAKE) $(build)=$(obj)/compressed $@
+ $(Q)$(MAKE) $(build)=$(obj)/rescue $(obj)/rescue/rescue.bin
+
+$(obj)/zImage: $(obj)/compressed/vmlinux
+ @cp $< $@
+ @echo ' Kernel: $@ is ready'
diff -urNP --exclude='*.cvsignore' ../linux/arch/cris/arch-v10/boot/rescue/Makefile linux-2.6/arch/cris/arch-v10/boot/rescue/Makefile
--- ../linux/arch/cris/arch-v10/boot/rescue/Makefile 2007-02-04 19:44:54.000000000 +0100
+++ linux-2.6/arch/cris/arch-v10/boot/rescue/Makefile 2006-11-30 11:42:39.000000000 +0100
@@ -1,56 +1,38 @@
#
-# Makefile for rescue code
+# Makefile for rescue (bootstrap) code
#
-target = $(target_rescue_dir)
-src = $(src_rescue_dir)
CC = gcc-cris -mlinux $(LINUXINCLUDE)
CFLAGS = -O2
-LD = gcc-cris -mlinux -nostdlib
+AFLAGS = -traditional
+LD = gcc-cris -mlinux -nostdlib
+LDFLAGS = -T $(obj)/rescue.ld
OBJCOPY = objcopy-cris
OBJCOPYFLAGS = -O binary --remove-section=.bss
+obj-y = head.o
+OBJECT = $(obj)/$(obj-y)
-all: $(target)/rescue.bin $(target)/testrescue.bin $(target)/kimagerescue.bin
+targets := rescue.o rescue.bin
-$(target)/rescue.bin: $(target) $(target)/head.o
- $(LD) -T $(src)/rescue.ld -o $(target)/rescue.o $(target)/head.o
- $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/rescue.o $(target)/rescue.bin
-# Place a copy in top-level build directory
- cp -p $(target)/rescue.bin $(objtree)
+$(obj)/rescue.o: $(OBJECT) FORCE
+ $(call if_changed,ld)
-$(target)/testrescue.bin: $(target) $(target)/testrescue.o
- $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/testrescue.o tr.bin
+$(obj)/rescue.bin: $(obj)/rescue.o FORCE
+ $(call if_changed,objcopy)
+ cp -p $(obj)/rescue.bin $(objtree)
+
+$(obj)/testrescue.bin: $(obj)/testrescue.o
+ $(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/testrescue.o tr.bin
# Pad it to 784 bytes
dd if=/dev/zero of=tmp2423 bs=1 count=784
cat tr.bin tmp2423 >testrescue_tmp.bin
- dd if=testrescue_tmp.bin of=$(target)/testrescue.bin bs=1 count=784
+ dd if=testrescue_tmp.bin of=$(obj)/testrescue.bin bs=1 count=784
rm tr.bin tmp2423 testrescue_tmp.bin
-$(target)/kimagerescue.bin: $(target) $(target)/kimagerescue.o
- $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/kimagerescue.o ktr.bin
+$(obj)/kimagerescue.bin: $(obj)/kimagerescue.o
+ $(OBJCOPY) $(OBJCOPYFLAGS) $(obj)/kimagerescue.o ktr.bin
# Pad it to 784 bytes, that's what the rescue loader expects
dd if=/dev/zero of=tmp2423 bs=1 count=784
cat ktr.bin tmp2423 >kimagerescue_tmp.bin
- dd if=kimagerescue_tmp.bin of=$(target)/kimagerescue.bin bs=1 count=784
+ dd if=kimagerescue_tmp.bin of=$(obj)/kimagerescue.bin bs=1 count=784
rm ktr.bin tmp2423 kimagerescue_tmp.bin
-
-$(target):
- mkdir -p $(target)
-
-$(target)/head.o: $(src)/head.S
- $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
-
-$(target)/testrescue.o: $(src)/testrescue.S
- $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
-
-$(target)/kimagerescue.o: $(src)/kimagerescue.S
- $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
-
-clean:
- rm -f $(target)/*.o $(target)/*.bin
-
-fastdep:
-
-modules:
-
-modules-install:
next reply other threads:[~2007-04-22 19:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-22 19:24 Mikael Starvik [this message]
2007-04-22 19:40 ` Sam Ravnborg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BFECAF9E178F144FAEF2BF4CE739C66803BEEE17@exmail1.se.axis.com \
--to=mikael.starvik@axis.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®