[Buildroot] MAKEALL script

Ulf Samuelsson ulf at atmel.com
Tue Sep 4 22:59:48 UTC 2007


Would like to easily be able to build multiple projects without going
through the hassle of copying something to .config all the time.

The idea is to be able to save the current .config somewhere
and be able to easily retrieve it.

The save is performed by 

$ make saveconfig

This saves a project with PROJECT=myproject into
"project/myproject/myproject.config"


Once saved, the project can be rebuilt by

$ make BOARD=myproject


Here is how a MAKEALL can be implemented (Once projects are available)!

#!/bin/bash
make BOARD=at91sam9261ek
make BOARD=generic-x86
make BOARD=atstk1000

The main difference between this and the <myproject>_defconfig
is that most projects will be generated by the user
and not statically included in the trunk, where the defconfig
stuff is more appropriate.


Index: Makefile
===================================================================
--- Makefile	(revision 19784)
+++ Makefile	(arbetskopia)
@@ -35,8 +35,12 @@
 
 # Pull in the user's configuration file
 ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
+ifeq ($(BOARD),)
 -include $(TOPDIR).config
+else
+-include $(TOPDIR)/project/$(BOARD)/$(BOARD).config
 endif
+endif
 ifneq ($(BUILDROOT_DL_DIR),)
 BR2_DL_DIR:=$(BUILDROOT_DL_DIR)
 endif
@@ -399,6 +403,14 @@
 	cp $(shell find ./target/ -name $@) .config
 	@$(CONFIG)/conf -o $(CONFIG_CONFIG_IN)
 
+saveconfig: $(CONFIG)/conf
+	mkdir -p project/$(PROJECT)/u-boot
+	-cp .config project/$(PROJECT)/$(PROJECT).config
+	-cp $(LINUX26_DIR)/.config
project/$(PROJECT)/linux-$(LINUX26_VERSION).config
+	-cp $(BUSYBOX_DIR)/.config
project/$(PROJECT)/busybox-$(BUSYBOX_VERSION).config
+	-cp $(UBOOT_DIR)/include/configs/$(PROJECT).h
project/$(PROJECT)/u-boot/$(PROJECT).h
+	-cp $(UCLIBC_DIR)/.config
project/$(PROJECT)/uclibc-$(UCLIBC_VER).config
+
 help:
 	@echo 'Cleaning:'
 	@echo '  clean                  - delete temporary files created by
build'
@@ -419,4 +431,4 @@
 	@echo
 
 .PHONY: dummy subdirs release distclean clean config oldconfig \
-	menuconfig tags check test depend defconfig help
+	menuconfig saveconfig tags check test depend defconfig help



-- 
Best Regards,
Ulf Samuelsson          mail:   ulf at atmel.com
Atmel Nordic AB
Box 2033, 174 52 Sundbyberg
Kavallerivägen 24, 174 58 Sundbyberg
Sweden
Tel:    +46 8 441 54 22 GSM:    +46 706 224457






More information about the buildroot mailing list