Skip to content

Commit

Permalink
makefile: Replace CFLAGS -I with -iquote
Browse files Browse the repository at this point in the history
The -iquote tells GCC to only search that path when resolving a quoted
"include" (vs <angle brackets>) which by convention imples a include from
the projects own soruce tree. This prevents a conflict between Klippers
"sched.h" and "gpio.h" and <linux/gpio.h> and glibc <sched.h>.

Signed-off-by: Michael 'ASAP' Weinrich <[email protected]>
  • Loading branch information
MadnessASAP authored and KevinOConnor committed Apr 4, 2024
1 parent 75a40e8 commit 24c884e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ dirs-y = src
cc-option=$(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`" \
; then echo "$(2)"; else echo "$(3)"; fi ;)

CFLAGS := -I$(OUT) -Isrc -I$(OUT)board-generic/ -std=gnu11 -O2 -MD \
-Wall -Wold-style-definition $(call cc-option,$(CC),-Wtype-limits,) \
CFLAGS := -iquote $(OUT) -iquote src -iquote $(OUT)board-generic/ \
-std=gnu11 -O2 -MD -Wall \
-Wold-style-definition $(call cc-option,$(CC),-Wtype-limits,) \
-ffunction-sections -fdata-sections -fno-delete-null-pointer-checks
CFLAGS += -flto=auto -fwhole-program -fno-use-linker-plugin -ggdb3

Expand Down

0 comments on commit 24c884e

Please sign in to comment.