Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements subprojects and updates projects for this #459

Merged
merged 76 commits into from
Jun 29, 2016
Merged

Conversation

jackhumbert
Copy link
Member

@jackhumbert jackhumbert commented Jun 29, 2016

Subprojects

Subproject folders are located at /keyboards/<keyboard>/<subproject>, and they can be compiled in a couple different ways:

  • /keyboards/<keyboard>/ $ make sub=<subproject> (preferred)
  • / $ make keyboard=<keyboard>/<subproject>
  • /keyboards/<keyboard>/<subproject>/ $ make

Keyboard files

Some modifications to the keyboard files are available:

/keyboards/<keyboard>/Makefile

SUBPROJECT_DEFAULT = <subproject>

can be added to specify a subproject by default. This is not required, but your config.h files should compensation for this.

/keyboards/<keyboard>/config.h

#ifdef SUBPROJECT_<subproject>
    #include "<subproject>/config.h"
#endif

This is required if your keymaps or subprojects have config.hs in them.

/keyboards/<keyboard>/<keyboard>.h

#ifdef SUBPROJECT_<subproject>
    #include "<subproject>.h"
#endif

can be added as a conditional to include the relevant subproject files when necessary.

Subproject files

The basic template for constructing subprojects looks like this:

/keyboards/<keyboard>/<subproject>/config.h

#ifndef <subproject>_CONFIG_H
#define  <subproject>_CONFIG_H

#include "../config.h"

...

#endif

You can use #undef <variable> to override directives here.

/keyboards/<keyboard>/<subproject>/Makefile

...

ifndef QUANTUM_DIR
    include ../../../Makefile
endif

/keyboards/<keyboard>/<subproject>/<subproject>.h

#ifndef <subproject>_H
#define <subproject>_H

#include "../<keyboard>.h"

...

#endif

/keyboards/<keyboard>/<subproject>/<subproject>.c

#include "<subproject>.h"

...

The planck and the clueboard use these by default for revisions.

Travis build script

This script automatically pushes to the qmk.fm repo, and updates all information there. All .hex files are located in that repo, and are generated from these tests.

@jackhumbert jackhumbert merged commit 215c211 into master Jun 29, 2016
@jackhumbert jackhumbert deleted the subprojects branch June 29, 2016 20:21
@fredizzimo
Copy link
Contributor

I'm currently converting the Ergodox to use sub-projects, following the above instructions. Almost all keymaps already compiles for both the Infinity and the EZ, so this far everything is going well.

I think it would be good to add the following to the documentation(once it's properly documented) though
both

#ifdef SUBPROJECT_<subproject>
    #include "<subproject>/config.h"
#endif

and

#ifdef SUBPROJECT_<subproject>
    #include "<subproject>.h"
#endif

Should be at the bottom of the respective keyboard.h or config.h file, as we want to have the following order of parsing. If they are added to the top, then the order will be wrong.

  1. Keyboard
  2. Subproject
  3. Keymap

And the include paths should be set as

  1. Keymap
  2. Subproject
  3. Keyboard

A couple of examples, let's say a keymap has a config file

  1. The include search path will find the keymap config.h file
  2. It includes the keyboard config.h file
  3. The keyboard config.h file is parsed
  4. It includes the subproject config.h file
  5. The include guard stops the keyboard config.h file from getting included again
  6. The subproject config file is parsed
  7. The parser gets to the end of the subproject config file and also the keyboard config file
  8. The keymap config file is finally parsed.

If there's no keymap config file the following will happen

  1. The include search path finds the subproject config file
  2. It includes the keyboard config file
  3. The keyboard config file is parsed
  4. The include guards stops the subproject config file from being included again
  5. The parser continues with the rest of the subproject config file

ryaninvents pushed a commit to ryaninvents/qmk_firmware that referenced this pull request Aug 12, 2016
* non-working commit

* working

* subprojects implemented for planck

* pass a subproject variable through to c

* consolidates clueboard revisions

* thanks for letting me know about conflicts..

* turn off audio for yang's

* corrects starting paths for subprojects

* messing around with travis

* semicolon

* travis script

* travis script

* script for travis

* correct directory (probably), amend files to commit

* remove origin before adding

* git pull, correct syntax

* git checkout

* git pull origin branch

* where are we?

* where are we?

* merging

* force things to happen

* adds commit message, adds add

* rebase, no commit message

* rebase branch

* idk!

* try just pull

* fetch - merge

* specify repo branch

* checkout

* goddammit

* merge? idk

* pls

* after all

* don't split up keyboards

* syntax

* adds quick for all-keyboards

* trying out new script

* script update

* lowercase

* all keyboards

* stop replacing compiled.hex automatically

* adds if statement

* skip automated build branches

* forces push to automated build branch

* throw an add in there

* upstream?

* adds AUTOGEN

* ignore all .hex files again

* testing out new repo

* global ident

* generate script, keyboard_keymap.hex

* skip generation for now, print pandoc info, submodule update

* try trusty

* and sudo

* try generate

* updates subprojects to keyboards

* no idea

* updates to keyboards

* cleans up clueboard stuff

* setup to use local readme

* updates cluepad, planck experimental

* remove extra led.c [ci skip]

* disable power up for now

* config files updates

* makefile updates

* .h file updates, config tuning

* disable audio for yang
BlueTufa pushed a commit to BlueTufa/qmk_firmware that referenced this pull request Aug 6, 2021
* Move GH60 keymaps

A couple of keyboard moves from qmk/qmk_firmware:

- gh60 -> gh60/revc
- satan -> gh60/satan

* Rename Maartenwut keymaps

Maartenwut now has a vendor-level directory in qmk/qmk_firmware.

Rename keymap files as appropriate.

- atom47 (revs. 2 and 3)
- plain60
- wasdat

* Update metadata for Maartenwut keymaps

* Pretty-format Maartenwut keymaps

* Add Maartenwut TA65 default keymap

* Update exclusion list

... because the atom47 is on it.
jiaxin96 pushed a commit to Oh-My-Mechanical-Keyboard/qmk_firmware that referenced this pull request Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants