Compare commits

..

27 Commits

Author SHA1 Message Date
92005dee35 using data/mappings for processing 2023-04-07 16:25:51 -04:00
5dd8efc7c0 chibios compiling, layout keymaps 2023-04-06 16:22:14 -04:00
cc22d67b32 some chibios experiments 2023-04-05 18:27:47 -04:00
a1cb005981 storm commit, chibios exp 2023-04-05 12:59:16 -04:00
cfde338998 generate compile_commands.json and configure clangd 2023-04-04 23:39:52 -04:00
4d1ad14596 Merge branch 'cmake-experiments' of https://github.com/qmk/qmk_firmware into cmake-experiments 2023-04-04 20:55:17 -04:00
c34f0e4998 test out compile_flags.txt 2023-04-04 20:55:10 -04:00
94d76a4f9e fix case issues 2023-04-04 16:55:03 -04:00
fe59b4e5d6 load keyboard ui through vscode 2023-04-04 16:26:44 -04:00
7093a41c6c clean-up 2023-04-04 14:19:52 -04:00
c9ca9b9875 one target one target one target 2023-04-04 13:42:50 -04:00
060c15f32b fully compiling with qmk target 2023-04-04 12:46:29 -04:00
6a960cbf05 move to single lib 2023-04-04 12:29:01 -04:00
531c37b256 closer, tasks populating targets 2023-04-04 12:07:58 -04:00
6468360ff1 example tasks 2023-04-03 23:22:59 -04:00
40a3a431ef unknown state 2023-04-03 21:02:40 -04:00
4d999378d0 more absolute keyboard/keymap support 2023-04-03 13:43:40 -04:00
2ebad0d33f basic json validator supporting most used properties. converted some regex to cmake-compatible expressions 2023-04-03 13:19:45 -04:00
d5760d02a6 some relative/abs keymap folder stuff 2023-04-02 23:46:40 -04:00
9ae271c844 capitalization matters on linux 2023-04-02 22:40:34 -04:00
4aea69ba21 start arm stuff, better keyboard folder path management 2023-04-02 16:38:37 -04:00
2031d063b5 split up functions/scripts a bit. downloads avr-gcc 2023-04-02 11:20:49 -04:00
d32724c08f refix windows compiling 2023-04-01 23:39:13 -04:00
26756d05a2 look for make independently, osx compiling 2023-04-01 23:24:46 -04:00
b45dbcd4c1 fix linux compiling 2023-04-01 23:10:44 -04:00
6fe0cd47ca multi folder targets 2023-04-01 22:04:00 -04:00
ca8596e4a8 compiling basic AVR 2023-04-01 18:03:54 -04:00
17229 changed files with 527494 additions and 662589 deletions

View File

@ -1,4 +1,3 @@
CompileFlags:
Add: [-Wno-unknown-attributes, -Wno-maybe-uninitialized, -Wno-unknown-warning-option]
Remove: [-W*, -mcall-prologues]
Compiler: clang
Remove: -mcall-prologues
Add: -nostdinc

4
.github/labeler.yml vendored
View File

@ -40,7 +40,3 @@ translation:
- docs/ru-ru/**/*
CI:
- .github/**/*
dd:
- data/constants/**/*
- data/mappings/**/*
- data/schemas/**/*

View File

@ -19,13 +19,13 @@ on:
jobs:
api_data:
runs-on: ubuntu-latest
container: ghcr.io/qmk/qmk_cli
container: qmkfm/qmk_cli
# protect against those who work in their fork on 'important' branches
if: github.repository == 'qmk/qmk_firmware'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
fetch-depth: 1
persist-credentials: false

View File

@ -4,7 +4,6 @@ permissions:
contents: write
on:
workflow_dispatch:
push:
branches:
- master
@ -27,12 +26,12 @@ jobs:
if: github.repository == 'qmk/qmk_firmware'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Bump version and push tag
uses: anothrNick/github-tag-action@1.66.0
uses: anothrNick/github-tag-action@1.61.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: 'patch'

View File

@ -4,39 +4,34 @@ permissions:
contents: read
on:
push:
branches: [master, develop]
workflow_dispatch:
inputs:
branch:
type: choice
description: 'Branch to build'
options: [master, develop]
concurrency: ci_build-${{ github.event.inputs.branch || github.ref_name }}
schedule:
- cron: '0 0,12 * * *'
jobs:
ci_builds:
if: github.repository == 'qmk/qmk_firmware'
name: "CI Build"
runs-on: self-hosted
timeout-minutes: 1380
if: github.repository == 'qmk/qmk_firmware'
strategy:
fail-fast: false
matrix:
branch: [master, develop]
keymap: [default, via]
container: ghcr.io/qmk/qmk_cli
container: qmkfm/qmk_cli
steps:
- name: Disable safe.directory check
run : git config --global --add safe.directory '*'
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
submodules: recursive
ref: ${{ github.event.inputs.branch || github.ref }}
ref: ${{ matrix.branch }}
- name: Install dependencies
run: pip3 install -r requirements.txt
@ -56,19 +51,10 @@ jobs:
uses: actions/upload-artifact@v3
if: always()
with:
name: artifacts-${{ github.event.inputs.branch || github.ref_name }}-${{ matrix.keymap }}
name: artifacts-${{ matrix.branch }}-${{ matrix.keymap }}
if-no-files-found: ignore
path: |
*.bin
*.hex
*.uf2
.build/failed.*
- name: 'CI Discord Notification'
if: always()
working-directory: util/ci/
env:
DISCORD_WEBHOOK: ${{ secrets.CI_DISCORD_WEBHOOK }}
run: |
python3 -m pip install -r requirements.txt
python3 ./discord-results.py --branch ${{ github.event.inputs.branch || github.ref_name }} --keymap ${{ matrix.keymap }} --url ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

