1 ##########################################################################
2 # Copyright (c) 2009-2014 ETH Zurich.
5 # This file is distributed under the terms in the attached LICENSE file.
6 # If you do not find this file, copies can be found by writing to:
7 # ETH Zurich D-INFK, CAB F.78, Universitaetstr. 6, CH-8092 Zurich,
10 # This file defines symbolic (i.e. non-file) targets for the Makefile
11 # generated by Hake. Edit this to add your own symbolic targets.
13 ##########################################################################
15 # Disable built-in implicit rules. GNU make adds environment's MAKEFLAGS too.
18 # Explicitly disable the flex and bison implicit rules
23 # Set default architecture to the first specified by Hake in generated Makefile.
24 ARCH ?= $(word 1, $(HAKE_ARCHS))
25 ARM_GCC?=arm-linux-gnueabi-gcc
26 ARM_OBJCOPY?=arm-linux-gnueabi-objcopy
27 K1OM_OBJCOPY?=k1om-mpss-linux-objcopy
30 # All binaries of the RCCE LU benchmark
40 # All binaries of the RCCE BT benchmark
67 sbin/arrakis_hellotest \
70 sbin/bomp_cpu_bound_progress \
72 sbin/bomp_sync_progress \
76 sbin/mdbtest_addr_zero \
77 sbin/mdbtest_range_query \
81 sbin/net_openport_test \
92 sbin/tests/xphi_nameservice_test \
104 sbin/tests/dma_test \
105 sbin/tests/xeon_phi_inter \
106 sbin/tests/xeon_phi_test \
107 sbin/tests/xphi_nameservice_test
110 # All benchmark domains
112 sbin/channel_cost_bench \
113 sbin/flounder_stubs_buffer_bench \
114 sbin/flounder_stubs_empty_bench \
115 sbin/flounder_stubs_payload_bench \
119 sbin/multihop_latency_bench \
120 sbin/net_openport_test \
122 sbin/thc_v_flounder_empty \
124 sbin/udp_throughput \
127 sbin/ump_latency_cache \
137 sbin/apicdrift_bench \
138 sbin/benchmarks/bomp_mm \
139 sbin/benchmarks/dma_bench \
140 sbin/benchmarks/xomp_share \
141 sbin/benchmarks/xomp_spawn \
142 sbin/benchmarks/xomp_work \
143 sbin/benchmarks/xphi_ump_bench \
144 sbin/bomp_benchmark_cg \
145 sbin/bomp_benchmark_ft \
146 sbin/bomp_benchmark_is \
147 sbin/bulk_transfer_passthrough \
149 sbin/bulkbench_micro_echo \
150 sbin/bulkbench_micro_rtt \
151 sbin/bulkbench_micro_throughput \
159 sbin/phases_scale_bench \
160 sbin/placement_bench \
162 sbin/shared_mem_clock_bench \
167 sbin/benchmarks/bomp_mm \
168 sbin/benchmarks/dma_bench \
169 sbin/benchmarks/xomp_share \
170 sbin/benchmarks/xomp_spawn \
171 sbin/benchmarks/xomp_work \
172 sbin/benchmarks/xphi_ump_bench \
173 sbin/benchmarks/xphi_xump_bench
176 # Default list of modules to build/install for all enabled architectures
187 # List of modules that are arch-independent and always built
192 # x86_64-specific modules to build by default
193 # this should shrink as targets are ported and move into the generic list above
229 sbin/vnode_map_test \
237 sbin/virtio_blk_host \
240 sbin/block_server_client \
251 # the following are broken in the newidc system
252 MODULES_x86_64_broken= \
259 # x86-32-specific module to build by default
275 sbin/thc_v_flounder_empty \
283 sbin/multihop_latency_bench \
288 # SCC-specific module to build by default
300 sbin/thc_v_flounder_empty \
309 # ARM-specific modules to build by default
314 # XScale-specific modules to build by default
319 # ARMv7-specific modules to build by default
320 # XXX: figure out armv7 default
329 # ARM11MP-specific modules to build by default
334 # construct list of all modules to be built (arch-specific and common for each arch)
335 MODULES=$(foreach a,$(HAKE_ARCHS),$(foreach m,$(MODULES_$(a)),$(a)/$(m)) \
336 $(foreach m,$(MODULES_COMMON),$(a)/$(m))) \
337 $(foreach a,$(HAKE_ARCHS),$(foreach m,$(TESTS_$(a)),$(a)/$(m)) \
338 $(foreach m,$(TESTS_COMMON),$(a)/$(m))) \
339 $(foreach a,$(HAKE_ARCHS),$(foreach m,$(BENCH_$(a)),$(a)/$(m)) \
340 $(foreach m,$(BENCH_COMMON),$(a)/$(m))) \
343 all: $(MODULES) menu.lst
344 @echo "You've just run the default ("all") target for Barrelfish"
345 @echo "using Hake. The following modules have been built:"
347 @echo "If you want to change this target, edit the file called"
348 @echo "'symbolic_targets.mk' in your build directory."
351 # XXX: this should be overridden in some local settings file?
352 INSTALL_PREFIX ?= /home/netos/tftpboot/$(USER)
354 # Only install a binary if it doesn't exist in INSTALL_PREFIX or the modification timestamp differs
357 echo "Installing modules..." ; \
358 for m in ${MODULES}; do \
359 if [ ! -f ${INSTALL_PREFIX}/$$m ] || \
360 [ $$(stat -c%Y $$m) -ne $$(stat -c%Y ${INSTALL_PREFIX}/$$m) ]; then \
362 echo " > Installing $$m" ; \
363 mkdir -p ${INSTALL_PREFIX}/$$(dirname $$m); \
364 install -p $$m ${INSTALL_PREFIX}/$$m; \
367 if [ ! $$do_update ]; then \
368 echo " > All up to date" ; \
377 echo "Installing header files..." ; \
378 for a in ${HAKE_ARCHS}; do \
380 cp -rv "${SRCDIR}/include" "$$a/" ; \
384 .PHONY : install_headers
389 QEMU=unknown-arch-error
390 GDB=unknown-arch-error
394 AHCI=-device ahci,id=ahci -device ide-drive,drive=disk,bus=ahci.0 -drive id=disk,file=$(DISK),if=none
396 MENU_LST=-kernel $(shell sed -rne 's,^kernel[ \t]*/([^ ]*).*,\1,p' menu.lst) \
397 -append '$(shell sed -rne 's,^kernel[ \t]*[^ ]*[ \t]*(.*),\1,p' menu.lst)' \
398 -initrd '$(shell sed -rne 's,^module(nounzip)?[ \t]*/(.*),\2,p' menu.lst | awk '{ if(NR == 1) printf($$0); else printf("," $$0) } END { printf("\n") }')'
400 ifeq ($(ARCH),x86_64)
401 QEMU_CMD=qemu-system-x86_64 -smp 2 -m 1024 -net nic,model=e1000 -net user $(AHCI) -nographic $(MENU_LST)
402 GDB=x86_64-pc-linux-gdb
403 CLEAN_HD=qemu-img create $(DISK) 10M
404 else ifeq ($(ARCH),x86_32)
405 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
407 else ifeq ($(ARCH),scc)
408 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
410 else ifeq ($(ARCH),armv5)
411 ARM_QEMU_CMD=qemu-system-arm -M integratorcp -kernel armv5/sbin/cpu.bin -nographic -no-reboot -m 256 -initrd armv5/romfs.cpio
412 GDB=xterm -e arm-linux-gnueabi-gdb
413 simulate: $(MODULES) armv5/romfs.cpio
417 armv5/tools/debug.arm.gdb: $(SRCDIR)/tools/debug.arm.gdb
420 debugsim: $(MODULES) armv5/romfs.cpio armv5/tools/debug.arm.gdb
421 $(SRCDIR)/tools/debug.sh "$(ARM_QEMU_CMD) -initrd armv5/romfs.cpio" "$(GDB)" "-s $(ARCH)/sbin/cpu -x armv5/tools/debug.arm.gdb $(GDB_ARGS)"
423 else ifeq ($(ARCH),arm11mp)
424 QEMU_CMD=qemu-system-arm -cpu mpcore -M realview -kernel arm11mp/sbin/cpu.bin
425 GDB=arm-linux-gnueabi-gdb
426 else ifeq ($(ARCH), k1om)
427 # what is the emulation option for the xeon phi ?
428 QEMU=unknown-arch-error
429 GDB=x86_64-k1om-barrelfish-gdb
442 $(SRCDIR)/tools/debug.sh "$(QEMU_CMD)" "$(GDB)" "-x $(SRCDIR)/tools/debug.gdb $(GDB_ARGS)" "file:/dev/stdout"
449 $(ARCH)/menu.lst: $(SRCDIR)/hake/menu.lst.$(ARCH)
452 $(ARCH)/romfs.cpio: $(SRCDIR)/tools/arm-mkbootcpio.sh $(MODULES) $(ARCH)/menu.lst
453 $(SRCDIR)/tools/arm-mkbootcpio.sh $(ARCH)/menu.lst $@
455 # Location of hardcoded size of romfs CPIO image
456 arm_romfs_cpio = "$(ARCH)/include/romfs_size.h"
458 # XXX: Horrid hack to hardcode size of romfs CPIO image into ARM kernel
459 # This works in several recursive make steps:
460 # 1. Create a dummy romfs_size.h header file
461 # 2. Compile everything
462 # 3. Create the romfs CPIO image
463 # 4. Determine its size and write to romfs_size.h
464 # 5. Re-compile kernel (but not the romfs) with correct size information
465 # 6. Install romfs to installation location
468 $(MAKE) $(ARCH)/romfs.cpio
469 echo "//Autogenerated size of romfs.cpio because the bootloader cannot calculate it" > $(arm_romfs_cpio)
470 echo "size_t romfs_cpio_archive_size = `ls -asl $(ARCH)/romfs.cpio | sed -e 's/ /\n/g' | head -6 | tail -1`;" >> $(arm_romfs_cpio)
474 # Builds a dummy romfs_size.h
475 $(ARCH)/include/romfs_size.h:
476 mkdir -p $(shell dirname $@)
477 echo "size_t romfs_cpio_archive_size = 0; //should not see this" > $@
482 install -p $(ARCH)/romfs.cpio ${INSTALL_PREFIX}/$(ARCH)/romfs.cpio
485 # Copy the scc-specific menu.lst from the source directory to the build directory
486 menu.lst.scc: $(SRCDIR)/hake/menu.lst.scc
489 scc: all tools/bin/dite menu.lst.scc
490 $(shell find scc/sbin -type f -print0 | xargs -0 strip -d)
491 tools/bin/dite -32 -o bigimage.dat menu.lst.scc
492 cp $(SRCDIR)/tools/scc/bootvector.dat .
493 bin2obj -m $(SRCDIR)/tools/scc/bigimage.map -o barrelfish0.obj
494 bin2obj -m $(SRCDIR)/tools/scc/bootvector.map -o barrelfish1.obj
495 @echo Taking the barrelfish.obj files to SCC host
496 scp barrelfish[01].obj user@tomme1.in.barrelfish.org:
498 # Source indexing targets
500 find $(abspath .) $(abspath $(SRCDIR)) -name '*.[ch]' -type f -print | sort | uniq > $@
503 cscope.out: cscope.files
507 etags - < $< # for emacs
508 cat $< | xargs ctags -o TAGS_VI # for vim
510 # force rebuild of the Makefile
512 ./hake/hake --source-dir $(SRCDIR)
516 $(RM) -r tools $(HAKE_ARCHS)
520 $(RM) hake/*.o hake/*.hi hake/hake Hakefiles.hs cscope.*
525 ./docs/TN-000-Overview.pdf \
526 ./docs/TN-001-Glossary.pdf \
527 ./docs/TN-002-Mackerel.pdf \
528 ./docs/TN-003-Hake.pdf \
529 ./docs/TN-004-VirtualMemory.pdf \
530 ./docs/TN-005-SCC.pdf \
531 ./docs/TN-006-Routing.pdf \
532 ./docs/TN-008-Tracing.pdf \
533 ./docs/TN-009-Notifications.pdf \
534 ./docs/TN-010-Spec.pdf \
535 ./docs/TN-011-IDC.pdf \
536 ./docs/TN-012-Services.pdf \
537 ./docs/TN-013-CapabilityManagement.pdf \
538 ./docs/TN-014-bulk-transfer.pdf \
539 ./docs/TN-015-DiskDriverArchitecture.pdf \
540 ./docs/TN-016-Serial.pdf \
541 ./docs/TN-017-ARM.pdf \
542 ./docs/TN-018-PracticalGuide.pdf \
543 ./docs/TN-019-DeviceDriver.pdf
556 # pretend to be CMake's CONFIGURE_FILE command
557 # TODO: clean this up
558 Doxyfile: $(SRCDIR)/doc/Doxyfile.cmake
559 sed -r 's#@CMAKE_SOURCE_DIR@#$(SRCDIR)#g' $< > $@
561 # Scheduler simulator test cases
563 TESTS = $(addsuffix .txt,$(basename $(wildcard $(SRCDIR)/tools/schedsim/*.cfg)))
565 schedsim-regen: $(TESTS)
567 $(TESTS): %.txt: %.cfg tools/bin/simulator
568 tools/bin/simulator $< $(RUNTIME) > $@
570 schedsim-check: $(wildcard $(SRCDIR)/tools/schedsim/*.cfg)
571 for f in $^; do tools/bin/simulator $$f $(RUNTIME) | diff -q - `dirname $$f`/`basename $$f .cfg`.txt || exit 1; done
573 ######################################################################
575 # Intel Xeon Phi Builds
577 ######################################################################
579 k1om/sbin/weever: k1om/sbin/weever_elf
580 $(K1OM_OBJCOPY) -O binary -R .note -R .comment -S k1om/sbin/weever_elf ./k1om/sbin/weever
584 #######################################################################
588 #######################################################################
591 armv7/sbin/cpu_omap44xx \
593 armv7/sbin/mem_serv \
603 armv7/sbin/sdmatest \
604 armv7/sbin/sdma_bench \
605 armv7/sbin/bulk_sdma \
606 armv7/sbin/usb_manager \
607 armv7/sbin/usb_keyboard \
610 armv7/sbin/corectrl \
613 menu.lst.pandaboard: $(SRCDIR)/hake/menu.lst.pandaboard
616 pandaboard_image: $(PANDABOARD_MODULES) \
617 tools/bin/arm_molly \
619 # Translate each of the binary files we need
620 $(SRCDIR)/tools/arm_molly/build_data_files.sh menu.lst.pandaboard molly_panda
621 # Generate appropriate linker script
622 cpp -P -DBASE_ADDR=0x82001000 $(SRCDIR)/tools/arm_molly/molly_ld_script.in \
623 molly_panda/molly_ld_script
624 # Build a C file to link into a single image for the 2nd-stage
626 tools/bin/arm_molly menu.lst.pandaboard panda_mbi.c
627 # Compile the complete boot image into a single executable
628 $(ARM_GCC) -std=c99 -g -fPIC -pie -Wl,-N -fno-builtin \
629 -nostdlib -march=armv7-a -mapcs -fno-unwind-tables \
630 -Tmolly_panda/molly_ld_script \
631 -I$(SRCDIR)/include \
632 -I$(SRCDIR)/include/arch/arm \
634 -I$(SRCDIR)/include/oldc \
635 -I$(SRCDIR)/include/c \
636 -imacros $(SRCDIR)/include/deputy/nodeputy.h \
637 $(SRCDIR)/tools/arm_molly/molly_boot.S \
638 $(SRCDIR)/tools/arm_molly/molly_init.c \
639 $(SRCDIR)/tools/arm_molly/lib.c \
641 $(SRCDIR)/lib/elf/elf32.c \
644 @echo "OK - pandaboard boot image is built."
645 @echo "If your boot environment is correctly set up, you can now:"
646 @echo "$ usbboot ./pandaboard_image"
648 ########################################################################
652 ########################################################################
654 menu.lst.arm_gem5: $(SRCDIR)/hake/menu.lst.arm_gem5
657 menu.lst.arm_gem5_mc: $(SRCDIR)/hake/menu.lst.arm_gem5_mc
661 armv7/sbin/cpu_arm_gem5 \
663 armv7/sbin/mem_serv \
668 armv7/sbin/corectrl \
673 arm_gem5_image: $(GEM5_MODULES) \
674 tools/bin/arm_molly \
676 # Translate each of the binary files we need
677 $(SRCDIR)/tools/arm_molly/build_data_files.sh menu.lst.arm_gem5_mc molly_gem5
678 # Generate appropriate linker script
679 cpp -P -DBASE_ADDR=0x00100000 $(SRCDIR)/tools/arm_molly/molly_ld_script.in \
680 molly_gem5/molly_ld_script
681 # Build a C file to link into a single image for the 2nd-stage
683 tools/bin/arm_molly menu.lst.arm_gem5_mc arm_mbi.c
684 # Compile the complete boot image into a single executable
685 $(ARM_GCC) -std=c99 -g -fPIC -pie -Wl,-N -fno-builtin \
686 -nostdlib -march=armv7-a -mapcs -fno-unwind-tables \
687 -Tmolly_gem5/molly_ld_script \
688 -I$(SRCDIR)/include \
689 -I$(SRCDIR)/include/arch/arm \
691 -I$(SRCDIR)/include/oldc \
692 -I$(SRCDIR)/include/c \
693 -imacros $(SRCDIR)/include/deputy/nodeputy.h \
694 $(SRCDIR)/tools/arm_molly/molly_boot.S \
695 $(SRCDIR)/tools/arm_molly/molly_init.c \
696 $(SRCDIR)/tools/arm_molly/lib.c \
698 $(SRCDIR)/lib/elf/elf32.c \
702 # ARM GEM5 Simulation Targets
703 ARM_FLAGS=$(SRCDIR)/tools/arm_gem5/gem5script.py --caches --l2cache --n=2 --kernel=arm_gem5_image
705 arm_gem5: arm_gem5_image $(SRCDIR)/tools/arm_gem5/gem5script.py
706 gem5.fast $(ARM_FLAGS)
708 arm_gem5_detailed: arm_gem5_image $(SRCDIR)/tools/arm_gem5/gem5script.py
709 gem5.fast $(ARM_FLAGS) --cpu-type=arm_detailed
711 .PHONY: arm_gem5 arm_gem5_detailed
713 #######################################################################
715 # Pandaboard build for the armv7-M slave image (to be used in conjunction with a master image)
716 # (basically a normal pandaboard_image, but compiled for the cortex-m3)
718 #######################################################################
720 HETEROPANDA_SLAVE_MODULES=\
721 armv7-m/sbin/cpu_omap44xx \
723 armv7-m/sbin/mem_serv \
724 armv7-m/sbin/monitor \
725 armv7-m/sbin/ramfsd \
726 armv7-m/sbin/spawnd \
727 armv7-m/sbin/startd \
731 menu.lst.armv7-m: $(SRCDIR)/hake/menu.lst.armv7-m
734 heteropanda_slave: $(HETEROPANDA_SLAVE_MODULES) \
735 tools/bin/arm_molly \
737 # Translate each of the binary files we need
738 $(SRCDIR)/tools/arm_molly/build_data_files.sh menu.lst.armv7-m molly_panda_slave
739 # Generate appropriate linker script
740 cpp -P -DBASE_ADDR=0x0 $(SRCDIR)/tools/arm_molly/molly_ld_script.in \
741 molly_panda_slave/molly_ld_script
742 # Build a C file to link into a single image for the 2nd-stage
744 tools/bin/arm_molly menu.lst.armv7-m panda_mbi_slave.c
745 # Compile the complete boot image into a single executable
746 $(ARM_GCC) -std=c99 -g -fPIC -pie -Wl,-N -fno-builtin \
747 -nostdlib -march=armv7-m -mcpu=cortex-m3 -mthumb -mapcs -fno-unwind-tables \
748 -Tmolly_panda_slave/molly_ld_script \
749 -I$(SRCDIR)/include \
750 -I$(SRCDIR)/include/arch/arm \
751 -I./armv7-m/include \
752 -I$(SRCDIR)/include/oldc \
753 -I$(SRCDIR)/include/c \
754 -imacros $(SRCDIR)/include/deputy/nodeputy.h \
755 $(SRCDIR)/tools/arm_molly/molly_boot.S \
756 $(SRCDIR)/tools/arm_molly/molly_init.c \
757 $(SRCDIR)/tools/arm_molly/lib.c \
758 ./panda_mbi_slave.c \
759 $(SRCDIR)/lib/elf/elf32.c \
760 ./molly_panda_slave/* \
762 @echo "OK - heteropanda slave image is built."
763 @echo "you can now use this image to link into a regular pandaboard image"
768 #######################################################################
770 # Pandaboard build for the heteropanda_master:
771 # basically a regular pandaboard_image, except that it contains
772 # a heteropanda_slave image, and arm_molly is called with -DHETEROPANDA
774 #######################################################################
776 menu.lst.heteropanda_master: $(SRCDIR)/hake/menu.lst.heteropanda_master
779 heteropanda_master_image: $(PANDABOARD_MODULES) \
780 tools/bin/arm_molly \
781 menu.lst.heteropanda_master \
783 $(SRCDIR)/tools/arm_molly/molly_ld_script.in
784 # Translate each of the binary files we need
785 $(SRCDIR)/tools/arm_molly/build_data_files.sh menu.lst.heteropanda_master molly_panda
786 # Generate appropriate linker script
787 cpp -P -DBASE_ADDR=0x82001000 $(SRCDIR)/tools/arm_molly/molly_ld_script.in \
788 molly_panda/molly_ld_script
790 # HETEROPANDA: convert slave image into a form we can insert in our image
791 $(ARM_OBJCOPY) -I binary -O elf32-littlearm -B arm --rename-section \
792 .data=.rodata_thumb,alloc,load,readonly,data,contents heteropanda_slave \
793 molly_panda/heteropanda_slave
795 # Build a C file to link into a single image for the 2nd-stage
797 tools/bin/arm_molly menu.lst.heteropanda_master panda_mbi.c
798 # Compile the complete boot image into a single executable
799 $(ARM_GCC) -std=c99 -g -fPIC -pie -Wl,-N -fno-builtin \
800 -nostdlib -march=armv7-a -mcpu=cortex-a9 -mapcs -fno-unwind-tables \
801 -Tmolly_panda/molly_ld_script \
802 -I$(SRCDIR)/include \
803 -I$(SRCDIR)/include/arch/arm \
805 -I$(SRCDIR)/include/oldc \
806 -I$(SRCDIR)/include/c \
807 -imacros $(SRCDIR)/include/deputy/nodeputy.h \
808 $(SRCDIR)/tools/arm_molly/molly_boot.S \
809 $(SRCDIR)/tools/arm_molly/molly_init.c \
810 $(SRCDIR)/tools/arm_molly/lib.c \
812 $(SRCDIR)/lib/elf/elf32.c \
815 -o heteropanda_master_image
816 @echo "OK - heteropanda_master_image is built."
817 @echo "If your boot environment is correctly set up, you can now:"
818 @echo "$ usbboot ./heteropanda_master_image"