Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
Bjarke Istrup Pedersen | 3eb2094 | 2014-02-09 11:41:52 +0000 | [diff] [blame] | 2 | # Makefile for Hyper-V tools |
| 3 | |
Bjarke Istrup Pedersen | 3eb2094 | 2014-02-09 11:41:52 +0000 | [diff] [blame] | 4 | WARNINGS = -Wall -Wextra |
Weibing Zhang | 822114a | 2016-11-06 13:14:13 -0800 | [diff] [blame] | 5 | CFLAGS = $(WARNINGS) -g $(shell getconf LFS_CFLAGS) |
Bjarke Istrup Pedersen | 3eb2094 | 2014-02-09 11:41:52 +0000 | [diff] [blame] | 6 | |
Kamal Mostafa | 50fe6dd | 2016-01-27 22:29:33 -0800 | [diff] [blame] | 7 | CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include |
| 8 | |
Vitaly Kuznetsov | 39b759c | 2017-11-14 13:15:33 -0700 | [diff] [blame] | 9 | sbindir ?= /usr/sbin |
| 10 | libexecdir ?= /usr/libexec |
| 11 | sharedstatedir ?= /var/lib |
| 12 | |
| 13 | ALL_PROGRAMS := hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon |
| 14 | |
| 15 | ALL_SCRIPTS := hv_get_dhcp_info.sh hv_get_dns_info.sh hv_set_ifconfig.sh |
| 16 | |
| 17 | all: $(ALL_PROGRAMS) |
| 18 | |
Bjarke Istrup Pedersen | 3eb2094 | 2014-02-09 11:41:52 +0000 | [diff] [blame] | 19 | %: %.c |
| 20 | $(CC) $(CFLAGS) -o $@ $^ |
| 21 | |
| 22 | clean: |
Matej Muzila | ca04455 | 2014-12-28 15:54:13 +0100 | [diff] [blame] | 23 | $(RM) hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon |
Vitaly Kuznetsov | 39b759c | 2017-11-14 13:15:33 -0700 | [diff] [blame] | 24 | |
| 25 | install: 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 |