Output specific include paths
This commit is contained in:
		
							parent
							
								
									3aac4e95c9
								
							
						
					
					
						commit
						33fbd3be36
					
				
					 2 changed files with 22 additions and 27 deletions
				
			
		| 
						 | 
					@ -43,8 +43,22 @@ ifneq ($(SUBPROJECT),)
 | 
				
			||||||
    endif
 | 
					    endif
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Save the defs here, so we don't include any keymap specific ones 
 | 
					# We can assume a ChibiOS target When MCU_FAMILY is defined, since it's not used for LUFA
 | 
				
			||||||
 | 
					ifdef MCU_FAMILY
 | 
				
			||||||
 | 
						PLATFORM=CHIBIOS
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
						PLATFORM=AVR
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ifeq ($(PLATFORM),CHIBIOS)
 | 
				
			||||||
 | 
						include $(TMK_PATH)/protocol/chibios.mk
 | 
				
			||||||
 | 
						include $(TMK_PATH)/chibios.mk
 | 
				
			||||||
 | 
						OPT_OS = chibios
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Save the defines and includes here, so we don't include any keymap specific ones 
 | 
				
			||||||
PROJECT_DEFS := $(OPT_DEFS)
 | 
					PROJECT_DEFS := $(OPT_DEFS)
 | 
				
			||||||
 | 
					PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(SUBPROJECT_PATH) $(KEYBOARD_PATH)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
MAIN_KEYMAP_PATH := $(KEYBOARD_PATH)/keymaps/$(KEYMAP)
 | 
					MAIN_KEYMAP_PATH := $(KEYBOARD_PATH)/keymaps/$(KEYMAP)
 | 
				
			||||||
MAIN_KEYMAP_C := $(MAIN_KEYMAP_PATH)/keymap.c
 | 
					MAIN_KEYMAP_C := $(MAIN_KEYMAP_PATH)/keymap.c
 | 
				
			||||||
| 
						 | 
					@ -72,19 +86,6 @@ else
 | 
				
			||||||
	KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD)
 | 
						KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD)
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# We can assume a ChibiOS target When MCU_FAMILY is defined, since it's not used for LUFA
 | 
					 | 
				
			||||||
ifdef MCU_FAMILY
 | 
					 | 
				
			||||||
	PLATFORM=CHIBIOS
 | 
					 | 
				
			||||||
else
 | 
					 | 
				
			||||||
	PLATFORM=AVR
 | 
					 | 
				
			||||||
endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ifeq ($(PLATFORM),CHIBIOS)
 | 
					 | 
				
			||||||
	include $(TMK_PATH)/protocol/chibios.mk
 | 
					 | 
				
			||||||
	include $(TMK_PATH)/chibios.mk
 | 
					 | 
				
			||||||
	OPT_OS = chibios
 | 
					 | 
				
			||||||
endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Object files directory
 | 
					# Object files directory
 | 
				
			||||||
#     To put object files in current directory, use a dot (.), do NOT make
 | 
					#     To put object files in current directory, use a dot (.), do NOT make
 | 
				
			||||||
#     this an empty or blank macro!
 | 
					#     this an empty or blank macro!
 | 
				
			||||||
| 
						 | 
					@ -190,8 +191,10 @@ endif
 | 
				
			||||||
OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
 | 
					OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
 | 
				
			||||||
$(KEYMAP_OUTPUT)_SRC := $(SRC)
 | 
					$(KEYMAP_OUTPUT)_SRC := $(SRC)
 | 
				
			||||||
$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\" 
 | 
					$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\" 
 | 
				
			||||||
 | 
					$(KEYMAP_OUTPUT)_INC := $(EXTRAINCDIRS) $(VPATH)
 | 
				
			||||||
$(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC)
 | 
					$(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC)
 | 
				
			||||||
$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS)
 | 
					$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS)
 | 
				
			||||||
 | 
					$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
include $(TMK_PATH)/rules.mk
 | 
					include $(TMK_PATH)/rules.mk
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -49,13 +49,6 @@ OPT = s
 | 
				
			||||||
AUTOGEN ?= false
 | 
					AUTOGEN ?= false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# List any extra directories to look for include files here.
 | 
					 | 
				
			||||||
#     Each directory must be seperated by a space.
 | 
					 | 
				
			||||||
#     Use forward slashes for directory separators.
 | 
					 | 
				
			||||||
#     For a directory that has spaces, enclose it in quotes.
 | 
					 | 
				
			||||||
EXTRAINCDIRS += $(subst :, ,$(VPATH_SRC))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Compiler flag to set the C Standard level.
 | 
					# Compiler flag to set the C Standard level.
 | 
				
			||||||
#     c89   = "ANSI" C
 | 
					#     c89   = "ANSI" C
 | 
				
			||||||
#     gnu89 = c89 plus GCC extensions
 | 
					#     gnu89 = c89 plus GCC extensions
 | 
				
			||||||
| 
						 | 
					@ -104,7 +97,6 @@ CFLAGS += -Wstrict-prototypes
 | 
				
			||||||
#CFLAGS += -Wunreachable-code
 | 
					#CFLAGS += -Wunreachable-code
 | 
				
			||||||
#CFLAGS += -Wsign-compare
 | 
					#CFLAGS += -Wsign-compare
 | 
				
			||||||
CFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
 | 
					CFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
 | 
				
			||||||
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
 | 
					 | 
				
			||||||
CFLAGS += $(CSTANDARD)
 | 
					CFLAGS += $(CSTANDARD)
 | 
				
			||||||
ifdef CONFIG_H
 | 
					ifdef CONFIG_H
 | 
				
			||||||
    CFLAGS += -include $(CONFIG_H)
 | 
					    CFLAGS += -include $(CONFIG_H)
 | 
				
			||||||
| 
						 | 
					@ -131,7 +123,6 @@ CPPFLAGS += -Wundef
 | 
				
			||||||
#CPPFLAGS += -Wunreachable-code
 | 
					#CPPFLAGS += -Wunreachable-code
 | 
				
			||||||
#CPPFLAGS += -Wsign-compare
 | 
					#CPPFLAGS += -Wsign-compare
 | 
				
			||||||
CPPFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
 | 
					CPPFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
 | 
				
			||||||
CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
 | 
					 | 
				
			||||||
#CPPFLAGS += $(CSTANDARD)
 | 
					#CPPFLAGS += $(CSTANDARD)
 | 
				
			||||||
ifdef CONFIG_H
 | 
					ifdef CONFIG_H
 | 
				
			||||||
    CPPFLAGS += -include $(CONFIG_H)
 | 
					    CPPFLAGS += -include $(CONFIG_H)
 | 
				
			||||||
| 
						 | 
					@ -149,7 +140,6 @@ endif
 | 
				
			||||||
#       dump that will be displayed for a given single line of source input.
 | 
					#       dump that will be displayed for a given single line of source input.
 | 
				
			||||||
ASFLAGS += $(ADEFS) 
 | 
					ASFLAGS += $(ADEFS) 
 | 
				
			||||||
ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
 | 
					ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
 | 
				
			||||||
ASFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
 | 
					 | 
				
			||||||
ifdef CONFIG_H
 | 
					ifdef CONFIG_H
 | 
				
			||||||
    ASFLAGS += -include $(CONFIG_H)
 | 
					    ASFLAGS += -include $(CONFIG_H)
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
| 
						 | 
					@ -305,9 +295,11 @@ BEGIN = gccversion sizebefore
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
					
 | 
				
			||||||
define GEN_OBJRULE
 | 
					define GEN_OBJRULE
 | 
				
			||||||
$1_CFLAGS = $$(ALL_CFLAGS) $$($1_DEFS)
 | 
					$1_INCFLAGS := $$(patsubst %,-I%,$$($1_INC))
 | 
				
			||||||
$1_CPPFLAGS= $$(ALL_CPPFLAGS) $$($1_DEFS)
 | 
					$1_CFLAGS = $$(ALL_CFLAGS) $$($1_DEFS) $$($1_INCFLAGS)
 | 
				
			||||||
$1_ASFLAGS= $$(ALL_ASFLAGS) $$($1_DEFS)
 | 
					$1_CPPFLAGS= $$(ALL_CPPFLAGS) $$($1_DEFS) $$($1_INCFLAGS)
 | 
				
			||||||
 | 
					$1_ASFLAGS= $$(ALL_ASFLAGS) $$($1_DEFS) $$($1_INCFLAGS)
 | 
				
			||||||
 | 
					$$(info $$($1_INCFLAGS))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Compile: create object files from C source files.
 | 
					# Compile: create object files from C source files.
 | 
				
			||||||
$1/%.o : %.c $1/%.d $1/cflags.txt $1/compiler.txt | $(BEGIN)
 | 
					$1/%.o : %.c $1/%.d $1/cflags.txt $1/compiler.txt | $(BEGIN)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue