mirror of
				https://github.com/mfulz/qmk_firmware.git
				synced 2025-10-31 13:22:31 +01:00 
			
		
		
		
	Makefile: Add QMK_VERSION & co to OPT_DEFS (#408)
This adds the keyboard and keymap built, along with the QMK firmware's
git hash (or a timestamp), to OPT_DEFS. That, in turn, allows keymaps to
make use of these information, and do whatever they want with it. For
example, one could print them on `LEADER v` like this:
```c
SEQ_ONE_KEY (KC_V) {
  SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
}
```
This addresses #366.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
			
			
This commit is contained in:
		
							parent
							
								
									fad5a57156
								
							
						
					
					
						commit
						4815b97add
					
				
							
								
								
									
										7
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								Makefile
									
									
									
									
									
								
							| @ -112,4 +112,9 @@ VPATH += $(QUANTUM_PATH)/audio | ||||
| 
 | ||||
| include $(TMK_PATH)/protocol/lufa.mk | ||||
| include $(TMK_PATH)/common.mk | ||||
| include $(TMK_PATH)/rules.mk | ||||
| include $(TMK_PATH)/rules.mk | ||||
| 
 | ||||
| GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d") | ||||
| 
 | ||||
| OPT_DEFS += -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\" | ||||
| OPT_DEFS += -DQMK_VERSION=\"$(GIT_VERSION)\" | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Gergely Nagy
						Gergely Nagy