source: branches/v4/platforms/tsarv4_mono_mmu_ioc/Makefile @ 637

Last change on this file since 637 was 637, checked in by porquet, 10 years ago

add the possibility to specify args for execution (gdb and trace)

File size: 1.7 KB
RevLine 
[637]1# where is soclib?
2SOCLIB_DIR=$(shell soclib-cc --getpath)
3
4# name definitions
[410]5SOCLIB_DESC=desc.py
6SOCLIB_TOP=top.cpp
7SIMULATOR_BINARY=system.x
[637]8SIMULATOR_CMD=./$(SIMULATOR_BINARY) --nobanner
[410]9
[637]10# extra arguments for compilation
11#SOCLIB_CC_ARGS=-v
12SOCLIB_CC_ARGS+=-b common:mips32
[410]13
[637]14# extra arguments for execution
15# gdb
16# F: start the simulation in a frozen state so it can be attached with a gdb client
17# X: disable automatic break whenever an exception is caught, the exception handler will be called transparently
18# S: make the simulation stop and wait for a gdb attachment whenever an exception is caught
19# C: dump a trace of every inter-functions branch
20# T: exit the simulator on trap exception
21# Z: same as C but display only function's entrypoint
22# W: disable automatic break whenever a watchpoint is hit, just report it on stderr (watchpoints can be defined using SOCLIB_GDB_WATCH)
23SIMULATOR_GDB=
24ifeq ("$(origin GDB)", "command line")
25ifeq ($(GDB), 1)
26        SIMULATOR_GDB=SOCLIB_GDB=FCX
27else
28        SIMULATOR_GDB=SOCLIB_GDB=$(GDB)
29endif
30endif
31# trace
32SIMULATOR_TRACE=
33ifeq ("$(origin TRACE)", "command line")
34        SIMULATOR_TRACE=--trace $(TRACE)
35endif
[419]36
[637]37# recipes
[410]38all: $(SIMULATOR_BINARY)
39
40$(SIMULATOR_BINARY): $(SOCLIB_DESC) $(SOCLIB_TOP)
41        soclib-cc $(SOCLIB_CC_ARGS) -P -p $(SOCLIB_DESC) -o $(SIMULATOR_BINARY)
42
[420]43run_tsar_boot: all tsar_boot.bin disk.img
[637]44        $(SIMULATOR_GDB) $(SIMULATOR_CMD) --rom tsar_boot.bin --dsk disk.img $(SIMULATOR_TRACE)
[420]45
46run_dummy_boot: all vmlinux disk.img
[637]47        $(SIMULATOR_GDB) $(SIMULATOR_CMD) --rom vmlinux --dsk disk.img --dummy-boot $(SIMULATOR_TRACE)
[420]48
[419]49cscope.out:
50        soclib-cc -p $(SOCLIB_DESC) --tags
51
[410]52clean:
53        soclib-cc -P -p $(SOCLIB_DESC) -x -o $(SIMULATOR_BINARY)
54        rm -f $(SIMULATOR_BINARY) *.o vci*
55
56.PHONY: $(SIMULATOR_BINARY)
Note: See TracBrowser for help on using the repository browser.