Modularize symbolic targets a bit
authorTimothy Roscoe <troscoe@inf.ethz.ch>
Wed, 29 Apr 2015 16:26:56 +0000 (18:26 +0200)
committerTimothy Roscoe <troscoe@inf.ethz.ch>
Fri, 3 Jul 2015 14:07:57 +0000 (16:07 +0200)
hake/arm_gem5.mk [new file with mode: 0644]
hake/hake.sh
hake/pandaboard.mk [new file with mode: 0644]
hake/symbolic_targets.mk

diff --git a/hake/arm_gem5.mk b/hake/arm_gem5.mk
new file mode 100644 (file)
index 0000000..317f435
--- /dev/null
@@ -0,0 +1,75 @@
+##########################################################################
+# Copyright (c) 2009-2015 ETH Zurich.
+# All rights reserved.
+#
+# This file is distributed under the terms in the attached LICENSE file.
+# If you do not find this file, copies can be found by writing to:
+# ETH Zurich D-INFK, CAB F.78, Universitaetstr. 6, CH-8092 Zurich,
+# Attn: Systems Group.
+#
+##########################################################################
+
+########################################################################
+#
+# GEM5 build
+#
+########################################################################
+
+menu.lst.arm_gem5: $(SRCDIR)/hake/menu.lst.arm_gem5
+       cp $< $@
+
+menu.lst.arm_gem5_mc: $(SRCDIR)/hake/menu.lst.arm_gem5_mc
+       cp $< $@
+
+GEM5_MODULES=\
+       armv7/sbin/cpu_arm_gem5 \
+       armv7/sbin/init \
+       armv7/sbin/mem_serv \
+       armv7/sbin/monitor \
+       armv7/sbin/ramfsd \
+       armv7/sbin/spawnd \
+       armv7/sbin/startd \
+       armv7/sbin/corectrl \
+       armv7/sbin/skb \
+       armv7/sbin/memtest
+
+
+arm_gem5_image: $(GEM5_MODULES) \
+               tools/bin/arm_molly \
+               menu.lst.arm_gem5_mc
+       # Translate each of the binary files we need
+       $(SRCDIR)/tools/arm_molly/build_data_files.sh menu.lst.arm_gem5_mc molly_gem5
+       # Generate appropriate linker script
+       cpp -P -DBASE_ADDR=0x00100000 $(SRCDIR)/tools/arm_molly/molly_ld_script.in \
+               molly_gem5/molly_ld_script
+       # Build a C file to link into a single image for the 2nd-stage
+       # bootloader
+       tools/bin/arm_molly menu.lst.arm_gem5_mc arm_mbi.c
+       # Compile the complete boot image into a single executable
+       $(ARM_GCC) -std=c99 -g -fPIC -pie -Wl,-N -fno-builtin \
+               -nostdlib -march=armv7-a -mapcs -fno-unwind-tables \
+               -Tmolly_gem5/molly_ld_script \
+               -I$(SRCDIR)/include \
+               -I$(SRCDIR)/include/arch/arm \
+               -I./armv7/include \
+               -I$(SRCDIR)/include/oldc \
+               -I$(SRCDIR)/include/c \
+               -imacros $(SRCDIR)/include/deputy/nodeputy.h \
+               $(SRCDIR)/tools/arm_molly/molly_boot.S \
+               $(SRCDIR)/tools/arm_molly/molly_init.c \
+               $(SRCDIR)/tools/arm_molly/lib.c \
+               ./arm_mbi.c \
+               $(SRCDIR)/lib/elf/elf32.c \
+               ./molly_gem5/* \
+               -o arm_gem5_image
+
+# ARM GEM5 Simulation Targets
+ARM_FLAGS=$(SRCDIR)/tools/arm_gem5/gem5script.py --caches --l2cache --n=2 --kernel=arm_gem5_image
+
+arm_gem5: arm_gem5_image $(SRCDIR)/tools/arm_gem5/gem5script.py
+       gem5.fast $(ARM_FLAGS)
+
+arm_gem5_detailed: arm_gem5_image $(SRCDIR)/tools/arm_gem5/gem5script.py
+       gem5.fast $(ARM_FLAGS) --cpu-type=arm_detailed
+
+.PHONY: arm_gem5 arm_gem5_detailed
index 1d53fad..71430a1 100755 (executable)
@@ -25,6 +25,9 @@ usage() {
     echo "  The way you use this script is to create a new directory for your"
     echo "  build tree, cd into it, and run this script with the --source-dir"
     echo "  argument specifying the top of the source tree."
+    echo ""
+    echo "  Known architectures may include: "
+    echo "     x86_64 x86_32 armv5 arm11mp scc xscale armv7 armv7-m k10m"
     exit 1;
 }
 
diff --git a/hake/pandaboard.mk b/hake/pandaboard.mk
new file mode 100644 (file)
index 0000000..d5c1a72
--- /dev/null
@@ -0,0 +1,181 @@
+##########################################################################
+# Copyright (c) 2009-2015 ETH Zurich.
+# All rights reserved.
+#
+# This file is distributed under the terms in the attached LICENSE file.
+# If you do not find this file, copies can be found by writing to:
+# ETH Zurich D-INFK, CAB F.78, Universitaetstr. 6, CH-8092 Zurich,
+# Attn: Systems Group.
+#
+##########################################################################
+
+#######################################################################
+#
+# Pandaboard builds
+#
+#######################################################################
+
+PANDABOARD_MODULES=\
+       armv7/sbin/cpu_omap44xx \
+       armv7/sbin/init \
+       armv7/sbin/mem_serv \
+       armv7/sbin/monitor \
+       armv7/sbin/ramfsd \
+       armv7/sbin/spawnd \
+       armv7/sbin/startd \
+       armv7/sbin/skb \
+       armv7/sbin/memtest \
+       armv7/sbin/kaluga \
+       armv7/sbin/fish \
+       armv7/sbin/sdma \
+       armv7/sbin/sdmatest \
+       armv7/sbin/sdma_bench \
+       armv7/sbin/bulk_sdma \
+       armv7/sbin/usb_manager \
+       armv7/sbin/usb_keyboard \
+       armv7/sbin/serial \
+       armv7/sbin/angler \
+       armv7/sbin/corectrl \
+
+
+menu.lst.pandaboard: $(SRCDIR)/hake/menu.lst.pandaboard
+       cp $< $@
+
+pandaboard_image: $(PANDABOARD_MODULES) \
+               tools/bin/arm_molly \
+               menu.lst.pandaboard
+       # Translate each of the binary files we need
+       $(SRCDIR)/tools/arm_molly/build_data_files.sh menu.lst.pandaboard molly_panda
+       # Generate appropriate linker script
+       cpp -P -DBASE_ADDR=0x82001000 $(SRCDIR)/tools/arm_molly/molly_ld_script.in \
+               molly_panda/molly_ld_script
+       # Build a C file to link into a single image for the 2nd-stage
+       # bootloader
+       tools/bin/arm_molly menu.lst.pandaboard panda_mbi.c
+       # Compile the complete boot image into a single executable
+       $(ARM_GCC) -std=c99 -g -fPIC -pie -Wl,-N -fno-builtin \
+               -nostdlib -march=armv7-a -mapcs -fno-unwind-tables \
+               -Tmolly_panda/molly_ld_script \
+               -I$(SRCDIR)/include \
+               -I$(SRCDIR)/include/arch/arm \
+               -I./armv7/include \
+               -I$(SRCDIR)/include/oldc \
+               -I$(SRCDIR)/include/c \
+               -imacros $(SRCDIR)/include/deputy/nodeputy.h \
+               $(SRCDIR)/tools/arm_molly/molly_boot.S \
+               $(SRCDIR)/tools/arm_molly/molly_init.c \
+               $(SRCDIR)/tools/arm_molly/lib.c \
+               ./panda_mbi.c \
+               $(SRCDIR)/lib/elf/elf32.c \
+               ./molly_panda/* \
+               -o pandaboard_image
+       @echo "OK - pandaboard boot image is built."
+       @echo "If your boot environment is correctly set up, you can now:"
+       @echo "$ usbboot ./pandaboard_image"
+
+#######################################################################
+#
+# Pandaboard build for the armv7-M slave image (to be used in conjunction with a master image)
+# (basically a normal pandaboard_image, but compiled for the cortex-m3)
+#
+#######################################################################
+
+HETEROPANDA_SLAVE_MODULES=\
+       armv7-m/sbin/cpu_omap44xx \
+       armv7-m/sbin/init \
+       armv7-m/sbin/mem_serv \
+       armv7-m/sbin/monitor \
+       armv7-m/sbin/ramfsd \
+       armv7-m/sbin/spawnd \
+       armv7-m/sbin/startd \
+       armv7-m/sbin/skb \
+       armv7-m/sbin/memtest
+
+menu.lst.armv7-m: $(SRCDIR)/hake/menu.lst.armv7-m
+       cp $< $@
+
+heteropanda_slave: $(HETEROPANDA_SLAVE_MODULES) \
+               tools/bin/arm_molly \
+               menu.lst.armv7-m
+       # Translate each of the binary files we need
+       $(SRCDIR)/tools/arm_molly/build_data_files.sh menu.lst.armv7-m molly_panda_slave
+       # Generate appropriate linker script
+       cpp -P -DBASE_ADDR=0x0 $(SRCDIR)/tools/arm_molly/molly_ld_script.in \
+               molly_panda_slave/molly_ld_script
+       # Build a C file to link into a single image for the 2nd-stage
+       # bootloader
+       tools/bin/arm_molly menu.lst.armv7-m panda_mbi_slave.c
+       # Compile the complete boot image into a single executable
+       $(ARM_GCC) -std=c99 -g -fPIC -pie -Wl,-N -fno-builtin \
+               -nostdlib -march=armv7-m -mcpu=cortex-m3 -mthumb -mapcs -fno-unwind-tables \
+               -Tmolly_panda_slave/molly_ld_script \
+               -I$(SRCDIR)/include \
+               -I$(SRCDIR)/include/arch/arm \
+               -I./armv7-m/include \
+               -I$(SRCDIR)/include/oldc \
+               -I$(SRCDIR)/include/c \
+               -imacros $(SRCDIR)/include/deputy/nodeputy.h \
+               $(SRCDIR)/tools/arm_molly/molly_boot.S \
+               $(SRCDIR)/tools/arm_molly/molly_init.c \
+               $(SRCDIR)/tools/arm_molly/lib.c \
+               ./panda_mbi_slave.c \
+               $(SRCDIR)/lib/elf/elf32.c \
+               ./molly_panda_slave/* \
+               -o heteropanda_slave
+       @echo "OK - heteropanda slave image is built."
+       @echo "you can now use this image to link into a regular pandaboard image"
+
+
+
+
+#######################################################################
+#
+# Pandaboard build for the heteropanda_master:
+# basically a regular pandaboard_image, except that it contains
+# a heteropanda_slave image, and arm_molly is called with -DHETEROPANDA
+#
+#######################################################################
+
+menu.lst.heteropanda_master: $(SRCDIR)/hake/menu.lst.heteropanda_master
+       cp $< $@
+
+heteropanda_master_image: $(PANDABOARD_MODULES) \
+               tools/bin/arm_molly \
+               menu.lst.heteropanda_master \
+               heteropanda_slave \
+               $(SRCDIR)/tools/arm_molly/molly_ld_script.in
+       # Translate each of the binary files we need
+       $(SRCDIR)/tools/arm_molly/build_data_files.sh menu.lst.heteropanda_master molly_panda
+       # Generate appropriate linker script
+       cpp -P -DBASE_ADDR=0x82001000 $(SRCDIR)/tools/arm_molly/molly_ld_script.in \
+               molly_panda/molly_ld_script
+
+       # HETEROPANDA: convert slave image into a form we can insert in our image
+       $(ARM_OBJCOPY) -I binary -O elf32-littlearm -B arm --rename-section \
+           .data=.rodata_thumb,alloc,load,readonly,data,contents heteropanda_slave \
+           molly_panda/heteropanda_slave
+
+       # Build a C file to link into a single image for the 2nd-stage
+       # bootloader
+       tools/bin/arm_molly menu.lst.heteropanda_master panda_mbi.c
+       # Compile the complete boot image into a single executable
+       $(ARM_GCC) -std=c99 -g -fPIC -pie -Wl,-N -fno-builtin \
+               -nostdlib -march=armv7-a -mcpu=cortex-a9 -mapcs -fno-unwind-tables \
+               -Tmolly_panda/molly_ld_script \
+               -I$(SRCDIR)/include \
+               -I$(SRCDIR)/include/arch/arm \
+               -I./armv7/include \
+               -I$(SRCDIR)/include/oldc \
+               -I$(SRCDIR)/include/c \
+               -imacros $(SRCDIR)/include/deputy/nodeputy.h \
+               $(SRCDIR)/tools/arm_molly/molly_boot.S \
+               $(SRCDIR)/tools/arm_molly/molly_init.c \
+               $(SRCDIR)/tools/arm_molly/lib.c \
+               ./panda_mbi.c \
+               $(SRCDIR)/lib/elf/elf32.c \
+               ./molly_panda/* \
+               -DHETEROPANDA \
+               -o heteropanda_master_image
+       @echo "OK - heteropanda_master_image is built."
+       @echo "If your boot environment is correctly set up, you can now:"
+       @echo "$ usbboot ./heteropanda_master_image"
index 3f1c589..60503a9 100644 (file)
@@ -22,10 +22,21 @@ MAKEFLAGS=r
 
 # Set default architecture to the first specified by Hake in generated Makefile.
 ARCH ?= $(word 1, $(HAKE_ARCHS))
+
+# Set the directory to fetch include files from for this Makefile, to
+# introduce some modularity into this file.  Note that hake will read
+# this file (symbolic_targets.mk) from the build directory, but this
+# file specifies its include subfiles from the source tree (unless
+# specified otherwise).
+MK ?= $(SRCDIR)/hake
+
+
 ARM_GCC?=arm-linux-gnueabi-gcc
 ARM_OBJCOPY?=arm-linux-gnueabi-objcopy
 K1OM_OBJCOPY?=k1om-mpss-linux-objcopy
 
+# upload Xeon Phi images to nfs share (leave blank to cancel)
+BARRELFISH_NFS_DIR ?="emmentaler.ethz.ch:/mnt/local/nfs/barrelfish/xeon_phi"
 
 # All binaries of the RCCE LU benchmark
 BIN_RCCE_LU= \
@@ -383,118 +394,6 @@ install_headers:
 
 .PHONY : install_headers
 
-sim: simulate
-.PHONY : sim
-
-QEMU=unknown-arch-error
-GDB=unknown-arch-error
-CLEAN_HD=
-
-DISK=hd.img
-AHCI=-device ahci,id=ahci -device ide-drive,drive=disk,bus=ahci.0 -drive id=disk,file=$(DISK),if=none
-
-MENU_LST=-kernel $(shell sed -rne 's,^kernel[ \t]*/([^ ]*).*,\1,p' menu.lst) \
-       -append '$(shell sed -rne 's,^kernel[ \t]*[^ ]*[ \t]*(.*),\1,p' menu.lst)' \
-       -initrd '$(shell sed -rne 's,^module(nounzip)?[ \t]*/(.*),\2,p' menu.lst | awk '{ if(NR == 1) printf($$0); else printf("," $$0) } END { printf("\n") }')'
-
-ifeq ($(ARCH),x86_64)
-    QEMU_CMD=qemu-system-x86_64 -smp 2 -m 1024 -net nic,model=e1000 -net user $(AHCI) -nographic $(MENU_LST)
-       GDB=x86_64-pc-linux-gdb
-       CLEAN_HD=qemu-img create $(DISK) 10M
-else ifeq ($(ARCH),x86_32)
-        QEMU_CMD=qemu-system-i386 -no-kvm -smp 2 -m 1024 -net nic,model=ne2k_pci -net user -fda $(SRCDIR)/tools/grub-qemu.img -tftp $(PWD) -nographic
-       GDB=gdb
-else ifeq ($(ARCH),scc)
-        QEMU_CMD=qemu-system-i386 -no-kvm -smp 2 -m 1024 -cpu pentium -net nic,model=ne2k_pci -net user -fda $(SRCDIR)/tools/grub-qemu.img -tftp $(PWD) -nographic
-       GDB=gdb
-else ifeq ($(ARCH),armv5)
-       ARM_QEMU_CMD=qemu-system-arm -M integratorcp -kernel armv5/sbin/cpu.bin -nographic -no-reboot -m 256 -initrd armv5/romfs.cpio
-       GDB=xterm -e arm-linux-gnueabi-gdb
-simulate: $(MODULES) armv5/romfs.cpio
-       $(ARM_QEMU_CMD)
-.PHONY: simulate
-
-armv5/tools/debug.arm.gdb: $(SRCDIR)/tools/debug.arm.gdb
-       cp $< $@
-
-debugsim: $(MODULES) armv5/romfs.cpio armv5/tools/debug.arm.gdb
-       $(SRCDIR)/tools/debug.sh "$(ARM_QEMU_CMD) -initrd armv5/romfs.cpio" "$(GDB)" "-s $(ARCH)/sbin/cpu -x armv5/tools/debug.arm.gdb $(GDB_ARGS)"
-.PHONY : debugsim
-else ifeq ($(ARCH),arm11mp)
-       QEMU_CMD=qemu-system-arm -cpu mpcore -M realview -kernel arm11mp/sbin/cpu.bin
-       GDB=arm-linux-gnueabi-gdb
-else ifeq ($(ARCH), k1om)
-       # what is the emulation option for the xeon phi ?
-       QEMU=unknown-arch-error
-       GDB=x86_64-k1om-barrelfish-gdb
-endif
-
-
-ifdef QEMU_CMD
-
-simulate: $(MODULES)
-       $(CLEAN_HD)
-       $(QEMU_CMD)
-.PHONY : simulate
-
-debugsim: $(MODULES)
-       $(CLEAN_HD)
-       $(SRCDIR)/tools/debug.sh "$(QEMU_CMD)" "$(GDB)" "-x $(SRCDIR)/tools/debug.gdb $(GDB_ARGS)" "file:/dev/stdout"
-.PHONY : debugsim
-
-endif
-
-
-
-$(ARCH)/menu.lst: $(SRCDIR)/hake/menu.lst.$(ARCH)
-       cp $< $@
-
-$(ARCH)/romfs.cpio: $(SRCDIR)/tools/arm-mkbootcpio.sh $(MODULES) $(ARCH)/menu.lst
-       $(SRCDIR)/tools/arm-mkbootcpio.sh $(ARCH)/menu.lst $@
-
-# Location of hardcoded size of romfs CPIO image
-arm_romfs_cpio = "$(ARCH)/include/romfs_size.h"
-
-# XXX: Horrid hack to hardcode size of romfs CPIO image into ARM kernel
-# This works in several recursive make steps:
-# 1. Create a dummy romfs_size.h header file
-# 2. Compile everything
-# 3. Create the romfs CPIO image
-# 4. Determine its size and write to romfs_size.h
-# 5. Re-compile kernel (but not the romfs) with correct size information
-# 6. Install romfs to installation location
-arm:
-       $(MAKE)
-       $(MAKE) $(ARCH)/romfs.cpio
-       echo "//Autogenerated size of romfs.cpio because the bootloader cannot calculate it" > $(arm_romfs_cpio)
-       echo "size_t romfs_cpio_archive_size = `ls -asl $(ARCH)/romfs.cpio | sed -e 's/ /\n/g' | head -6 | tail -1`;" >> $(arm_romfs_cpio)
-       $(MAKE)
-.PHONY: arm
-
-# Builds a dummy romfs_size.h
-$(ARCH)/include/romfs_size.h:
-       mkdir -p $(shell dirname $@)
-       echo "size_t romfs_cpio_archive_size = 0; //should not see this" > $@
-
-arminstall:
-       $(MAKE) arm
-       $(MAKE) install
-       install -p $(ARCH)/romfs.cpio ${INSTALL_PREFIX}/$(ARCH)/romfs.cpio
-.PHONY: arminstall
-
-# Copy the scc-specific menu.lst from the source directory to the build directory
-menu.lst.scc: $(SRCDIR)/hake/menu.lst.scc
-       cp $< $@
-
-scc: all tools/bin/dite menu.lst.scc
-       $(shell find scc/sbin -type f -print0 | xargs -0 strip -d)
-       tools/bin/dite -32 -o bigimage.dat menu.lst.scc
-       cp $(SRCDIR)/tools/scc/bootvector.dat .
-       bin2obj -m $(SRCDIR)/tools/scc/bigimage.map -o barrelfish0.obj
-       bin2obj -m $(SRCDIR)/tools/scc/bootvector.map -o barrelfish1.obj
-       @echo Taking the barrelfish.obj files to SCC host
-       scp barrelfish[01].obj user@tomme1.in.barrelfish.org:
-
 # Source indexing targets
 cscope.files:
        find $(abspath .) $(abspath $(SRCDIR)) -name '*.[ch]' -type f -print | sort | uniq > $@