View File

@ -18,13 +18,13 @@ jobs:
test:
runs-on: ubuntu-latest
container: ghcr.io/qmk/qmk_cli
container: qmkfm/qmk_cli
steps:
- name: Disable safe.directory check
run : git config --global --add safe.directory '*'
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
submodules: recursive

View File

@ -15,7 +15,7 @@ jobs:
if: github.repository == 'qmk/qmk_firmware'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
token: ${{ secrets.QMK_BOT_TOKEN }}
fetch-depth: 0

View File

@ -17,13 +17,13 @@ on:
jobs:
generate:
runs-on: ubuntu-latest
container: ghcr.io/qmk/qmk_cli
container: qmkfm/qmk_cli
# protect against those who develop with their fork on master
if: github.repository == 'qmk/qmk_firmware'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
fetch-depth: 1
@ -37,7 +37,7 @@ jobs:
qmk --verbose generate-docs
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4.4.3
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_BRANCH: master

View File

@ -18,10 +18,9 @@ jobs:
matrix:
branch:
- xap
- riot
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
token: ${{ secrets.QMK_BOT_TOKEN }}
fetch-depth: 0

View File

@ -19,13 +19,13 @@ jobs:
lint:
runs-on: ubuntu-latest
container: ghcr.io/qmk/qmk_cli
container: qmkfm/qmk_cli
steps:
- name: Disable safe.directory check
run : git config --global --add safe.directory '*'
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
fetch-depth: 0
@ -35,7 +35,7 @@ jobs:
- name: Get changed files
id: file_changes
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v35
- name: Run qmk formatters
shell: 'bash {0}'

View File

@ -13,13 +13,13 @@ jobs:
lint:
runs-on: ubuntu-latest
container: ghcr.io/qmk/qmk_cli
container: qmkfm/qmk_cli
steps:
- name: Disable safe.directory check
run : git config --global --add safe.directory '*'
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
fetch-depth: 0
@ -47,7 +47,7 @@ jobs:
git config user.email 'hello@qmk.fm'
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v4
if: ${{ github.repository == 'qmk/qmk_firmware'}}
with:
token: ${{ secrets.QMK_BOT_TOKEN }}

View File

@ -12,13 +12,13 @@ jobs:
lint:
runs-on: ubuntu-latest
container: ghcr.io/qmk/qmk_cli
container: qmkfm/qmk_cli
steps:
- name: Disable safe.directory check
run : git config --global --add safe.directory '*'
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
fetch-depth: 0
@ -27,7 +27,7 @@ jobs:
- name: Get changed files
id: file_changes
uses: tj-actions/changed-files@v38
uses: tj-actions/changed-files@v35
- name: Print info
run: |
@ -36,7 +36,6 @@ jobs:
echo '${{ steps.file_changes.outputs.all_changed_files}}'
- name: Run qmk lint
if: always()
shell: 'bash {0}'
run: |
QMK_CHANGES=$(echo -e '${{ steps.file_changes.outputs.all_changed_files}}' | sed 's/ /\n/g')
@ -73,32 +72,3 @@ jobs:
exit 255
fi
exit $exit_code
- name: Verify at most one added keyboard
if: always()
shell: 'bash {0}'
run: |
git reset --hard
git clean -xfd
# Get the keyboard list and count for the target branch
git checkout -f ${{ github.base_ref }}
git pull --ff-only
QMK_KEYBOARDS_BASE=$(qmk list-keyboards)
QMK_KEYBOARDS_BASE_COUNT=$(qmk list-keyboards | wc -l)
# Get the keyboard list and count for the PR
git checkout -f ${{ github.head_ref }}
git merge --no-commit --squash ${{ github.base_ref }}
QMK_KEYBOARDS_PR=$(qmk list-keyboards)
QMK_KEYBOARDS_PR_COUNT=$(qmk list-keyboards | wc -l)
echo "::group::Keyboards changes in this PR"
diff -d -U 0 <(echo "$QMK_KEYBOARDS_BASE") <(echo "$QMK_KEYBOARDS_PR") | grep -vE '^(---|\+\+\+|@@)' | sed -e 's@^-@Removed: @g' -e 's@^+@ Added: @g'
echo "::endgroup::"
if [[ $QMK_KEYBOARDS_PR_COUNT -gt $(($QMK_KEYBOARDS_BASE_COUNT + 1)) ]]; then
echo "More than one keyboard added in this PR -- see the PR Checklist."
echo "::error::More than one keyboard added in this PR -- see the PR Checklist."
exit 1
fi

View File

