diff options
-rw-r--r-- | build_keyboard.mk | 5 | ||||
-rw-r--r-- | docs/_summary.md | 1 | ||||
-rw-r--r-- | docs/feature_userspace.md | 33 | ||||
-rw-r--r-- | layouts/community/ergodox/jackhumbert/config.h (renamed from layouts/community/ergodox/jack/config.h) | 0 | ||||
-rw-r--r-- | layouts/community/ergodox/jackhumbert/keymap.c (renamed from layouts/community/ergodox/jack/keymap.c) | 0 | ||||
-rw-r--r-- | users/_example/_example.c | 5 | ||||
-rw-r--r-- | users/_example/_example.h | 8 | ||||
-rw-r--r-- | users/_example/readme.md | 14 | ||||
-rw-r--r-- | users/_example/rules.mk | 1 | ||||
-rw-r--r-- | users/jackhumbert/jackhumbert.c | 1 | ||||
-rw-r--r-- | users/jackhumbert/jackhumbert.h | 6 | ||||
-rw-r--r-- | users/jackhumbert/readme.md | 14 | ||||
-rw-r--r-- | users/jackhumbert/rules.mk | 1 | ||||
-rw-r--r-- | users/readme.md | 3 |
14 files changed, 92 insertions, 0 deletions
diff --git a/build_keyboard.mk b/build_keyboard.mk index 450207850..2c86fe55e 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk | |||
@@ -183,6 +183,10 @@ else | |||
183 | # this state should never be reached | 183 | # this state should never be reached |
184 | endif | 184 | endif |
185 | 185 | ||
186 | # User space stuff | ||
187 | USER_PATH := users/$(KEYMAP) | ||
188 | -include $(USER_PATH)/rules.mk | ||
189 | |||
186 | # Object files directory | 190 | # Object files directory |
187 | # To put object files in current directory, use a dot (.), do NOT make | 191 | # To put object files in current directory, use a dot (.), do NOT make |
188 | # this an empty or blank macro! | 192 | # this an empty or blank macro! |
@@ -204,6 +208,7 @@ SRC += $(KEYBOARD_SRC) \ | |||
204 | VPATH += $(KEYMAP_PATH) | 208 | VPATH += $(KEYMAP_PATH) |
205 | VPATH += $(KEYBOARD_PATHS) | 209 | VPATH += $(KEYBOARD_PATHS) |
206 | VPATH += $(COMMON_VPATH) | 210 | VPATH += $(COMMON_VPATH) |
211 | VPATH += $(USER_PATH) | ||
207 | 212 | ||
208 | include common_features.mk | 213 | include common_features.mk |
209 | include $(TMK_PATH)/protocol.mk | 214 | include $(TMK_PATH)/protocol.mk |
diff --git a/docs/_summary.md b/docs/_summary.md index edbf04c1a..55cfd2ab3 100644 --- a/docs/_summary.md +++ b/docs/_summary.md | |||
@@ -15,6 +15,7 @@ | |||
15 | * [Features](features.md) | 15 | * [Features](features.md) |
16 | * [Layouts](feature_layouts.md) | 16 | * [Layouts](feature_layouts.md) |
17 | * [Common Shortcuts](feature_common_shortcuts.md) | 17 | * [Common Shortcuts](feature_common_shortcuts.md) |
18 | * [Userspace](feature_userspace.md) | ||
18 | * [Backlight](feature_backlight.md) | 19 | * [Backlight](feature_backlight.md) |
19 | * [Bootmagic](feature_bootmagic.md) | 20 | * [Bootmagic](feature_bootmagic.md) |
20 | * [Dynamic Macros](dynamic_macros.md) | 21 | * [Dynamic Macros](dynamic_macros.md) |
diff --git a/docs/feature_userspace.md b/docs/feature_userspace.md new file mode 100644 index 000000000..edc9f6e32 --- /dev/null +++ b/docs/feature_userspace.md | |||
@@ -0,0 +1,33 @@ | |||
1 | # Userspace: sharing code between keymaps | ||
2 | |||
3 | If you use more than one keyboard with a similar keymap, you might see the benefit in being able to share code between them. Create your own folder in `users/` named the same as your keymap (ideally your github username, `<name>`) with the following structure: | ||
4 | |||
5 | * `/users/<name>/` (added to the path automatically) | ||
6 | * `readme.md` | ||
7 | * `rules.mk` (included automatically) | ||
8 | * `<name>.h` (optional) | ||
9 | * `<name>.c` (optional) | ||
10 | |||
11 | `<name>.c` will need to be added to the SRC in `rules.mk` like this: | ||
12 | |||
13 | SRC += <name>.c | ||
14 | |||
15 | Additional files may be added in the same way - it's recommended you have one named `<name>`.c/.h though. | ||
16 | |||
17 | All this only happens when you build a keymap named `<name>`, like this: | ||
18 | |||
19 | make planck:<name> | ||
20 | |||
21 | For example, | ||
22 | |||
23 | make planck:jack | ||
24 | |||
25 | Will include the `/users/jack/` folder in the path, along with `/users/jack/rules.mk`. | ||
26 | |||
27 | ## Readme | ||
28 | |||
29 | Please include authorship (your name, github username, email), and optionally [a license that's GPL compatible](https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses). | ||
30 | |||
31 | ## Example | ||
32 | |||
33 | For a brief example, checkout `/users/_example/` until we have more reasonable and useful examples. \ No newline at end of file | ||
diff --git a/layouts/community/ergodox/jack/config.h b/layouts/community/ergodox/jackhumbert/config.h index 04bbed611..04bbed611 100644 --- a/layouts/community/ergodox/jack/config.h +++ b/layouts/community/ergodox/jackhumbert/config.h | |||
diff --git a/layouts/community/ergodox/jack/keymap.c b/layouts/community/ergodox/jackhumbert/keymap.c index 6a00ffa29..6a00ffa29 100644 --- a/layouts/community/ergodox/jack/keymap.c +++ b/layouts/community/ergodox/jackhumbert/keymap.c | |||
diff --git a/users/_example/_example.c b/users/_example/_example.c new file mode 100644 index 000000000..8e0778b12 --- /dev/null +++ b/users/_example/_example.c | |||
@@ -0,0 +1,5 @@ | |||
1 | #include "_example.h" | ||
2 | |||
3 | void my_custom_function(void) { | ||
4 | |||
5 | } \ No newline at end of file | ||
diff --git a/users/_example/_example.h b/users/_example/_example.h new file mode 100644 index 000000000..f7c799025 --- /dev/null +++ b/users/_example/_example.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef USERSPACE | ||
2 | #define USERSPACE | ||
3 | |||
4 | #include "quantum.h" | ||
5 | |||
6 | void my_custom_function(void); | ||
7 | |||
8 | #endif \ No newline at end of file | ||
diff --git a/users/_example/readme.md b/users/_example/readme.md new file mode 100644 index 000000000..fdea33b67 --- /dev/null +++ b/users/_example/readme.md | |||
@@ -0,0 +1,14 @@ | |||
1 | Copyright <year> <name> <email> @<github_username> | ||
2 | |||
3 | This program is free software: you can redistribute it and/or modify | ||
4 | it under the terms of the GNU General Public License as published by | ||
5 | the Free Software Foundation, either version 2 of the License, or | ||
6 | (at your option) any later version. | ||
7 | |||
8 | This program is distributed in the hope that it will be useful, | ||
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | GNU General Public License for more details. | ||
12 | |||
13 | You should have received a copy of the GNU General Public License | ||
14 | along with this program. If not, see <http://www.gnu.org/licenses/>. \ No newline at end of file | ||
diff --git a/users/_example/rules.mk b/users/_example/rules.mk new file mode 100644 index 000000000..250adc3d0 --- /dev/null +++ b/users/_example/rules.mk | |||
@@ -0,0 +1 @@ | |||
SRC += _example.c \ No newline at end of file | |||
diff --git a/users/jackhumbert/jackhumbert.c b/users/jackhumbert/jackhumbert.c new file mode 100644 index 000000000..011e0efb8 --- /dev/null +++ b/users/jackhumbert/jackhumbert.c | |||
@@ -0,0 +1 @@ | |||
#include "jackhumbert.h" \ No newline at end of file | |||
diff --git a/users/jackhumbert/jackhumbert.h b/users/jackhumbert/jackhumbert.h new file mode 100644 index 000000000..69cfa6745 --- /dev/null +++ b/users/jackhumbert/jackhumbert.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef USERSPACE | ||
2 | #define USERSPACE | ||
3 | |||
4 | #include "quantum.h" | ||
5 | |||
6 | #endif \ No newline at end of file | ||
diff --git a/users/jackhumbert/readme.md b/users/jackhumbert/readme.md new file mode 100644 index 000000000..479a64140 --- /dev/null +++ b/users/jackhumbert/readme.md | |||
@@ -0,0 +1,14 @@ | |||
1 | Copyright 2017 Jack Humbert <jack.humb@gmail.com> @jackhumbert | ||
2 | |||
3 | This program is free software: you can redistribute it and/or modify | ||
4 | it under the terms of the GNU General Public License as published by | ||
5 | the Free Software Foundation, either version 2 of the License, or | ||
6 | (at your option) any later version. | ||
7 | |||
8 | This program is distributed in the hope that it will be useful, | ||
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | GNU General Public License for more details. | ||
12 | |||
13 | You should have received a copy of the GNU General Public License | ||
14 | along with this program. If not, see <http://www.gnu.org/licenses/>. \ No newline at end of file | ||
diff --git a/users/jackhumbert/rules.mk b/users/jackhumbert/rules.mk new file mode 100644 index 000000000..f2981bb78 --- /dev/null +++ b/users/jackhumbert/rules.mk | |||
@@ -0,0 +1 @@ | |||
SRC += jackhumbert.c \ No newline at end of file | |||
diff --git a/users/readme.md b/users/readme.md new file mode 100644 index 000000000..d8f14d8be --- /dev/null +++ b/users/readme.md | |||
@@ -0,0 +1,3 @@ | |||
1 | # User space | ||
2 | |||
3 | This is a place for users to put code that they might use between keyboards. If you build the keymap `mine`, `/users/mine/rules.mk` will be included in your build, and `/users/mine/` will be in your path - keep these things in mind when naming your files and referencing them from other places. \ No newline at end of file | ||