@@ -579,240 +478,3 @@ schedsim-check: $(wildcard $(SRCDIR)/tools/schedsim/*.cfg)
 k1om/sbin/weever: k1om/sbin/weever_elf
        $(K1OM_OBJCOPY) -O binary -R .note -R .comment -S k1om/sbin/weever_elf ./k1om/sbin/weever
 
-
-
-#######################################################################
-#
-# Pandaboard builds
-#
-#######################################################################
-
-PANDABOARD_MODULES=\
-       armv7/sbin/cpu_omap44xx \
-       armv7/sbin/init \
-       armv7/sbin/mem_serv \
-       armv7/sbin/monitor \
-       armv7/sbin/ramfsd \
-       armv7/sbin/spawnd \
-       armv7/sbin/startd \
-       armv7/sbin/skb \
-       armv7/sbin/memtest \
-       armv7/sbin/kaluga \
-       armv7/sbin/fish \
-       armv7/sbin/sdma \
-       armv7/sbin/sdmatest \
-       armv7/sbin/sdma_bench \
-       armv7/sbin/bulk_sdma \
-       armv7/sbin/usb_manager \
-       armv7/sbin/usb_keyboard \
-       armv7/sbin/serial \
-       armv7/sbin/angler \
-       armv7/sbin/corectrl \
-
-
-menu.lst.pandaboard: $(SRCDIR)/hake/menu.lst.pandaboard
-       cp $< $@
-
-pandaboard_image: $(PANDABOARD_MODULES) \
-               tools/bin/arm_molly \
-               menu.lst.pandaboard
-       # Translate each of the binary files we need
-       $(SRCDIR)/tools/arm_molly/build_data_files.sh menu.lst.pandaboard molly_panda
-       # Generate appropriate linker script
-       cpp -P -DBASE_ADDR=0x82001000 $(SRCDIR)/tools/arm_molly/molly_ld_script.in \
-               molly_panda/molly_ld_script
-       # Build a C file to link into a single image for the 2nd-stage
-       # bootloader
-       tools/bin/arm_molly menu.lst.pandaboard panda_mbi.c
-       # Compile the complete boot image into a single executable
-       $(ARM_GCC) -std=c99 -g -fPIC -pie -Wl,-N -fno-builtin \
-               -nostdlib -march=armv7-a -mapcs -fno-unwind-tables \
-               -Tmolly_panda/molly_ld_script \
-               -I$(SRCDIR)/include \
-               -I$(SRCDIR)/include/arch/arm \
-               -I./armv7/include \
-               -I$(SRCDIR)/include/oldc \
-               -I$(SRCDIR)/include/c \
-               -imacros $(SRCDIR)/include/deputy/nodeputy.h \
-               $(SRCDIR)/tools/arm_molly/molly_boot.S \
-               $(SRCDIR)/tools/arm_molly/molly_init.c \
-               $(SRCDIR)/tools/arm_molly/lib.c \
-               ./panda_mbi.c \
-               $(SRCDIR)/lib/elf/elf32.c \
-               ./molly_panda/* \
-               -o pandaboard_image
-       @echo "OK - pandaboard boot image is built."
-       @echo "If your boot environment is correctly set up, you can now:"
-       @echo "$ usbboot ./pandaboard_image"
-
-########################################################################
-#
-# GEM5 build
-#
-########################################################################
-
-menu.lst.arm_gem5: $(SRCDIR)/hake/menu.lst.arm_gem5
-       cp $< $@
-
-menu.lst.arm_gem5_mc: $(SRCDIR)/hake/menu.lst.arm_gem5_mc
-       cp $< $@
-
-GEM5_MODULES=\
-       armv7/sbin/cpu_arm_gem5 \
-       armv7/sbin/init \
-       armv7/sbin/mem_serv \
-       armv7/sbin/monitor \
-       armv7/sbin/ramfsd \
-       armv7/sbin/spawnd \
-       armv7/sbin/startd \
-       armv7/sbin/corectrl \
-       armv7/sbin/skb \
-       armv7/sbin/memtest
-
-
-arm_gem5_image: $(GEM5_MODULES) \
-               tools/bin/arm_molly \
-               menu.lst.arm_gem5_mc
-       # Translate each of the binary files we need
-       $(SRCDIR)/tools/arm_molly/build_data_files.sh menu.lst.arm_gem5_mc molly_gem5
-       # Generate appropriate linker script
-       cpp -P -DBASE_ADDR=0x00100000 $(SRCDIR)/tools/arm_molly/molly_ld_script.in \
-               molly_gem5/molly_ld_script
-       # Build a C file to link into a single image for the 2nd-stage
-       # bootloader
-       tools/bin/arm_molly menu.lst.arm_gem5_mc arm_mbi.c
-       # Compile the complete boot image into a single executable
-       $(ARM_GCC) -std=c99 -g -fPIC -pie -Wl,-N -fno-builtin \
-               -nostdlib -march=armv7-a -mapcs -fno-unwind-tables \
-               -Tmolly_gem5/molly_ld_script \
-               -I$(SRCDIR)/include \
-               -I$(SRCDIR)/include/arch/arm \
-               -I./armv7/include \
-               -I$(SRCDIR)/include/oldc \
-               -I$(SRCDIR)/include/c \
-               -imacros $(SRCDIR)/include/deputy/nodeputy.h \
-               $(SRCDIR)/tools/arm_molly/molly_boot.S \
-               $(SRCDIR)/tools/arm_molly/molly_init.c \
-               $(SRCDIR)/tools/arm_molly/lib.c \
-               ./arm_mbi.c \
-               $(SRCDIR)/lib/elf/elf32.c \
-               ./molly_gem5/* \
-               -o arm_gem5_image
-
-# ARM GEM5 Simulation Targets
-ARM_FLAGS=$(SRCDIR)/tools/arm_gem5/gem5script.py --caches --l2cache --n=2 --kernel=arm_gem5_image
-
-arm_gem5: arm_gem5_image $(SRCDIR)/tools/arm_gem5/gem5script.py
-       gem5.fast $(ARM_FLAGS)
-
-arm_gem5_detailed: arm_gem5_image $(SRCDIR)/tools/arm_gem5/gem5script.py
-       gem5.fast $(ARM_FLAGS) --cpu-type=arm_detailed
-
-.PHONY: arm_gem5 arm_gem5_detailed
-
-#######################################################################
-#
-# Pandaboard build for the armv7-M slave image (to be used in conjunction with a master image)
-# (basically a normal pandaboard_image, but compiled for the cortex-m3)
-#
-#######################################################################
-
-HETEROPANDA_SLAVE_MODULES=\
-       armv7-m/sbin/cpu_omap44xx \
-       armv7-m/sbin/init \
-       armv7-m/sbin/mem_serv \
-       armv7-m/sbin/monitor \
-       armv7-m/sbin/ramfsd \
-       armv7-m/sbin/spawnd \
-       armv7-m/sbin/startd \
-       armv7-m/sbin/skb \
-       armv7-m/sbin/memtest
-
-menu.lst.armv7-m: $(SRCDIR)/hake/menu.lst.armv7-m
-       cp $< $@
-
-heteropanda_slave: $(HETEROPANDA_SLAVE_MODULES) \
-               tools/bin/arm_molly \
-               menu.lst.armv7-m
-       # Translate each of the binary files we need
-       $(SRCDIR)/tools/arm_molly/build_data_files.sh menu.lst.armv7-m molly_panda_slave
-       # Generate appropriate linker script
-       cpp -P -DBASE_ADDR=0x0 $(SRCDIR)/tools/arm_molly/molly_ld_script.in \
-               molly_panda_slave/molly_ld_script
-       # Build a C file to link into a single image for the 2nd-stage
-       # bootloader
-       tools/bin/arm_molly menu.lst.armv7-m panda_mbi_slave.c
-       # Compile the complete boot image into a single executable
-       $(ARM_GCC) -std=c99 -g -fPIC -pie -Wl,-N -fno-builtin \
-               -nostdlib -march=armv7-m -mcpu=cortex-m3 -mthumb -mapcs -fno-unwind-tables \
-               -Tmolly_panda_slave/molly_ld_script \
-               -I$(SRCDIR)/include \
-               -I$(SRCDIR)/include/arch/arm \
-               -I./armv7-m/include \
-               -I$(SRCDIR)/include/oldc \
-               -I$(SRCDIR)/include/c \
-               -imacros $(SRCDIR)/include/deputy/nodeputy.h \
-               $(SRCDIR)/tools/arm_molly/molly_boot.S \
-               $(SRCDIR)/tools/arm_molly/molly_init.c \
-               $(SRCDIR)/tools/arm_molly/lib.c \
-               ./panda_mbi_slave.c \
-               $(SRCDIR)/lib/elf/elf32.c \
-               ./molly_panda_slave/* \
-               -o heteropanda_slave
-       @echo "OK - heteropanda slave image is built."
-       @echo "you can now use this image to link into a regular pandaboard image"
-
-
-
-
-#######################################################################
-#
-# Pandaboard build for the heteropanda_master:
-# basically a regular pandaboard_image, except that it contains
-# a heteropanda_slave image, and arm_molly is called with -DHETEROPANDA
-#
-#######################################################################
-
-menu.lst.heteropanda_master: $(SRCDIR)/hake/menu.lst.heteropanda_master
-       cp $< $@
-
-heteropanda_master_image: $(PANDABOARD_MODULES) \
-               tools/bin/arm_molly \
-               menu.lst.heteropanda_master \
-               heteropanda_slave \
-               $(SRCDIR)/tools/arm_molly/molly_ld_script.in
-       # Translate each of the binary files we need
-       $(SRCDIR)/tools/arm_molly/build_data_files.sh menu.lst.heteropanda_master molly_panda
-       # Generate appropriate linker script
-       cpp -P -DBASE_ADDR=0x82001000 $(SRCDIR)/tools/arm_molly/molly_ld_script.in \
-               molly_panda/molly_ld_script
-
-       # HETEROPANDA: convert slave image into a form we can insert in our image
-       $(ARM_OBJCOPY) -I binary -O elf32-littlearm -B arm --rename-section \
-           .data=.rodata_thumb,alloc,load,readonly,data,contents heteropanda_slave \
-           molly_panda/heteropanda_slave
-
-       # Build a C file to link into a single image for the 2nd-stage
-       # bootloader
-       tools/bin/arm_molly menu.lst.heteropanda_master panda_mbi.c
-       # Compile the complete boot image into a single executable
-       $(ARM_GCC) -std=c99 -g -fPIC -pie -Wl,-N -fno-builtin \
-               -nostdlib -march=armv7-a -mcpu=cortex-a9 -mapcs -fno-unwind-tables \
-               -Tmolly_panda/molly_ld_script \
-               -I$(SRCDIR)/include \
-               -I$(SRCDIR)/include/arch/arm \
-               -I./armv7/include \
-               -I$(SRCDIR)/include/oldc \
-               -I$(SRCDIR)/include/c \
-               -imacros $(SRCDIR)/include/deputy/nodeputy.h \
-               $(SRCDIR)/tools/arm_molly/molly_boot.S \
-               $(SRCDIR)/tools/arm_molly/molly_init.c \
-               $(SRCDIR)/tools/arm_molly/lib.c \
-               ./panda_mbi.c \
-               $(SRCDIR)/lib/elf/elf32.c \
-               ./molly_panda/* \
-               -DHETEROPANDA \
-               -o heteropanda_master_image
-       @echo "OK - heteropanda_master_image is built."
-       @echo "If your boot environment is correctly set up, you can now:"
-       @echo "$ usbboot ./heteropanda_master_image"