@ -13,13 +13,13 @@ jobs:
regen:
runs-on: ubuntu-latest
container: ghcr.io/qmk/qmk_cli
container: qmkfm/qmk_cli
steps:
- name: Disable safe.directory check
run : git config --global --add safe.directory '*'
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: Run qmk generators
run: |

View File

@ -13,13 +13,13 @@ jobs:
regen:
runs-on: ubuntu-latest
container: ghcr.io/qmk/qmk_cli
container: qmkfm/qmk_cli
steps:
- name: Disable safe.directory check
run : git config --global --add safe.directory '*'
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: Run qmk generators
run: |
@ -34,7 +34,7 @@ jobs:
git config user.email 'hello@qmk.fm'
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v4
if: ${{ github.repository == 'qmk/qmk_firmware'}}
with:
token: ${{ secrets.QMK_BOT_TOKEN }}

View File

@ -23,10 +23,10 @@ jobs:
test:
runs-on: ubuntu-latest
container: ghcr.io/qmk/qmk_cli
container: qmkfm/qmk_cli
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install dependencies

10
.gitignore vendored
View File

@ -30,9 +30,6 @@ quantum/version.h
*.qmk
*.uf2
# DD config at wrong location
/keyboards/**/keymaps/*/info.json
# Old-style QMK Makefiles
/keyboards/**/Makefile
@ -48,15 +45,19 @@ quantum/version.h
.idea/
.project
.settings/
.vagrant/
# ?
.dep
.history/
build/
cmake-build-debug
CMakeLists.txt
# CMakeLists.txt
*.pdf
# cmake toolchain downloads
/toolchains
# Let these ones be user specific, since we have so many different configurations
*.code-workspace
.stfolder
@ -95,7 +96,6 @@ secrets.tar
# Python things
__pycache__
.python-version
.venv
# Prerequisites for updating ChibiOS
/util/fmpp*

9
.vscode/cmake-kits.json vendored Normal file
View File

@ -0,0 +1,9 @@
[
{
"name": "AVR GCC",
"compilers": {
"CC": "C:\\QMK_MSYS\\mingw64\\bin\\avr-gcc.exe",
"CXX": "C:\\QMK_MSYS\\mingw64\\bin\\avr-g++.exe"
}
}
]

View File

@ -3,7 +3,7 @@
"recommendations": [
"EditorConfig.EditorConfig",
"xaver.clang-format",
"llvm-vs-code-extensions.vscode-clangd",
"ms-vscode.cpptools",
"bierner.github-markdown-preview",
"donjayamanne.git-extension-pack"
]

11
.vscode/settings.json vendored
View File

@ -5,8 +5,8 @@
// Configure glob patterns for excluding files and folders.
"files.exclude": {
"**/.build": true,
"**/*.hex": true,
"**/*.bin": true,
// "**/*.hex": true,
// "**/*.bin": true,
"**/*.uf2": true
},
"files.associations": {
@ -26,9 +26,6 @@
},
"python.formatting.provider": "yapf",
"[json]": {
"editor.formatOnSave": false
},
"clangd.arguments": [
"--header-insertion=never"
]
"editor.formatOnSave": false
}
}

114
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,114 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Load Keyboard",
"dependsOrder": "sequence",
"dependsOn":[
"Only Load Keyboard",
"Configure CMake"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Only Load Keyboard",
"type": "shell",
"command": "cmake -D QMK_KEYBOARD_FOLDER=\"${input:all_keyboards}\" -D QMK_KEYMAP_FOLDER=\"${input:keyboard_keymap}\" -P ${workspaceFolder}/cmake/ConfigureKeyboard.cmake",
"problemMatcher": []
},
{
"label": "Configure CMake",
"type": "cmake",
"command": "configure"
},
{
"label": "Build",
"problemMatcher": [
{
"base": "$gcc",
"fileLocation": ["relative", "${workspaceFolder}/build"]
},
],
"options": {
"environment": {
"CLICOLOR_FORCE": "1"
}
},
"type": "cmake",
"command": "build",
"targets":[
"${input:keyboard_target}"
],
"group": {
"kind": "build",
"isDefault": true
},
},
// {
// "label": "Rebuild",
// "problemMatcher": [
// {
// "base": "$gcc",
// "fileLocation": ["relative", "${workspaceFolder}/build"]
// },
// ],
// "options": {
// "environment": {
// "CLICOLOR_FORCE": "1"
// }
// },
// "type": "cmake",
// "command": "cleanRebuild",
// "targets":[
// "${input:keyboard_target}"
// ],
// "group": {
// "kind": "build",
// "isDefault": true
// },
// }
],
"inputs": [
{
"id": "keyboard_target",
"type": "command",
"command": "shellCommand.execute",
"args": {
"command": "type build\\targets",
"description": "Target:",
"fieldSeparator": "|"
},
},
{
"id": "all_keyboards",
"type": "command",
"command": "shellCommand.execute",
"args": {
"command": "type build\\all_keyboards",
"description": "Keyboard:",
"default": ""
},
},
{
"id": "keymap",
"description": "Keymap:",
"type": "pickString",
"options":[
"default"
]
},
{
"id": "keyboard_keymap",
"type": "command",
"command": "shellCommand.execute",
"args": {
"command": "cmake -D QMK_KEYBOARD_FOLDER=\"${input:all_keyboards}\" -P ${workspaceFolder}/cmake/GetKeymaps.cmake && type build\\keyboard_keymaps",
"description": "Keymap:",
"default": ""
},
},
]
}

