-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (48 loc) · 1.36 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# What we are building
TARGET = profile.elf
# List of all source files
SRCS = main.c profiler.c
# List of files to exclude from instrumentation
EXCLUDE_FILES = profiler.c
# Set compiler flags
CFLAGS = -g -finstrument-functions
DATETIME := $(shell date '+%Y-%m-%d_%I-%M-%S_%p')
all: clean $(TARGET)
include $(KOS_BASE)/Makefile.rules
clean:
-rm -f $(TARGET) $(OBJS)
-rm -f PROF.CDI
-rm -rf ISO
$(TARGET): $(SRCS)
kos-cc $(CFLAGS) -finstrument-functions-exclude-file-list=$(EXCLUDE_FILES) $^ -o $@ $(DATAOBJS) $(OBJEXTRA)
profileip: $(TARGET)
sudo /opt/toolchains/dc-utils/dc-tool-ip -c "." -t 172.16.0.10 -x $(TARGET)
profileser: $(TARGET)
sudo /opt/toolchains/dc-utils/dc-tool-ser -c "." -t /dev/cu.usbserial-ABSCDWND -b 115200 -x $(TARGET)
dot:
$(KOS_UTILS)/dctrace $(TARGET)
image: dot
dot -Tjpg graph.dot -o graph_$(DATETIME).jpg
run: $(TARGET)
$(KOS_SERIAL_LOADER) $(TARGET)
runip: $(TARGET)
$(KOS_IP_LOADER) $(TARGET)
rei: dist
$(REICAST) PROF.CDI
lxd: dist
$(LXDREAM) PROF.CDI
fly: dist
$(FLYCAST) PROF.CDI
dist: $(target)
$(KOS_STRIP) $(TARGET)
$(KOS_OBJCOPY) -O binary $(TARGET) prog.bin
$(KOS_SCRAMBLE) prog.bin 1ST_READ.BIN
mkdir -p ISO
cp 1ST_READ.BIN ISO
mkisofs -C 0,11702 -V DCTEST -G ${KOS_BASE}/IP.BIN -J -R -l -o PROF.ISO ISO
$(CREATE_CDI) PROF.ISO PROF.CDI
rm -f PROF.ISO
rm -f prog.BIN
rm -f 1ST_READ.BIN
rm -rf ISO
rm $(TARGET)