diff --git a/examples/fancyblink/Makefile b/examples/fancyblink/Makefile index b2790f63..09ec0ee9 100644 --- a/examples/fancyblink/Makefile +++ b/examples/fancyblink/Makefile @@ -25,9 +25,16 @@ CC = $(PREFIX)-gcc LD = $(PREFIX)-ld OBJCOPY = $(PREFIX)-objcopy OBJDUMP = $(PREFIX)-objdump -CFLAGS = -O0 -g -Wall -Wextra -I../../include -fno-common \ + +TOOLCHAIN_LIB_DIR = `dirname \`which $(CC)\``/../$(PREFIX)/lib +#TOOLCHAIN_LIB_DIR = ../../lib # uncomment for local directory builds + +TOOLCHAIN_INCLUDE_DIR = +#TOOLCHAIN_INCLUDE_DIR = ../../include # uncomment for local directory builds + +CFLAGS = -O0 -g -Wall -Wextra -I$(TOOLCHAIN_INCLUDE_DIR) -fno-common \ -mcpu=cortex-m3 -mthumb -LDFLAGS = -L../../lib -T$(BINARY).ld -nostartfiles +LDFLAGS = -T$(BINARY).ld -nostartfiles -L$(TOOLCHAIN_LIB_DIR) OBJS = $(BINARY).o OPENOCD = openocd diff --git a/examples/miniblink/Makefile b/examples/miniblink/Makefile index 4ffcff8f..1b5bd890 100644 --- a/examples/miniblink/Makefile +++ b/examples/miniblink/Makefile @@ -25,9 +25,16 @@ CC = $(PREFIX)-gcc LD = $(PREFIX)-ld OBJCOPY = $(PREFIX)-objcopy OBJDUMP = $(PREFIX)-objdump -CFLAGS = -O0 -g -Wall -Wextra -I../../include -fno-common \ + +TOOLCHAIN_LIB_DIR = `dirname \`which $(CC)\``/../$(PREFIX)/lib +#TOOLCHAIN_LIB_DIR = ../../lib # uncomment for local directory builds + +TOOLCHAIN_INCLUDE_DIR = +#TOOLCHAIN_INCLUDE_DIR = ../../include # uncomment for local directory builds + +CFLAGS = -O0 -g -Wall -Wextra -I$(TOOLCHAIN_INCLUDE_DIR) -fno-common \ -mcpu=cortex-m3 -mthumb -LDFLAGS = -L../../lib -T$(BINARY).ld -nostartfiles +LDFLAGS = -T$(BINARY).ld -nostartfiles -L$(TOOLCHAIN_LIB_DIR) OBJS = $(BINARY).o OPENOCD = openocd