WORKS
Dependencies: MAX44000 PWM_Tone_Library nexpaq_mdk
Fork of LED_Demo by
mbd_os/docs/ignoring_files_from_build.md@9:6bb35cef007d, 2016-10-22 (annotated)
- Committer:
- cyberjoey
- Date:
- Sat Oct 22 01:31:58 2016 +0000
- Revision:
- 9:6bb35cef007d
- Parent:
- 1:55a6170b404f
WORKING
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nexpaq | 1:55a6170b404f | 1 | # Ignoring files from mbed build |
nexpaq | 1:55a6170b404f | 2 | |
nexpaq | 1:55a6170b404f | 3 | The `.mbedignore` file allows you to ignore files and directories from being processed by `mbed build` command. |
nexpaq | 1:55a6170b404f | 4 | |
nexpaq | 1:55a6170b404f | 5 | ## Usage |
nexpaq | 1:55a6170b404f | 6 | You can place the `.mbedignore` file in any directory where `mbed build` command is going to search for source files. |
nexpaq | 1:55a6170b404f | 7 | |
nexpaq | 1:55a6170b404f | 8 | The most convenient place is the root directory of the library or application. However, this is not a requirement. |
nexpaq | 1:55a6170b404f | 9 | |
nexpaq | 1:55a6170b404f | 10 | Avoid defining rules that would cross the library boundaries as those would lead to side effects or build problems that are hard to find. |
nexpaq | 1:55a6170b404f | 11 | |
nexpaq | 1:55a6170b404f | 12 | ## Syntax |
nexpaq | 1:55a6170b404f | 13 | |
nexpaq | 1:55a6170b404f | 14 | Each line in the `.mbedignore` file is a file pattern used for matching files. Each matched file or directory is ignored from build. |
nexpaq | 1:55a6170b404f | 15 | |
nexpaq | 1:55a6170b404f | 16 | The following wildcards are accepted: |
nexpaq | 1:55a6170b404f | 17 | |
nexpaq | 1:55a6170b404f | 18 | |Pattern | Meaning| |
nexpaq | 1:55a6170b404f | 19 | |--------|--------| |
nexpaq | 1:55a6170b404f | 20 | | `*` | Matches everything. | |
nexpaq | 1:55a6170b404f | 21 | | `?` | Matches any single character. | |
nexpaq | 1:55a6170b404f | 22 | | `[seq]` | Matches any character in seq. | |
nexpaq | 1:55a6170b404f | 23 | | `[!seq]` | Matches any character not in seq. | |
nexpaq | 1:55a6170b404f | 24 | |
nexpaq | 1:55a6170b404f | 25 | File is parsed with Python's [fnmatch](https://docs.python.org/2/library/fnmatch.html) functionality so the syntax follows basic shell patterns with the following exceptions: |
nexpaq | 1:55a6170b404f | 26 | |
nexpaq | 1:55a6170b404f | 27 | 1. Each line is internally prefixed with the path of the `.mbedignore` file. |
nexpaq | 1:55a6170b404f | 28 | 2. Line cannot start with `.` or `/` (because of rule 1) |
nexpaq | 1:55a6170b404f | 29 | |
nexpaq | 1:55a6170b404f | 30 | Globbing functionality is not used, so you cannot recursively match specific file pattern. You need to define rule per directory in that case. |
nexpaq | 1:55a6170b404f | 31 | |
nexpaq | 1:55a6170b404f | 32 | Relative paths can be used, so you can match files deeper in the build tree. However, avoid crossing library boundaries. |
nexpaq | 1:55a6170b404f | 33 | |
nexpaq | 1:55a6170b404f | 34 | ### Example |
nexpaq | 1:55a6170b404f | 35 | A file located in `source/obsolete/.mbedignore` with following content: |
nexpaq | 1:55a6170b404f | 36 | |
nexpaq | 1:55a6170b404f | 37 | ``` |
nexpaq | 1:55a6170b404f | 38 | *.c |
nexpaq | 1:55a6170b404f | 39 | *.h |
nexpaq | 1:55a6170b404f | 40 | second_level/*.c |
nexpaq | 1:55a6170b404f | 41 | ``` |
nexpaq | 1:55a6170b404f | 42 | |
nexpaq | 1:55a6170b404f | 43 | After applying the rule 1, actual patterns used internally for matching the source files are: |
nexpaq | 1:55a6170b404f | 44 | |
nexpaq | 1:55a6170b404f | 45 | ``` |
nexpaq | 1:55a6170b404f | 46 | source/obsolete/*.c |
nexpaq | 1:55a6170b404f | 47 | source/obsolete/*.h |
nexpaq | 1:55a6170b404f | 48 | source/obsolete/second_level/*.c |
nexpaq | 1:55a6170b404f | 49 | ``` |