Bläddra i källkod

naming.md: update documentation for naming

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Brendan Le Foll 10 år sedan
förälder
incheckning
8e11768a51
1 ändrade filer med 14 tillägg och 9 borttagningar
  1. 14
    9
      docs/naming.md

+ 14
- 9
docs/naming.md Visa fil

@@ -2,20 +2,25 @@ Naming a module                         {#naming}
2 2
 ===============
3 3
 
4 4
 UPM attemps to follow a clear naming pattern. Modules should be sensibly named
5
-and then placed in /usr/lib/upm and headers in /usr/include/upm.
5
+and then placed in ${libdir}/upm and headers in ${includedir}/upm, all modules
6
+should be prefixed with libupm-<modulename>. The upm_module_init will
7
+automatically name python UPM modules as pyupm_<modulename> and javascript
8
+modules as jsupm_<modulename>. For example for src/grove/ the library built
9
+will be libupm-grove.so, the python module pyupm_grove and the js module
10
+jsupm_grove.
6 11
 
7
-### Choosing a name
12
+### Choosing a name for a new module
8 13
 
9
-1. Pick a name
10
-2. Use it
14
+1. Pick a name, typically the chip name is the most sensible
15
+2. Use it & stick to it
11 16
 
12 17
 ### Rules for name picking
13 18
 
14
-1. Your lib must belong to namespace UPM
15
-2. Usually picking the name of the chip of your sensor/actuator might make
16
-sense. Other times this does not. Try to pick a generic name so people with a
17
-similar sensor can inherit your class if they only have minor changes.
18
-3. Avoid brand names
19
+1. Your lib must belong to the UPM namespace
20
+2. Usually picking the name of the chip of your sensor/actuator makes sense.
21
+Other times this does not. Try to pick a generic name so people with a similar
22
+sensor can inherit your class if they only have minor changes.
23
+3. Avoid brand names, often your module can be very generic with little effort
19 24
 
20 25
 ### Doubt
21 26