diff --git a/Makefile b/Makefile index 18950f8a..14e53a51 100644 --- a/Makefile +++ b/Makefile @@ -26,13 +26,13 @@ else DESTDIR ?= $(shell dirname $(shell readlink -f $(shell which $(PREFIX)-gcc)))/.. endif -INCDIR = $(DESTDIR)/$(PREFIX)/include -LIBDIR = $(DESTDIR)/$(PREFIX)/lib -SHAREDIR = $(DESTDIR)/$(PREFIX)/share/libopencm3/scripts -INSTALL = install +INCDIR := $(DESTDIR)/$(PREFIX)/include +LIBDIR := $(DESTDIR)/$(PREFIX)/lib +SHAREDIR := $(DESTDIR)/$(PREFIX)/share/libopencm3/scripts +INSTALL := install -SRCLIBDIR = $(shell pwd)/lib -TARGETS = stm32/f1 stm32/f2 stm32/f4 stm32/l1 lpc13xx lpc17xx lpc43xx lm3s lm4f efm32/efm32tg efm32/efm32g efm32/efm32lg efm32/efm32gg sam/3x sam/3n +SRCLIBDIR:= $(realpath lib) +TARGETS:= stm32/f1 stm32/f2 stm32/f4 stm32/l1 lpc13xx lpc17xx lpc43xx lm3s lm4f efm32/efm32tg efm32/efm32g efm32/efm32lg efm32/efm32gg sam/3x sam/3n # Be silent per default, but 'make V=1' will show all compiler calls. ifneq ($(V),1) diff --git a/lib/Makefile.include b/lib/Makefile.include index 7b76d649..e109d339 100644 --- a/lib/Makefile.include +++ b/lib/Makefile.include @@ -29,20 +29,19 @@ OBJS += vector.o systick.o scb.o nvic.o assert.o sync.o all: $(SRCLIBDIR)/$(LIBNAME).a $(SRCLIBDIR)/$(LIBNAME).a: $(SRCLIBDIR)/$(LIBNAME).ld $(OBJS) - @printf " AR $(shell basename $(@))\n" - $(Q)$(AR) $(ARFLAGS) $(SRCLIBDIR)/$(shell basename $(@)) $(OBJS) + @printf " AR $(@F)\n" + $(Q)$(AR) $(ARFLAGS) $@ $(OBJS) $(SRCLIBDIR)/$(LIBNAME).ld: $(LIBNAME).ld - @printf " CP $(LIBNAME).ld\n" + @printf " CP $(@F)\n" $(Q)cp $^ $@ $(Q)if [ -f $(LIBNAME)_rom_to_ram.ld ]; then cp $(LIBNAME)_rom_to_ram.ld $(SRCLIBDIR); fi %.o: %.c - @printf " CC $(subst $(shell pwd)/,,$(@))\n" + @printf " CC $(