Skip to content

Commit

Permalink
tools/hv: add install target to Makefile
Browse files Browse the repository at this point in the history
Makefiles usually come with 'install' target included so each distro
doesn't need to implement the procedure from scratch. Add it to tools/hv.

Signed-off-by: Vitaly Kuznetsov <[email protected]>
Signed-off-by: K. Y. Srinivasan <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
vittyvk authored and gregkh committed Nov 28, 2017
1 parent 8d9a3ab commit 39b759c
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tools/hv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,30 @@ CFLAGS = $(WARNINGS) -g $(shell getconf LFS_CFLAGS)

CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include

all: hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon
sbindir ?= /usr/sbin
libexecdir ?= /usr/libexec
sharedstatedir ?= /var/lib

ALL_PROGRAMS := hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon

ALL_SCRIPTS := hv_get_dhcp_info.sh hv_get_dns_info.sh hv_set_ifconfig.sh

all: $(ALL_PROGRAMS)

%: %.c
$(CC) $(CFLAGS) -o $@ $^

clean:
$(RM) hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon

install: all
install -d -m 755 $(DESTDIR)$(sbindir); \
install -d -m 755 $(DESTDIR)$(libexecdir)/hypervkvpd; \
install -d -m 755 $(DESTDIR)$(sharedstatedir); \
for program in $(ALL_PROGRAMS); do \
install $$program -m 755 $(DESTDIR)$(sbindir); \
done; \
install -m 755 lsvmbus $(DESTDIR)$(sbindir); \
for script in $(ALL_SCRIPTS); do \
install $$script -m 755 $(DESTDIR)$(libexecdir)/hypervkvpd/$${script%.sh}; \
done

0 comments on commit 39b759c

Please sign in to comment.