-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathREADME
140 lines (90 loc) · 5.13 KB
/
README
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
README RobotRemCtrlFW
===============================================================================
26.10.2011, [email protected]
Introduction
-------------------------------------------------------------------------------
This project provieds a firmware for STM32 based robots. For more detail see
http://gpio.kaltpost.de/?page_id=527
Requirements
-------------------------------------------------------------------------------
To successfully execute all the targets from this make file project, beside a C cross compiler environment for ARM Cortex-M3, the following packages must be present on your host system:
* astyle (optional)
* cppcheck (optional)
* doxygen (optional)
Directory Layout
-------------------------------------------------------------------------------
The directory and file layout of the project is as follows:
ProjectDir
bin/ executables created from "src/"
deploy/ deployables are placed here
doc/ documentation regarding this project
gen/ source code documentation generated from "src/include"
lib/ libraries ctreated from "src/", used to unit test "src/"
src/ C sources for the project
include/ header files for the project sources in "src/"
test-bin/ executable unit tests created from "test-src"
test-src/ C test sources
include/ header files for the project test sources in "test-src/"
CHANGELOG change log describing project changes for each release
README short introduction and description of this project
doxygen.conf configuration file for doxygen
Makefile top level make file
common.mk make file include commonly used, project independent
project.mk make file include commonly used, project dependent
Default Targets of Top Level Make File
-------------------------------------------------------------------------------
The top level makefile in the project directory is the master make file. It defines a set of default targets, and delegates most of its task to the sub-makefile in "src" and "test-src".
The default make targets are:
target compile and link the executable, place it under "bin/"
target-test compile and link the test executable, place it under "test-bin/"
gen-docs perform "target" first, then generate source code documentation
from "src/include/" under "doc/gen/"
check execute "cppcheck" on all "*.cpp" files unter "src/", print
results to stdout
style enforce basic code styles on cpp/h files in "src/" and
"src/include/", on modifications, the original file is
backed up with extension ".orig"
all perform task "target"
world perform tasks "target", "target-test", "gen-docs"
clean cleanup all objects, executables and backup files
deploy-src perform task "clean", then tar the contetens of the current
directory into <target_name>_sources.tar.bz2 (but exclude
".svn"), and place it into "deploy/" - useful to archive
sources ...
The most common targets will be explained in more detail in the next
paragraphs.
target: Compile the Binary
-------------------------------------------------------------------------------
To compile the example sources located under "src" type:
make
This will produce the binary "hello_world" under "bin". If executed it will
just print a friendly hello.
target-test: Compile the Test-Binary
-------------------------------------------------------------------------------
To compile the test binary sources located under "test-src" type:
make target-test
This will produce the binary under "test-bin".
check: Perform Static Code Checking
-------------------------------------------------------------------------------
For basic static code checking, cppcheck is used. To execute a static code check, you may call:
make check
This will performe the checks on all files located under "src". Static code checks are not performed on the test code located under "test-src" by default. To check the test sources too, uncommented the corresponding line in the top-level makefile.
gen-docs: Generation of Code Documentation
-------------------------------------------------------------------------------
For generating the source code documentation out of the annotations done in the code, we use doxygen. The generation of the HTML based documentation from the sources under "src" is done through:
make gen-docs
The result will be placed in "doc/gen".
Note: For "test-src" no documentation is generated.
style: Apply Code Formating Styles
-------------------------------------------------------------------------------
It is possible to enforce basic code formating styles through astyle by executing the "style" target:
make style
This calls astyle with parameter "--style=stroustrup", resulting in something like this:
int Foo(bool isBar)
{
if (isBar) {
bar();
return 1;
} else
return 0;
}