Project

General

Profile

2) Linux » History » Version 2

krufter_multiclet, 07/08/2013 06:52 PM

1 1 krufter_multiclet
h1. 2) Linux
2 1 krufter_multiclet
3 1 krufter_multiclet
Страница в разработке.
4 1 krufter_multiclet
5 1 krufter_multiclet
6 1 krufter_multiclet
Пример создания makefile:
7 1 krufter_multiclet
8 1 krufter_multiclet
<pre>
9 1 krufter_multiclet
PATH_TO_MULTICLET_INC = /usr/local/include/Multiclet/MCp0411100101/
10 1 krufter_multiclet
PATH_TO_MULTICLET_LIB = /usr/local/lib/Multiclet/MCp0411100101/
11 1 krufter_multiclet
12 1 krufter_multiclet
image = image.bin
13 1 krufter_multiclet
objects = sin_cos_example.o
14 1 krufter_multiclet
15 1 krufter_multiclet
load: $(image)
16 1 krufter_multiclet
	mc-ploader $(image)
17 1 krufter_multiclet
18 1 krufter_multiclet
$(image): $(objects)
19 1 krufter_multiclet
	mc-lcc -target=mcp -Wl-L$(PATH_TO_MULTICLET_LIB) -Wl-lmath -Wl-M -o $(image) $(PATH_TO_MULTICLET_LIB)/crt0.o $(objects)
20 1 krufter_multiclet
	rm *.o
21 1 krufter_multiclet
22 1 krufter_multiclet
sin_cos_example.o: sin_cos_example.c
23 1 krufter_multiclet
	mc-lcc -target=mcp -c -Wp-I$(PATH_TO_MULTICLET_INC) -Wa--arch=MCp0411100101 -o sin_cos_example.o sin_cos_example.c
24 1 krufter_multiclet
25 1 krufter_multiclet
26 1 krufter_multiclet
clean:
27 1 krufter_multiclet
	rm -rf *.o $(image)
28 1 krufter_multiclet
</pre>
29 2 krufter_multiclet
30 2 krufter_multiclet
31 2 krufter_multiclet
Дополнительные библиотеки подключаются аналогично математической:
32 2 krufter_multiclet
33 2 krufter_multiclet
<pre>
34 2 krufter_multiclet
-Wl-lmath -Wl-luart -Wl-li2cmaster -Wl-li2cslave -Wl-lwdt -Wl-lpwm -Wl-lspi -Wl-leth
35 2 krufter_multiclet
</pre>