CROSS_COMPILE ?= arm-none-eabi- PATCHDIR := /proj/fairbanks_lx/users/coresw/linux-next-patches build_dir := $(CURDIR)/build-u300 output_dir := $(HOME) rootfs := $(PATCHDIR)/rootfs-u338.cpio install_dir := $(build_dir)/install config_file := $(build_dir)/.config strip := $(CROSS_COMPILE)strip objcopy := $(CROSS_COMPILE)objcopy ARCH ?= arm make_options := -f Makefile \ ARCH=$(ARCH) \ CROSS_COMPILE=$(CROSS_COMPILE) \ KBUILD_OUTPUT=$(build_dir) .PHONY: help help: @echo "**** Common Makefile ****" @echo "make config [PLATFORM=foo] - configure for platform \"foo\"" @echo "make build - build the kernel and produce a RAMdisk image" @echo @echo "example:" @echo "make -f u300.mak config" @echo "make -f u300.mak build" .PHONY: have-rootfs have-rootfs: @if [ ! -f $(rootfs) ] ; then \ echo "ERROR: no rootfs at $(rootfs)" ; \ echo "This is needed to boot the system." ; \ echo "ABORTING." ; \ exit 1 ; \ else \ echo "Rootfs available at $(rootfs)" ; \ fi .PHONY: have-crosscompiler have-crosscompiler: @echo -n "Check that $(CROSS_COMPILE)gcc is available..." @which $(CROSS_COMPILE)gcc > /dev/null ; \ if [ ! $$? -eq 0 ] ; then \ echo "ERROR: cross-compiler $(CROSS_COMPILE)gcc not in PATH=$$PATH!" ; \ echo "ABORTING." ; \ exit 1 ; \ else \ echo "OK" ;\ fi config: have-rootfs FORCE @mkdir -p $(build_dir) @cp $(rootfs) $(build_dir) $(MAKE) $(make_options) u300_defconfig # Reconfigure a bit $(CURDIR)/scripts/config --file $(build_dir)/.config \ --enable BLK_DEV_INITRD \ --set-str INITRAMFS_SOURCE rootfs-u338.cpio \ --enable RD_GZIP \ --enable INITRAMFS_COMPRESSION_NONE \ --enable DEBUG_FS \ --disable MMC_DEBUG yes "" | make $(make_options) oldconfig menuconfig: FORCE $(MAKE) $(make_options) menuconfig build: have-rootfs have-crosscompiler FORCE $(MAKE) $(make_options) -j 4 vmlinux CONFIG_DEBUG_SECTION_MISMATCH=y # $(MAKE) $(make_options) -j 4 modules # Copy to output dir cp -f $(build_dir)/vmlinux $(output_dir)/vmlinux.debug $(strip) -o $(output_dir)/vmlinux.stripped $(output_dir)/vmlinux.debug $(objcopy) -O binary -R .note -R .comment -R .note.gnu.build-id -S \ $(output_dir)/vmlinux.stripped $(output_dir)/vmlinux.bin regressiontest: config $(MAKE) $(make_options) realview_defconfig $(MAKE) $(make_options) -j 4 vmlinux CONFIG_DEBUG_SECTION_MISMATCH=y $(MAKE) $(make_options) -j 4 modules $(MAKE) $(make_options) versatile_defconfig $(MAKE) $(make_options) -j 4 vmlinux CONFIG_DEBUG_SECTION_MISMATCH=y $(MAKE) $(make_options) -j 4 modules $(MAKE) $(make_options) integrator_defconfig $(MAKE) $(make_options) -j 4 vmlinux CONFIG_DEBUG_SECTION_MISMATCH=y $(MAKE) $(make_options) -j 4 modules TAGS: FORCE $(MAKE) $(make_options) TAGS clean: $(MAKE) -f Makefile clean rm -f $(module_files) rm -rf build # Rules without commands or prerequisites that do not match a file name # are considered to always change when make runs. This means that any rule # that depends on FORCE will always be remade also. FORCE: