1# SPDX-License-Identifier: GPL-2.0 2# Makefile for Hyper-V tools 3 4CC = $(CROSS_COMPILE)gcc 5WARNINGS = -Wall -Wextra 6CFLAGS = $(WARNINGS) -g $(shell getconf LFS_CFLAGS) 7 8CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include 9 10sbindir ?= /usr/sbin 11libexecdir ?= /usr/libexec 12sharedstatedir ?= /var/lib 13 14ALL_PROGRAMS := hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon 15 16ALL_SCRIPTS := hv_get_dhcp_info.sh hv_get_dns_info.sh hv_set_ifconfig.sh 17 18all: $(ALL_PROGRAMS) 19 20%: %.c 21 $(CC) $(CFLAGS) -o $@ $^ 22 23clean: 24 $(RM) hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon 25 26install: all 27 install -d -m 755 $(DESTDIR)$(sbindir); \ 28 install -d -m 755 $(DESTDIR)$(libexecdir)/hypervkvpd; \ 29 install -d -m 755 $(DESTDIR)$(sharedstatedir); \ 30 for program in $(ALL_PROGRAMS); do \ 31 install $$program -m 755 $(DESTDIR)$(sbindir); \ 32 done; \ 33 install -m 755 lsvmbus $(DESTDIR)$(sbindir); \ 34 for script in $(ALL_SCRIPTS); do \ 35 install $$script -m 755 $(DESTDIR)$(libexecdir)/hypervkvpd/$${script%.sh}; \ 36 done 37