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

Make arguments redo, subproject elimination #1784

Merged
merged 36 commits into from Oct 14, 2017

Conversation

Projects
None yet
2 participants
@jackhumbert
Member

jackhumbert commented Oct 1, 2017

This reflects the changes discussed in #1710 - please direct comments on the concept to that issue, and use this PR for ones about the implementation.


Make arguments

Rather than using - to separate rules in QMK, we're now using :, so a basic build command will look like this:

make planck:default
make planck:default:dfu

In addition, subprojects no longer exist, and revisions/folder organisations are now referenced with their path, like this:

make planck/rev4:default

There can be up to 5 folders of depth this way (not including keyboards/), allowing for quite a lot of organisation within projects.

Upon compliation, folders/keymaps are combined with _, keeping the planck_rev4_default.hex filename format.

rules.mk

If a rules.mk file exists in a keyboard folder, it's assumed to be a project folder that can be compiled, otherwise it's just an organisational folder (e.g. converter, handwired). Default revisions can be set via the rules.mk:

DEFAULT_FOLDER = project/revision

The full path minus keyboards/ is needed here. For example, this is found in keyboards/planck/rules.mk:

DEFAULT_FOLDER = planck/rev4

This allows make planck:default to default to the planck/rev4 revision, but can be overrided with make planck/rev3:default.

Each level's rules.mk file is included, from most broad to most specific, e.g.:

  1. planck/rules.mk
  2. planck/rev4/rules.mk

config.h

Each level's config.h is included if it exists, from most broad to most specific, e.g.:

  1. planck/config.h
  2. planck/rev4/config.h
  3. planck/keymaps/<keymap>/config.h

Each config.h file should now use this line at the top, rather than including files in other directories:

#include "config_common.h"

Be sure to use a different #ifdef CONFIG_H line for each file, or things won't be included correctly. Some examples:

#ifdef PLANCK_CONFIG_H
#define PLANCK_CONFIG_H

#endif

#ifdef PLANCK_REV4_CONFIG_H
#define PLANCK_REV4_CONFIG_H

#endif

Paths

All folder levels are added to the path.

folder.c

All <folder>.c files are now included automatically if they exist. e.g.:

keyboards/planck/planck.c
keyboards/planck/rev4/rev4.c

are both added.

folder.h

Each folder level's <folder>.h file should be including the parent's <folder>.h, and in some instances, it should include their children's as well - the easiest way to do this with a conditional is like this in the folder1.h file:

#ifdef KEYBOARD_folder1_folder2
  #include "folder2.h"
#endif

For example, /keyboards/planck/planck.h has this:

#ifdef KEYBOARD_planck_rev4
  #include "rev4.h"
#endif

Keymaps

Keymaps can exist at any level, but are only available if that folder is in the project path, for example, /keyboards/planck/keymaps and /keyboards/planck/rev4/keymaps are accessible to both planck/rev4 and planck (because planck/rev4 is the default folder), but only /keyboards/planck/keymaps is accessible to planck/rev3.

Generally, keymaps should exist in the broadest folder available.

Layouts

Layouts are included automatically and can be added to any rules.mk file, e.g.:

LAYOUTS = ortho_4x12

Chibios

bootloader_defs.h and the boards directory (and necessary files) can exist at any folder level, and are included automatically. Your board's board.mk will need to use $(BOARD_PATH) in the path, e.g.:

BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F303XC/board.c
BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F303XC

jackhumbert added some commits Oct 13, 2017

@jackhumbert jackhumbert changed the title from [WIP] Make arguments redo to Make arguments redo, subproject elimination Oct 14, 2017

@jackhumbert jackhumbert merged commit 800ec55 into master Oct 14, 2017

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details

@jackhumbert jackhumbert deleted the make_args_redo branch Oct 14, 2017

@jackhumbert

This comment has been minimized.

Show comment
Hide comment
@jackhumbert

jackhumbert Oct 14, 2017

Member

This failed the check, but only because it ran out of time :/

Member

jackhumbert commented Oct 14, 2017

This failed the check, but only because it ran out of time :/

@jackhumbert jackhumbert added the core label Oct 15, 2017

sini pushed a commit to sini/qmk_firmware that referenced this pull request Oct 16, 2017

Make arguments redo, subproject elimination (qmk#1784)
* redo make args to use colons, better folder structuring system [skip ci]

* don't put spaces after statements - hard lessons in makefile development

* fix-up some other rules.mk

* give travis a chance

* reset KEYMAPS variable

* start converting keyboards to new system

* try making all with travis

* redo make args to use colons, better folder structuring system [skip ci]

* don't put spaces after statements - hard lessons in makefile development

* fix-up some other rules.mk

* give travis a chance

* reset KEYMAPS variable

* start converting keyboards to new system

* try making all with travis

* start to update readmes and keyboards

* look in keyboard directories for board.mk

* update visualizer rules

* fix up some other keyboards/keymaps

* fix arm board ld includes

* fix board rules

* fix up remaining keyboards

* reset layout variable

* reset keyboard_layouts

* fix remainging keymaps/boards

* update readmes, docs

* add note to makefile error

* update readmes

* remove planck keymap warnings

* update references and docs

* test out tarvis build stages

* don't use stages for now

* don't use stages for now

BalzGuenat added a commit to BalzGuenat/qmk_firmware that referenced this pull request Nov 8, 2017

revert some structure changes to bring in line with qmk#1784.
Also attempt to get the BLE thing more properly integrated.
Also also fix led_set() to call led_set_kb().

jackhumbert added a commit that referenced this pull request Nov 8, 2017

restructure converters (#1825)
* restructure converters

each converter is its own keyboard and different hardware variants are different subprojects.

remove (seemingly) old method of loading layouts from main Makefile

* call led_set_kb() from overridden led_set()

* put converter back into one folder

* revert some structure changes to bring in line with #1784.

Also attempt to get the BLE thing more properly integrated.
Also also fix led_set() to call led_set_kb().
@BalzGuenat

This comment has been minimized.

Show comment
Hide comment
@BalzGuenat

BalzGuenat Nov 13, 2017

Contributor

The original comment here has some good information that I couldn't find in the current docs. I think the comment could be copied pretty much as-is to a page in the docs.

Contributor

BalzGuenat commented Nov 13, 2017

The original comment here has some good information that I couldn't find in the current docs. I think the comment could be copied pretty much as-is to a page in the docs.

@jackhumbert

This comment has been minimized.

Show comment
Hide comment
@jackhumbert

jackhumbert Nov 13, 2017

Member

It was copied here - I think the docs could definitely use more info, but we're trying to put transitional information like this on qmk.fm instead of in the docs - they're also an rss feed of those sort of changes there.

Member

jackhumbert commented Nov 13, 2017

It was copied here - I think the docs could definitely use more info, but we're trying to put transitional information like this on qmk.fm instead of in the docs - they're also an rss feed of those sort of changes there.

@BalzGuenat

This comment has been minimized.

Show comment
Hide comment
@BalzGuenat

BalzGuenat Nov 13, 2017

Contributor

Hm... I don't know about your plans for the future but how is that info transitional? Are you planning on further changing the structure and/or process?

Contributor

BalzGuenat commented Nov 13, 2017

Hm... I don't know about your plans for the future but how is that info transitional? Are you planning on further changing the structure and/or process?

@jackhumbert

This comment has been minimized.

Show comment
Hide comment
@jackhumbert

jackhumbert Nov 13, 2017

Member

It was written for those that were familiar with QMK and needed to convert projects over to the new system - most of the info applies to those unfamiliar/newcomers as well.

Member

jackhumbert commented Nov 13, 2017

It was written for those that were familiar with QMK and needed to convert projects over to the new system - most of the info applies to those unfamiliar/newcomers as well.

ErinCall added a commit to ErinCall/qmk_firmware that referenced this pull request Nov 26, 2017

jackhumbert added a commit that referenced this pull request Nov 26, 2017

kgwong added a commit to kgwong/qmk_firmware that referenced this pull request Nov 26, 2017

restructure converters (qmk#1825)
* restructure converters

each converter is its own keyboard and different hardware variants are different subprojects.

remove (seemingly) old method of loading layouts from main Makefile

* call led_set_kb() from overridden led_set()

* put converter back into one folder

* revert some structure changes to bring in line with qmk#1784.

Also attempt to get the BLE thing more properly integrated.
Also also fix led_set() to call led_set_kb().

kgwong added a commit to kgwong/qmk_firmware that referenced this pull request Nov 26, 2017

mkende added a commit to mkende/qmk_firmware that referenced this pull request Nov 29, 2017

behcet added a commit to behcet/qmk_firmware that referenced this pull request Dec 16, 2017

Make arguments redo, subproject elimination (qmk#1784)
* redo make args to use colons, better folder structuring system [skip ci]

* don't put spaces after statements - hard lessons in makefile development

* fix-up some other rules.mk

* give travis a chance

* reset KEYMAPS variable

* start converting keyboards to new system

* try making all with travis

* redo make args to use colons, better folder structuring system [skip ci]

* don't put spaces after statements - hard lessons in makefile development

* fix-up some other rules.mk

* give travis a chance

* reset KEYMAPS variable

* start converting keyboards to new system

* try making all with travis

* start to update readmes and keyboards

* look in keyboard directories for board.mk

* update visualizer rules

* fix up some other keyboards/keymaps

* fix arm board ld includes

* fix board rules

* fix up remaining keyboards

* reset layout variable

* reset keyboard_layouts

* fix remainging keymaps/boards

* update readmes, docs

* add note to makefile error

* update readmes

* remove planck keymap warnings

* update references and docs

* test out tarvis build stages

* don't use stages for now

* don't use stages for now

behcet added a commit to behcet/qmk_firmware that referenced this pull request Dec 16, 2017

restructure converters (qmk#1825)
* restructure converters

each converter is its own keyboard and different hardware variants are different subprojects.

remove (seemingly) old method of loading layouts from main Makefile

* call led_set_kb() from overridden led_set()

* put converter back into one folder

* revert some structure changes to bring in line with qmk#1784.

Also attempt to get the BLE thing more properly integrated.
Also also fix led_set() to call led_set_kb().

behcet added a commit to behcet/qmk_firmware that referenced this pull request Dec 16, 2017

jrolfs added a commit to jrolfs/qmk that referenced this pull request Dec 30, 2017

sini pushed a commit to sini/qmk_firmware that referenced this pull request Jan 25, 2018

restructure converters (qmk#1825)
* restructure converters

each converter is its own keyboard and different hardware variants are different subprojects.

remove (seemingly) old method of loading layouts from main Makefile

* call led_set_kb() from overridden led_set()

* put converter back into one folder

* revert some structure changes to bring in line with qmk#1784.

Also attempt to get the BLE thing more properly integrated.
Also also fix led_set() to call led_set_kb().

sini pushed a commit to sini/qmk_firmware that referenced this pull request Jan 25, 2018

y9v added a commit to y9v/qmk_firmware that referenced this pull request Feb 15, 2018

restructure converters (qmk#1825)
* restructure converters

each converter is its own keyboard and different hardware variants are different subprojects.

remove (seemingly) old method of loading layouts from main Makefile

* call led_set_kb() from overridden led_set()

* put converter back into one folder

* revert some structure changes to bring in line with qmk#1784.

Also attempt to get the BLE thing more properly integrated.
Also also fix led_set() to call led_set_kb().

y9v added a commit to y9v/qmk_firmware that referenced this pull request Feb 15, 2018

LovesTha pushed a commit to LovesTha/qmk_firmware that referenced this pull request Jul 24, 2018

Make arguments redo, subproject elimination (qmk#1784)
* redo make args to use colons, better folder structuring system [skip ci]

* don't put spaces after statements - hard lessons in makefile development

* fix-up some other rules.mk

* give travis a chance

* reset KEYMAPS variable

* start converting keyboards to new system

* try making all with travis

* redo make args to use colons, better folder structuring system [skip ci]

* don't put spaces after statements - hard lessons in makefile development

* fix-up some other rules.mk

* give travis a chance

* reset KEYMAPS variable

* start converting keyboards to new system

* try making all with travis

* start to update readmes and keyboards

* look in keyboard directories for board.mk

* update visualizer rules

* fix up some other keyboards/keymaps

* fix arm board ld includes

* fix board rules

* fix up remaining keyboards

* reset layout variable

* reset keyboard_layouts

* fix remainging keymaps/boards

* update readmes, docs

* add note to makefile error

* update readmes

* remove planck keymap warnings

* update references and docs

* test out tarvis build stages

* don't use stages for now

* don't use stages for now

LovesTha pushed a commit to LovesTha/qmk_firmware that referenced this pull request Jul 24, 2018

restructure converters (qmk#1825)
* restructure converters

each converter is its own keyboard and different hardware variants are different subprojects.

remove (seemingly) old method of loading layouts from main Makefile

* call led_set_kb() from overridden led_set()

* put converter back into one folder

* revert some structure changes to bring in line with qmk#1784.

Also attempt to get the BLE thing more properly integrated.
Also also fix led_set() to call led_set_kb().

LovesTha pushed a commit to LovesTha/qmk_firmware that referenced this pull request Jul 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment