diff options
author | Luis Machado <luis.machado@linaro.org> | 2019-01-11 15:52:53 -0200 |
---|---|---|
committer | Lisa Nguyen <lisa.nguyen@linaro.org> | 2019-01-13 15:06:56 -0800 |
commit | 3c370c8ff7f432234c737d92feef63498b8ad224 (patch) | |
tree | e495a0f338c7622d5596bc954ba65ae8181a47ef | |
parent | ddc01f0a1d52bd4af48fc8729ea778f68cc3999a (diff) | |
download | pm-qa-3c370c8ff7f432234c737d92feef63498b8ad224.tar.gz |
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-- | Makefile | 21 | ||||
-rw-r--r-- | README | 4 |
2 files changed, 25 insertions, 0 deletions
@@ -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;) @@ -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 =================== |