summarylogtreecommitdiffstats
path: root/0001-Revert-Drop-install-target-and-documentation.patch
blob: 999f70860b696c1a8f196da1b3cfb030dbf94d76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
commit 33f456aad9313bfc42e5ae7ef47e7976b0572a71
Author: Anatol Pomozov <anatol.pomozov@gmail.com>
Date:   Sun Jan 10 18:58:44 2016 -0800

    Revert "Drop "install" target and documentation."
    
    This reverts commit 7c1cd2e5cd3f3d1193ee375b46cfd8afaccb89f7.

diff --git a/Makefile b/Makefile
index 20f878fa..97f63933 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,13 @@ PREFIX		?= arm-none-eabi-
 STYLECHECK      := scripts/checkpatch.pl
 STYLECHECKFLAGS := --no-tree -f --terse --mailback
 
+DESTDIR		?= /usr/local
+
+INCDIR		:= $(DESTDIR)/$(PREFIX)/include
+LIBDIR		:= $(DESTDIR)/$(PREFIX)/lib
+SHAREDIR	:= $(DESTDIR)/$(PREFIX)/share/libopencm3/scripts
+INSTALL		:= install
+
 TARGETS ?=	stm32/f0 stm32/f1 stm32/f2 stm32/f3 stm32/f4 stm32/f7 \
 		stm32/l0 stm32/l1 stm32/l4 \
 		stm32/g0 stm32/g4 \
@@ -80,6 +87,20 @@ lib: $(LIB_DIRS)
 	done;
 	$(Q)[ -f .stamp_failure_tld ] && cat .stamp_failure_tld && exit 1 || true;
 
+install: lib
+	@printf "  INSTALL headers\n"
+	$(Q)$(INSTALL) -d $(INCDIR)/libopencm3
+	$(Q)$(INSTALL) -d $(INCDIR)/libopencmsis
+	$(Q)$(INSTALL) -d $(LIBDIR)
+	$(Q)$(INSTALL) -d $(SHAREDIR)
+	$(Q)cp -r include/libopencm3/* $(INCDIR)/libopencm3
+	$(Q)cp -r include/libopencmsis/* $(INCDIR)/libopencmsis
+	@printf "  INSTALL libs\n"
+	$(Q)$(INSTALL) -m 0644 lib/*.a $(LIBDIR)
+	@printf "  INSTALL ldscripts\n"
+	$(Q)$(INSTALL) -m 0644 lib/*.ld $(LIBDIR)
+
+
 html doc:
 	$(Q)$(MAKE) -C doc html TARGETS="$(TARGETS)"
 
@@ -125,4 +146,4 @@ genlinktests.clean:
 	fi;
 
 
-.PHONY: build lib $(LIB_DIRS) doc clean generatedheaders cleanheaders stylecheck genlinktests genlinktests.clean
+.PHONY: build lib $(LIB_DIRS) install doc clean generatedheaders cleanheaders stylecheck genlinktests genlinktests.clean