97
CMakeLists.txt Normal file
View File

@ -0,0 +1,97 @@
cmake_minimum_required(VERSION 3.20)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(UpdateSubmodule)
include(ResolveKeyboard)
include(ValidateJson)
include(ProcessKeyboard)
set(QMK_KEYBOARDS_FOLDER "${CMAKE_SOURCE_DIR}/keyboards")
function(_get_all_cmake_targets out_var current_dir)
get_property(targets DIRECTORY ${current_dir} PROPERTY BUILDSYSTEM_TARGETS)
get_property(subdirs DIRECTORY ${current_dir} PROPERTY SUBDIRECTORIES)
foreach(subdir ${subdirs})
_get_all_cmake_targets(subdir_targets ${subdir})
list(APPEND targets ${subdir_targets})
endforeach()
set(${out_var} ${targets} PARENT_SCOPE)
endfunction()
if(NOT DEFINED QMK_KEYBOARD)
# configure step - populate targets
project(qmk_firmware)
add_subdirectory(keyboards)
else()
# build step
if(NOT DEFINED QMK_KEYMAP_FOLDER)
set(QMK_KEYMAP_FOLDER "default")
endif()
resolve_keyboard(${QMK_KEYBOARD_FOLDER} QMK_KEYBOARD_FOLDER_ABS)
cmake_path(IS_PREFIX QMK_KEYBOARDS_FOLDER "${QMK_KEYBOARD_FOLDER_ABS}" IS_KEYBOARDS_FOLDER)
resolve_config_h(${QMK_KEYBOARD_FOLDER_ABS} QMK_KEYBOARD_CONFIG_H)
process_keyboard()
resolve_keyboard_h(${QMK_KEYBOARD_FOLDER_ABS} QMK_KEYBOARD_H)
resolve_keymap_c(${QMK_KEYBOARD_FOLDER_ABS} ${QMK_KEYMAP_FOLDER} QMK_KEYMAP_C)
message(STATUS "config.h: ${QMK_KEYBOARD_CONFIG_H}")
message(STATUS "keyboard.h: ${QMK_KEYBOARD_H}")
message(STATUS "keymap.c: ${QMK_KEYMAP_C}")
project(${QMK_KEYBOARD}
LANGUAGES C CXX ASM
HOMEPAGE_URL ${URL}
VERSION ${DEVICE_VER})
# add_compile_options(
# -include ${QMK_KEYBOARD_CONFIG_H}
# )
add_compile_definitions(
QMK_KEYBOARD_H="${QMK_KEYBOARD_H}"
KEYBOARD_${QMK_KEYBOARD}
KEYMAP_C="${QMK_KEYMAP_C}"
MATRIX_ROWS=8
MATRIX_COLS=6
)
if(DEFINED DIODE_DIRECTION)
add_compile_definitions(DIODE_DIRECTION=${DIODE_DIRECTION})
endif()
include_directories(${CMAKE_SOURCE_DIR})
# if(EXISTS ${QMK_KEYBOARD_FOLDER_ABS}/CMakeLists.txt)
# add_subdirectory(${QMK_KEYBOARD_FOLDER_ABS})
# else()
file(GLOB KEYBOARD_SRC "${QMK_KEYBOARD_FOLDER_ABS}/*.c")
list(REMOVE_ITEM KEYBOARD_SRC "${QMK_KEYMAP_C}")
add_qmk_executable(${TARGET_NAME} ${KEYBOARD_SRC})
# endif()
# add_library(qmk)
target_precompile_headers(qmk PUBLIC
${QMK_KEYBOARD_CONFIG_H}
)
resolve_keyboard_includes(${QMK_KEYBOARD_FOLDER_ABS})
add_subdirectory(quantum)
add_subdirectory(platforms)
add_subdirectory(tmk_core/protocol)
include(features/oled)
include(features/backlight)
include(features/eeprom)
include(features/matrix)
include(features/fnv)
endif()

6
Dockerfile Normal file
View File

@ -0,0 +1,6 @@
FROM qmkfm/qmk_cli
VOLUME /qmk_firmware
WORKDIR /qmk_firmware
CMD qmk compile -kb all -km default

View File

@ -328,7 +328,7 @@ define PARSE_TEST
ifeq ($$(TEST_NAME),all)
MATCHED_TESTS := $$(TEST_LIST)
else
MATCHED_TESTS := $$(foreach TEST, $$(TEST_LIST),$$(if $$(findstring x$$(TEST_NAME)x, x$$(notdir $$(TEST))x), $$(TEST),))
MATCHED_TESTS := $$(foreach TEST, $$(TEST_LIST),$$(if $$(findstring $$(TEST_NAME), $$(notdir $$(TEST))), $$(TEST),))
endif
$$(foreach TEST,$$(MATCHED_TESTS),$$(eval $$(call BUILD_TEST,$$(TEST),$$(TEST_TARGET))))
endef

95
Vagrantfile vendored Normal file
View File

@ -0,0 +1,95 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
# define a name instead of just 'default'
config.vm.define "qmk_firmware"
# VMware/Virtualbox ( and also Hyperv/Parallels) 64 bit
config.vm.box = "generic/debian10"
config.vm.synced_folder '.', '/vagrant'
# This section allows you to customize the Virtualbox VM
# settings, ie showing the GUI or upping the memory
# or cores if desired
config.vm.provider "virtualbox" do |vb|
# Hide the VirtualBox GUI when booting the machine
vb.gui = false
# Uncomment the below lines if you want to program
# your Teensy via the VM rather than your host OS
#vb.customize ['modifyvm', :id, '--usb', 'on']
#vb.customize ['usbfilter', 'add', '0',
# '--target', :id,
# '--name', 'teensy',
# '--vendorid', '0x16c0',
# '--productid','0x0478'
# ]
# Customize the amount of memory on the VM:
vb.memory = "512"
# Uncomment the below lines if you have time sync
# issues with make and incremental builds
#vb.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 1000 ]
end
# This section allows you to customize the VMware VM
# settings, ie showing the GUI or upping the memory
# or cores if desired
config.vm.provider "vmware_workstation" do |vmw|
# Hide the VMware GUI when booting the machine
vmw.gui = false
# Customize the amount of memory on the VM:
vmw.memory = "512"
end
config.vm.provider "vmware_fusion" do |vmf|
# Hide the vmfare GUI when booting the machine
vmf.gui = false
# Customize the amount of memory on the VM:
vmf.memory = "512"
end
# Docker provider pulls from hub.docker.com respecting docker.image if
# config.vm.box is nil. In this case, we adhoc build util/vagrant/Dockerfile.
# Note that this bind-mounts from the current dir to
# /vagrant in the guest, so unless your UID is 1000 to match vagrant in the
# image, you'll need to: chmod -R a+rw .
config.vm.provider "docker" do |docker, override|
override.vm.box = nil
docker.build_dir = "util/vagrant"
docker.has_ssh = true
end
# Unless we are running the docker container directly
# 1. run container detached on vm
# 2. attach on 'vagrant ssh'
["virtualbox", "vmware_workstation", "vmware_fusion"].each do |type|
config.vm.provider type do |virt, override|
override.vm.provision "docker" do |d|
d.run "qmkfm/qmk_cli",
cmd: "tail -f /dev/null",
args: "--privileged -v /dev:/dev -v '/vagrant:/vagrant'"
end
override.vm.provision "shell", inline: <<-SHELL
echo 'docker restart qmkfm-qmk_cli && exec docker exec -it qmkfm-qmk_cli /bin/bash -l' >> ~vagrant/.bashrc
SHELL
end
end
config.vm.post_up_message = <<-EOT
Log into the environment using 'vagrant ssh'. QMK directory synchronized with
host is located at /vagrant
To compile the .hex files use make command inside this directory, e.g.
cd /vagrant
make <keyboard>:default
Examples:
make planck/rev4:default:dfu
make planck/rev4:default
EOT
end

View File

