summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2007-07-24 15:14:52 +1000
committerJon Loeliger <jdl@freescale.com>2007-07-25 10:26:36 -0500
commit4f61ae162780585aacf90ff80e4abf3ab05201ca (patch)
treea5e5f4db905fb93c8176943b2b93d3df958ab5d5 /Makefile
parentfdd2e6f9455020972b762a993046351f7845e7b5 (diff)
downloaddtc-4f61ae162780585aacf90ff80e4abf3ab05201ca.tar.gz
dtc: Improve the make install target
This patch makes various improvements to dtc's make install target: - libfdt is also installed. Specifically, libfdt.a and the two export relevant header files, fdt.h and libfdt.h are installed. - ftdump is no longer installed. It was only ever a development debugging tool and may well go away at some point. - In keeping with normal conventions, there is now a PREFIX variable, allowing control of where things are installed (in /usr, /usr/local, /opt, etc.). - By default, installed into the user's home directory, instead of /usr. This is friendlier for self-installers, package builders can easily override PREFIX to restore the old behaviour. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 10 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 04574c9..24ce91a 100644
--- a/Makefile
+++ b/Makefile
@@ -52,7 +52,10 @@ BISON = bison
INSTALL = /usr/bin/install
DESTDIR =
-BINDIR = /usr/bin
+PREFIX = $(HOME)
+BINDIR = $(PREFIX)/bin
+LIBDIR = $(PREFIX)/lib
+INCLUDEDIR = $(PREFIX)/include
#
# Overall rules
@@ -140,10 +143,14 @@ clean: libfdt_clean tests_clean
rm -f *.tab.[ch] lex.yy.c *.output vgcore.*
rm -f $(BIN)
-install: dtc ftdump
+install: all
+ @$(VECHO) INSTALL
$(INSTALL) -d $(DESTDIR)$(BINDIR)
$(INSTALL) -m 755 dtc $(DESTDIR)$(BINDIR)
- $(INSTALL) -m 755 ftdump $(DESTDIR)$(BINDIR)
+ $(INSTALL) -d $(DESTDIR)$(LIBDIR)
+ $(INSTALL) -m 644 $(LIBFDT_LIB) $(DESTDIR)$(LIBDIR)
+ $(INSTALL) -d $(DESTDIR)$(INCLUDEDIR)
+ $(INSTALL) -m 644 $(LIBFDT_INCLUDES) $(DESTDIR)$(INCLUDEDIR)
define filechk
set -e; \