aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorZach White <skullydazed@gmail.com>2020-12-29 11:42:09 -0800
committerGitHub <noreply@github.com>2020-12-29 19:42:09 +0000
commit5edfdeff50e1741a93dae9154fa413c3a7752d32 (patch)
treec204224ef9c05106431d457b297286290c360c87 /Makefile
parent221d8fd8669ff528bfedd01f41486f5298d960e1 (diff)
downloadqmk_firmware-5edfdeff50e1741a93dae9154fa413c3a7752d32.tar.gz
qmk_firmware-5edfdeff50e1741a93dae9154fa413c3a7752d32.zip
remove some old and unused code from Makefile (#11336)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile73
1 files changed, 3 insertions, 70 deletions
diff --git a/Makefile b/Makefile
index a13b92866..e4f7b5b51 100644
--- a/Makefile
+++ b/Makefile
@@ -68,37 +68,8 @@ PATH_ELEMENTS := $(subst /, ,$(STARTING_DIR))
68# Initialize the path elements list for further processing 68# Initialize the path elements list for further processing
69$(eval $(call NEXT_PATH_ELEMENT)) 69$(eval $(call NEXT_PATH_ELEMENT))
70 70
71# This function sets the KEYBOARD; KEYMAP and SUBPROJECT to the correct
72# variables depending on which directory you stand in.
73# It's really a very simple if else chain, if you squint enough,
74# but the makefile syntax makes it very verbose.
75# If we are in a subfolder of keyboards
76#
77# *** No longer needed **
78#
79# ifeq ($(CURRENT_PATH_ELEMENT),keyboards)
80# $(eval $(call NEXT_PATH_ELEMENT))
81# KEYBOARD := $(CURRENT_PATH_ELEMENT)
82# $(eval $(call NEXT_PATH_ELEMENT))
83# # If we are in a subfolder of keymaps, or in other words in a keymap
84# # folder
85# ifeq ($(CURRENT_PATH_ELEMENT),keymaps)
86# $(eval $(call NEXT_PATH_ELEMENT))
87# KEYMAP := $(CURRENT_PATH_ELEMENT)
88# # else if we are not in the keyboard folder itself
89# else ifneq ($(CURRENT_PATH_ELEMENT),)
90# # the we can assume it's a subproject, as no other folders
91# # should have make files in them
92# SUBPROJECT := $(CURRENT_PATH_ELEMENT)
93# $(eval $(call NEXT_PATH_ELEMENT))
94# # if we are inside a keymap folder of a subproject
95# ifeq ($(CURRENT_PATH_ELEMENT),keymaps)
96# $(eval $(call NEXT_PATH_ELEMENT))
97# KEYMAP := $(CURRENT_PATH_ELEMENT)
98# endif
99# endif
100# endif
101 71
72# Phony targets to enable a few simple make commands outside the main processing below.
102.PHONY: list-keyboards 73.PHONY: list-keyboards
103list-keyboards: 74list-keyboards:
104 util/list_keyboards.sh | sort -u | tr '\n' ' ' 75 util/list_keyboards.sh | sort -u | tr '\n' ' '
@@ -131,7 +102,6 @@ endif
131# Uncomment these for debugging 102# Uncomment these for debugging
132# $(info Keyboard: $(KEYBOARD)) 103# $(info Keyboard: $(KEYBOARD))
133# $(info Keymap: $(KEYMAP)) 104# $(info Keymap: $(KEYMAP))
134# $(info Subproject: $(SUBPROJECT))
135 105
136 106
137# Set the default goal depending on where we are running make from 107# Set the default goal depending on where we are running make from
@@ -189,7 +159,6 @@ endef
189# A recursive helper function for finding the longest match 159# A recursive helper function for finding the longest match
190# $1 The list to be checked 160# $1 The list to be checked
191# It works by always removing the currently matched item from the list 161# It works by always removing the currently matched item from the list
192# and call itself recursively, until a match is found
193define TRY_TO_MATCH_RULE_FROM_LIST_HELPER2 162define TRY_TO_MATCH_RULE_FROM_LIST_HELPER2
194 # Stop the recursion when the list is empty 163 # Stop the recursion when the list is empty
195 ifneq ($1,) 164 ifneq ($1,)
@@ -386,23 +355,6 @@ define PARSE_ALL_KEYBOARDS
386 $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(shell util/list_keyboards.sh noci | sort -u))) 355 $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(shell util/list_keyboards.sh noci | sort -u)))
387endef 356endef
388 357
389# $1 Subproject
390# When entering this, the keyboard and subproject are known, so now we need
391# to determine which keymaps are going to get compiled
392# define PARSE_SUBPROJECT
393
394# endef
395
396# If we want to parse all subprojects, but the keyboard doesn't have any,
397# then use defaultsp instead
398# define PARSE_ALL_SUBPROJECTS
399# ifeq ($$(SUBPROJECTS),)
400# $$(eval $$(call PARSE_SUBPROJECT,defaultsp))
401# else
402# $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$$(SUBPROJECTS)))
403# endif
404# endef
405
406# Prints a list of all known keymaps for the given keyboard 358# Prints a list of all known keymaps for the given keyboard
407define LIST_ALL_KEYMAPS 359define LIST_ALL_KEYMAPS
408 COMMAND_true_LIST_KEYMAPS := \ 360 COMMAND_true_LIST_KEYMAPS := \
@@ -544,12 +496,12 @@ if [ $$error_occurred -gt 0 ]; then $(HANDLE_ERROR); fi;
544 496
545endef 497endef
546 498
547# Let's match everything, we handle all the rule parsing ourselves 499# Catch everything and parse the command line ourselves.
548.PHONY: % 500.PHONY: %
549%: 501%:
550 # Check if we have the CMP tool installed 502 # Check if we have the CMP tool installed
551 cmp $(ROOT_DIR)/Makefile $(ROOT_DIR)/Makefile >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi; 503 cmp $(ROOT_DIR)/Makefile $(ROOT_DIR)/Makefile >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi;
552 # Ensure that bin/qmk works. This will be a failing check after the next develop merge on 2020 Aug 29. 504 # Ensure that bin/qmk works. This will be a failing check after the next develop merge
553 if ! bin/qmk hello 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; fi 505 if ! bin/qmk hello 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; fi
554 # Check if the submodules are dirty, and display a warning if they are 506 # Check if the submodules are dirty, and display a warning if they are
555ifndef SKIP_GIT 507ifndef SKIP_GIT
@@ -580,25 +532,6 @@ endif
580 $(foreach TEST,$(sort $(TESTS)),$(RUN_TEST)) 532 $(foreach TEST,$(sort $(TESTS)),$(RUN_TEST))
581 if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi; 533 if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
582 534
583# These no longer work because of the colon system
584
585# All should compile everything
586# .PHONY: all
587# all: all-keyboards test-all
588
589# Define some shortcuts, mostly for compatibility with the old syntax
590# .PHONY: all-keyboards
591# all-keyboards: all\:all\:all
592
593# .PHONY: all-keyboards-defaults
594# all-keyboards-defaults: all\:default
595
596# .PHONY: test
597# test: test-all
598
599# .PHONY: test-clean
600# test-clean: test-all-clean
601
602lib/%: 535lib/%:
603 git submodule sync $? 536 git submodule sync $?
604 git submodule update --init $? 537 git submodule update --init $?