@ -17,6 +17,7 @@ $(TEST)_INC := \
tests/test_common/common_config.h
$(TEST)_SRC := \
$(TMK_COMMON_SRC) \
$(QUANTUM_SRC) \
$(SRC) \
$(QUANTUM_PATH)/keymap_introspection.c \
@ -30,7 +31,7 @@ $(TEST)_SRC := \
tests/test_common/test_logger.cpp \
$(patsubst $(ROOTDIR)/%,%,$(wildcard $(TEST_PATH)/*.cpp))
$(TEST)_DEFS := $(OPT_DEFS) "-DKEYMAP_C=\"keymap.c\""
$(TEST)_DEFS := $(TMK_COMMON_DEFS) $(OPT_DEFS) "-DKEYMAP_C=\"keymap.c\""
$(TEST)_CONFIG := $(TEST_PATH)/config.h

View File

@ -27,6 +27,7 @@ QMK_BIN ?= qmk
# Set the filename for the final firmware binary
KEYBOARD_FILESAFE := $(subst /,_,$(KEYBOARD))
TARGET ?= $(KEYBOARD_FILESAFE)_$(KEYMAP)
KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD_FILESAFE)
ifeq ($(strip $(DUMP_CI_METADATA)),yes)
$(info CI Metadata: KEYBOARD=$(KEYBOARD))
@ -43,7 +44,7 @@ endif
# Object files and generated keymap directory
# To put object files in current directory, use a dot (.), do NOT make
# this an empty or blank macro!
INTERMEDIATE_OUTPUT := $(BUILD_DIR)/obj_$(TARGET)
KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET)
ifdef SKIP_VERSION
OPT_DEFS += -DSKIP_VERSION
@ -59,7 +60,7 @@ VERSION_H_FLAGS += --skip-git
endif
# Generate the board's version.h file.
$(shell $(QMK_BIN) generate-version-h $(VERSION_H_FLAGS) -q -o $(INTERMEDIATE_OUTPUT)/src/version.h)
$(shell $(QMK_BIN) generate-version-h $(VERSION_H_FLAGS) -q -o $(KEYMAP_OUTPUT)/src/version.h)
# Determine which subfolders exist.
KEYBOARD_FOLDER_PATH_1 := $(KEYBOARD)
@ -120,7 +121,7 @@ MAIN_KEYMAP_PATH_4 := $(KEYBOARD_PATH_4)/keymaps/$(KEYMAP)
MAIN_KEYMAP_PATH_5 := $(KEYBOARD_PATH_5)/keymaps/$(KEYMAP)
# Pull in rules from info.json
INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard $(KEYBOARD) --output $(INTERMEDIATE_OUTPUT)/src/info_rules.mk)
INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/info_rules.mk)
include $(INFO_RULES_MK)
# Check for keymap.json first, so we can regenerate keymap.c
@ -160,28 +161,28 @@ endif
# Have we found a keymap.json?
ifneq ("$(wildcard $(KEYMAP_JSON))", "")
KEYMAP_C := $(INTERMEDIATE_OUTPUT)/src/keymap.c
KEYMAP_H := $(INTERMEDIATE_OUTPUT)/src/config.h
KEYMAP_C := $(KEYMAP_OUTPUT)/src/keymap.c
KEYMAP_H := $(KEYMAP_OUTPUT)/src/config.h
# Load the keymap-level rules.mk if exists
-include $(KEYMAP_PATH)/rules.mk
# Load any rules.mk content from keymap.json
INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --output $(INTERMEDIATE_OUTPUT)/src/rules.mk $(KEYMAP_JSON))
INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --output $(KEYMAP_OUTPUT)/src/rules.mk $(KEYMAP_JSON))
include $(INFO_RULES_MK)
# Add rules to generate the keymap files - indentation here is important
$(INTERMEDIATE_OUTPUT)/src/keymap.c: $(KEYMAP_JSON)
$(KEYMAP_OUTPUT)/src/keymap.c: $(KEYMAP_JSON)
@$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
$(eval CMD=$(QMK_BIN) json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON))
@$(BUILD_CMD)
$(INTERMEDIATE_OUTPUT)/src/config.h: $(KEYMAP_JSON)
$(KEYMAP_OUTPUT)/src/config.h: $(KEYMAP_JSON)
@$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
$(eval CMD=$(QMK_BIN) generate-config-h --quiet --output $(KEYMAP_H) $(KEYMAP_JSON))
@$(BUILD_CMD)
generated-files: $(INTERMEDIATE_OUTPUT)/src/config.h $(INTERMEDIATE_OUTPUT)/src/keymap.c
generated-files: $(KEYMAP_OUTPUT)/src/config.h $(KEYMAP_OUTPUT)/src/keymap.c
endif
@ -322,34 +323,25 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_5)/info.json)","")
INFO_JSON_FILES += $(KEYBOARD_PATH_5)/info.json
endif
CONFIG_H += $(INTERMEDIATE_OUTPUT)/src/info_config.h
KEYBOARD_SRC += $(INTERMEDIATE_OUTPUT)/src/default_keyboard.c
CONFIG_H += $(KEYBOARD_OUTPUT)/src/info_config.h
KEYBOARD_SRC += $(KEYBOARD_OUTPUT)/src/default_keyboard.c
$(INTERMEDIATE_OUTPUT)/src/info_config.h: $(INFO_JSON_FILES)
$(KEYBOARD_OUTPUT)/src/info_config.h: $(INFO_JSON_FILES)
@$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
$(eval CMD=$(QMK_BIN) generate-config-h --quiet --keyboard $(KEYBOARD) --output $(INTERMEDIATE_OUTPUT)/src/info_config.h)
$(eval CMD=$(QMK_BIN) generate-config-h --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/info_config.h)
@$(BUILD_CMD)
$(INTERMEDIATE_OUTPUT)/src/default_keyboard.c: $(INFO_JSON_FILES)
$(KEYBOARD_OUTPUT)/src/default_keyboard.c: $(INFO_JSON_FILES)
@$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
$(eval CMD=$(QMK_BIN) generate-keyboard-c --quiet --keyboard $(KEYBOARD) --output $(INTERMEDIATE_OUTPUT)/src/default_keyboard.c)
$(eval CMD=$(QMK_BIN) generate-keyboard-c --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/default_keyboard.c)
@$(BUILD_CMD)
$(INTERMEDIATE_OUTPUT)/src/default_keyboard.h: $(INFO_JSON_FILES)
$(KEYBOARD_OUTPUT)/src/default_keyboard.h: $(INFO_JSON_FILES)
@$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
$(eval CMD=$(QMK_BIN) generate-keyboard-h --quiet --keyboard $(KEYBOARD) --include $(FOUND_KEYBOARD_H) --output $(INTERMEDIATE_OUTPUT)/src/default_keyboard.h)
$(eval CMD=$(QMK_BIN) generate-keyboard-h --quiet --keyboard $(KEYBOARD) --include $(FOUND_KEYBOARD_H) --output $(KEYBOARD_OUTPUT)/src/default_keyboard.h)
@$(BUILD_CMD)
generated-files: $(INTERMEDIATE_OUTPUT)/src/info_config.h $(INTERMEDIATE_OUTPUT)/src/default_keyboard.c $(INTERMEDIATE_OUTPUT)/src/default_keyboard.h
generated-files: $(INTERMEDIATE_OUTPUT)/src/info_deps.d
$(INTERMEDIATE_OUTPUT)/src/info_deps.d:
@$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
$(eval CMD=$(QMK_BIN) generate-make-dependencies -kb $(KEYBOARD) -km $(KEYMAP) -o $(INTERMEDIATE_OUTPUT)/src/info_deps.d)
@$(BUILD_CMD)
-include $(INTERMEDIATE_OUTPUT)/src/info_deps.d
generated-files: $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/default_keyboard.c $(KEYBOARD_OUTPUT)/src/default_keyboard.h
.INTERMEDIATE : generated-files
@ -422,7 +414,8 @@ VPATH += $(KEYMAP_PATH)
VPATH += $(USER_PATH)
VPATH += $(KEYBOARD_PATHS)
VPATH += $(COMMON_VPATH)
VPATH += $(INTERMEDIATE_OUTPUT)/src
VPATH += $(KEYBOARD_OUTPUT)/src
VPATH += $(KEYMAP_OUTPUT)/src
include $(BUILDDEFS_PATH)/common_features.mk
include $(BUILDDEFS_PATH)/generic_features.mk
@ -431,17 +424,19 @@ include $(PLATFORM_PATH)/common.mk
SRC += $(patsubst %.c,%.clib,$(LIB_SRC))
SRC += $(patsubst %.c,%.clib,$(QUANTUM_LIB_SRC))
SRC += $(TMK_COMMON_SRC)
OPT_DEFS += $(TMK_COMMON_DEFS)
EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS)
-include $(PLATFORM_PATH)/$(PLATFORM_KEY)/bootloader.mk
include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk
-include $(PLATFORM_PATH)/$(PLATFORM_KEY)/flash.mk
ifneq ($(strip $(PROTOCOL)),)
PROTOCOL_KEY = $(strip $(shell echo $(PROTOCOL) | tr '[:upper:]' '[:lower:]'))
include $(TMK_PATH)/protocol/$(strip $(shell echo $(PROTOCOL) | tr '[:upper:]' '[:lower:]')).mk
else
PROTOCOL_KEY = $(PLATFORM_KEY)
include $(TMK_PATH)/protocol/$(PLATFORM_KEY).mk
endif
include $(TMK_PATH)/protocol/$(PROTOCOL_KEY)/$(PROTOCOL_KEY).mk
# Setup definitions based on the selected MCU
$(eval $(call add_qmk_prefix_defs,MCU_ORIG,MCU))
@ -451,14 +446,6 @@ $(eval $(call add_qmk_prefix_defs,MCU_FAMILY,MCU_FAMILY))
$(eval $(call add_qmk_prefix_defs,MCU_SERIES,MCU_SERIES))
$(eval $(call add_qmk_prefix_defs,BOARD,BOARD))
# Control whether intermediate file listings are generated
# e.g.:
# make handwired/onekey/blackpill_f411:default KEEP_INTERMEDIATES=yes
# cat .build/obj_handwired_onekey_blackpill_f411_default/quantum/quantum.i | sed -e 's@^#.*@@g' -e 's@^\s*//.*@@g' -e '/^\s*$/d' | clang-format
ifeq ($(strip $(KEEP_INTERMEDIATES)), yes)
OPT_DEFS += -save-temps=obj
endif
# TODO: remove this bodge?
PROJECT_DEFS := $(OPT_DEFS)
PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYBOARD_PATHS)
@ -467,14 +454,17 @@ PROJECT_CONFIG := $(CONFIG_H)
CONFIG_H += $(POST_CONFIG_H)
ALL_CONFIGS := $(PROJECT_CONFIG) $(CONFIG_H)
OUTPUTS := $(INTERMEDIATE_OUTPUT)
$(INTERMEDIATE_OUTPUT)_SRC := $(SRC) $(PLATFORM_SRC)
$(INTERMEDIATE_OUTPUT)_DEFS := $(OPT_DEFS) \
-DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(INTERMEDIATE_OUTPUT)/src/default_keyboard.h\" \
-DQMK_KEYMAP=\"$(KEYMAP)\" -DQMK_KEYMAP_H=\"$(KEYMAP).h\" -DQMK_KEYMAP_CONFIG_H=\"$(KEYMAP_PATH)/config.h\" \
$(PROJECT_DEFS)
$(INTERMEDIATE_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS) $(PROJECT_INC)
$(INTERMEDIATE_OUTPUT)_CONFIG := $(CONFIG_H) $(PROJECT_CONFIG)
OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
$(KEYMAP_OUTPUT)_SRC := $(SRC)
$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) \
-DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(KEYBOARD_OUTPUT)/src/default_keyboard.h\" \
-DQMK_KEYMAP=\"$(KEYMAP)\" -DQMK_KEYMAP_H=\"$(KEYMAP).h\" -DQMK_KEYMAP_CONFIG_H=\"$(KEYMAP_PATH)/config.h\"
$(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS)
$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H)
$(KEYBOARD_OUTPUT)_SRC := $(PLATFORM_SRC)
$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS)
$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC)
$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
# Default target.
all: build check-size

