blob: 5db5e62cebdaeb3277e927ec396abd3ca412218e [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Bjarke Istrup Pedersen3eb20942014-02-09 11:41:52 +00002# Makefile for Hyper-V tools
3
Bjarke Istrup Pedersen3eb20942014-02-09 11:41:52 +00004WARNINGS = -Wall -Wextra
Weibing Zhang822114a2016-11-06 13:14:13 -08005CFLAGS = $(WARNINGS) -g $(shell getconf LFS_CFLAGS)
Bjarke Istrup Pedersen3eb20942014-02-09 11:41:52 +00006
Kamal Mostafa50fe6dd2016-01-27 22:29:33 -08007CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include
8
Vitaly Kuznetsov39b759c2017-11-14 13:15:33 -07009sbindir ?= /usr/sbin
10libexecdir ?= /usr/libexec
11sharedstatedir ?= /var/lib
12
13ALL_PROGRAMS := hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon
14
15ALL_SCRIPTS := hv_get_dhcp_info.sh hv_get_dns_info.sh hv_set_ifconfig.sh
16
17all: $(ALL_PROGRAMS)
18
Bjarke Istrup Pedersen3eb20942014-02-09 11:41:52 +000019%: %.c
20 $(CC) $(CFLAGS) -o $@ $^
21
22clean:
Matej Muzilaca044552014-12-28 15:54:13 +010023 $(RM) hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon
Vitaly Kuznetsov39b759c2017-11-14 13:15:33 -070024
25install: all
26 install -d -m 755 $(DESTDIR)$(sbindir); \
27 install -d -m 755 $(DESTDIR)$(libexecdir)/hypervkvpd; \
28 install -d -m 755 $(DESTDIR)$(sharedstatedir); \
29 for program in $(ALL_PROGRAMS); do \
30 install $$program -m 755 $(DESTDIR)$(sbindir); \
31 done; \
32 install -m 755 lsvmbus $(DESTDIR)$(sbindir); \
33 for script in $(ALL_SCRIPTS); do \
34 install $$script -m 755 $(DESTDIR)$(libexecdir)/hypervkvpd/$${script%.sh}; \
35 done