aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Machado <luis.machado@linaro.org>2019-01-11 15:52:53 -0200
committerLisa Nguyen <lisa.nguyen@linaro.org>2019-01-13 15:55:25 -0800
commit3b9ce87fc8a8eaf2288a8ab21698b28c898c023d (patch)
treebc2773823871645be3eb1b6fc0d1e9d807c082be
parentf7ad37fe3c438c56caf4317178e44d18488dcc2b (diff)
Add install target
The following patch adds an install target so we can install the utils/scripts somewhere. The default prefix is /opt/pm-qa. 2019-01-11 Luis Machado <luis.machado@linaro.org> * Makefile (prefix, SRC, EXEC, SUBDIRS, INSTALL_FILES): New variables. (install): New target. * README: Document install target. Signed-off-by: Luis Machado <luis.machado@linaro.org>
-rw-r--r--Makefile21
-rw-r--r--README4
2 files changed, 25 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 1c7bc9b..6c0621f 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,15 @@
# - initial API and implementation
#
hotplug_allow_cpu0?=0
+prefix := /opt/pm-qa
+SRC := $(wildcard utils/*.c) $(wildcard cpuidle/*.c)
+EXEC=$(SRC:%.c=%)
+
+# All directories that need to be created during installation.
+SUBDIRS := $(wildcard */.)
+
+# All files that need to be installed.
+INSTALL_FILES := $(wildcard */*.sh */*.txt) $(EXEC)
# Build all the utils required by the tests.
all:
@@ -49,3 +58,15 @@ recheck: uncheck check
clean:
@(cd utils; $(MAKE) clean)
+# Copy all the required directories and files to the installation
+# directory.
+install: all
+ @echo "Installing files to $(DESTDIR)/$(prefix)"
+
+ @(for dir in $(SUBDIRS); do \
+ mkdir -p $(DESTDIR)$(prefix)/$$dir; \
+ done;)
+
+ @(for file in $(INSTALL_FILES); do \
+ cp -a $$file $(DESTDIR)$(prefix)/$$file; \
+ done;)
diff --git a/README b/README
index 8d1519f..db76ea6 100644
--- a/README
+++ b/README
@@ -16,6 +16,10 @@ Commands
make -C cpufreq check
+- If you want to install the pm-qa suite somewhere (default prefix is
+ /opt/pm-qa), invoke:
+
+ make install DESTDIR=<destination_directory>
Test Specifications
===================