View File

@ -75,10 +75,6 @@ $(TEST)_SRC += \
tests/test_common/main.cpp \
$(QUANTUM_PATH)/logging/print.c
ifneq ($(strip $(INTROSPECTION_KEYMAP_C)),)
$(TEST)_DEFS += -DINTROSPECTION_KEYMAP_C=\"$(strip $(INTROSPECTION_KEYMAP_C))\"
endif
$(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC)
$(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC)
$(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS)

File diff suppressed because it is too large Load Diff

View File

@ -152,7 +152,6 @@ endif
# To produce a UF2 file in your build, add to your keyboard's rules.mk:
# FIRMWARE_FORMAT = uf2
UF2CONV = $(TOP_DIR)/util/uf2conv.py
UF2CONV_ARGS ?=
UF2_FAMILY ?= 0x0
# Compiler flags to generate dependency files.
@ -176,7 +175,7 @@ MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@)
# For a ChibiOS build, ensure that the board files have the hook overrides injected
define BOARDSRC_INJECT_HOOKS
$(INTERMEDIATE_OUTPUT)/$(patsubst %.c,%.o,$(patsubst ./%,%,$1)): INIT_HOOK_CFLAGS += -include $(TOP_DIR)/tmk_core/protocol/chibios/init_hooks.h
$(KEYBOARD_OUTPUT)/$(patsubst %.c,%.o,$(patsubst ./%,%,$1)): INIT_HOOK_CFLAGS += -include $(TOP_DIR)/tmk_core/protocol/chibios/init_hooks.h
endef
$(foreach LOBJ, $(BOARDSRC), $(eval $(call BOARDSRC_INJECT_HOOKS,$(LOBJ))))
@ -220,7 +219,7 @@ gccversion :
@$(BUILD_CMD)
%.uf2: %.elf
$(eval CMD=$(HEX) $< $(BUILD_DIR)/$(TARGET).tmp && $(UF2CONV) $(UF2CONV_ARGS) $(BUILD_DIR)/$(TARGET).tmp --output $@ --convert --family $(UF2_FAMILY) >/dev/null 2>&1)
$(eval CMD=$(HEX) $< $(BUILD_DIR)/$(TARGET).tmp && $(UF2CONV) $(BUILD_DIR)/$(TARGET).tmp --output $@ --convert --family $(UF2_FAMILY) >/dev/null 2>&1)
#@$(SILENT) || printf "$(MSG_EXECUTING) '$(CMD)':\n"
@$(SILENT) || printf "$(MSG_UF2) $@" | $(AWK_CMD)
@$(BUILD_CMD)
@ -392,8 +391,6 @@ check-size:
if [ $(MAX_SIZE) -gt 0 ] && [ $(CURRENT_SIZE) -gt 0 ]; then \
$(SILENT) || printf "$(MSG_CHECK_FILESIZE)" | $(AWK_CMD); \
if [ $(CURRENT_SIZE) -gt $(MAX_SIZE) ]; then \
$(REMOVE) $(TARGET).$(FIRMWARE_FORMAT); \
$(REMOVE) $(BUILD_DIR)/$(TARGET).{hex,bin,uf2}; \
printf "\n * $(MSG_FILE_TOO_BIG)"; $(PRINT_ERROR_PLAIN); \
else \
if [ $(FREE_SIZE) -lt $(SIZE_MARGIN) ]; then \

