aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPiotr Esden-Tempski2012-08-13 14:37:07 -0700
committerPiotr Esden-Tempski2012-08-13 15:19:57 -0700
commit3441bba1c4fc2710bef73402f58b5499cea20b42 (patch)
tree3516e5351d97e3f345245826294fa30542a98bf1 /Makefile
parenta2c5b6391d82684838e923c6d7437367110f5480 (diff)
Changed local build target for library and linker files.
- The library files are now being built into the lib subdirectory of the source. - The linker files for each library are being copied into the lib source subdirectory. Motivation: The relative locations of files in the source directory after make are now the same as after make install now. This makes it easier to reuse examples with their makefiles outside of the libopencm3 sourcecode directory.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 5 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 092efbd..d4abe2f 100644
--- a/Makefile
+++ b/Makefile
@@ -25,6 +25,7 @@ LIBDIR = $(DESTDIR)/$(PREFIX)/lib
SHAREDIR = $(DESTDIR)/$(PREFIX)/share/libopencm3/scripts
INSTALL = install
+SRCLIBDIR = $(shell pwd)/lib
TARGETS = stm32/f1 stm32/f2 stm32/f4 lpc13xx lpc17xx lpc43xx lm3s
# Be silent per default, but 'make V=1' will show all compiler calls.
@@ -42,7 +43,7 @@ lib:
$(Q)for i in $(addprefix $@/,$(TARGETS)); do \
if [ -d $$i ]; then \
printf " BUILD $$i\n"; \
- $(MAKE) -C $$i || exit $?; \
+ $(MAKE) -C $$i SRCLIBDIR=$(SRCLIBDIR) || exit $?; \
fi; \
done
@@ -61,11 +62,9 @@ install: lib
$(Q)$(INSTALL) -d $(SHAREDIR)
$(Q)cp -r include/libopencm3/* $(INCDIR)/libopencm3
@printf " INSTALL libs\n"
- $(Q)$(INSTALL) -m 0644 lib/*/*/*.a $(LIBDIR)
- $(Q)$(INSTALL) -m 0644 lib/*/*.a $(LIBDIR)
+ $(Q)$(INSTALL) -m 0644 lib/*.a $(LIBDIR)
@printf " INSTALL ldscripts\n"
- $(Q)$(INSTALL) -m 0644 lib/*/*/*.ld $(LIBDIR)
- $(Q)$(INSTALL) -m 0644 lib/*/*.ld $(LIBDIR)
+ $(Q)$(INSTALL) -m 0644 lib/*.ld $(LIBDIR)
@printf " INSTALL scripts\n"
$(Q)$(INSTALL) -m 0644 scripts/* $(SHAREDIR)
@@ -77,7 +76,7 @@ clean:
$(addsuffix /*/*,$(addprefix examples/,$(TARGETS))); do \
if [ -d $$i ]; then \
printf " CLEAN $$i\n"; \
- $(MAKE) -C $$i clean || exit $?; \
+ $(MAKE) -C $$i clean SRCLIBDIR=$(SRCLIBDIR) || exit $?; \
fi; \
done
@printf " CLEAN doxygen\n"