View File

@ -7,12 +7,7 @@ endif
# TODO: opt in rather than assume everything uses a pro micro
PIN_COMPATIBLE ?= promicro
# Remove whitespace from any rule.mk provided vars
# - env cannot be overwritten but cannot have whitespace anyway
CONVERT_TO:=$(strip $(CONVERT_TO))
ifneq ($(CONVERT_TO),)
# stash so we can overwrite env provided vars if needed
ACTIVE_CONVERTER=$(CONVERT_TO)
@ -28,13 +23,13 @@ ifneq ($(CONVERT_TO),)
TARGET := $(TARGET)_$(CONVERT_TO)
# Configure any defaults
OPT_DEFS += -DCONVERT_TO_$(shell echo $(CONVERT_TO) | tr '[:lower:]' '[:upper:]')
OPT_DEFS += -DCONVERTER_TARGET=\"$(CONVERT_TO)\"
OPT_DEFS += -DCONVERT_TO_$(strip $(shell echo $(CONVERT_TO) | tr '[:lower:]' '[:upper:]'))
OPT_DEFS += -DCONVERTER_TARGET=\"$(strip $(CONVERT_TO))\"
OPT_DEFS += -DCONVERTER_ENABLED
VPATH += $(CONVERTER)
# Configure for "alias" - worst case it produces an idential define
OPT_DEFS += -DCONVERT_TO_$(shell echo $(ACTIVE_CONVERTER) | tr '[:lower:]' '[:upper:]')
OPT_DEFS += -DCONVERT_TO_$(strip $(shell echo $(ACTIVE_CONVERTER) | tr '[:lower:]' '[:upper:]'))
# Finally run any converter specific logic
include $(CONVERTER)/converter.mk

Some files were not shown because too many files have changed in this diff Show More