1 # SPDX-License-Identifier: GPL-2.0 << 2 # Makefile for Hyper-V tools 1 # Makefile for Hyper-V tools 3 include ../scripts/Makefile.include << 4 2 5 ARCH := $(shell uname -m 2>/dev/null) !! 3 CC = $(CROSS_COMPILE)gcc 6 sbindir ?= /usr/sbin !! 4 PTHREAD_LIBS = -lpthread 7 libexecdir ?= /usr/libexec !! 5 WARNINGS = -Wall -Wextra 8 sharedstatedir ?= /var/lib !! 6 CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS) $(shell getconf LFS_CFLAGS) 9 !! 7 10 ifeq ($(srctree),) !! 8 CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include 11 srctree := $(patsubst %/,%,$(dir $(CURDIR))) !! 9 12 srctree := $(patsubst %/,%,$(dir $(srctree))) !! 10 all: hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon 13 endif !! 11 %: %.c 14 !! 12 $(CC) $(CFLAGS) -o $@ $^ 15 # Do not use make's built-in rules << 16 # (this improves performance and avoids hard-t << 17 MAKEFLAGS += -r << 18 << 19 override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE << 20 override CFLAGS += -Wno-address-of-packed-memb << 21 << 22 ALL_TARGETS := hv_kvp_daemon hv_vss_daemon << 23 ifneq ($(ARCH), aarch64) << 24 ALL_TARGETS += hv_fcopy_uio_daemon << 25 endif << 26 ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_ << 27 << 28 ALL_SCRIPTS := hv_get_dhcp_info.sh hv_get_dns_ << 29 << 30 all: $(ALL_PROGRAMS) << 31 << 32 export srctree OUTPUT CC LD CFLAGS << 33 include $(srctree)/tools/build/Makefile.includ << 34 << 35 HV_KVP_DAEMON_IN := $(OUTPUT)hv_kvp_daemon-in. << 36 $(HV_KVP_DAEMON_IN): FORCE << 37 $(Q)$(MAKE) $(build)=hv_kvp_daemon << 38 $(OUTPUT)hv_kvp_daemon: $(HV_KVP_DAEMON_IN) << 39 $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS << 40 << 41 HV_VSS_DAEMON_IN := $(OUTPUT)hv_vss_daemon-in. << 42 $(HV_VSS_DAEMON_IN): FORCE << 43 $(Q)$(MAKE) $(build)=hv_vss_daemon << 44 $(OUTPUT)hv_vss_daemon: $(HV_VSS_DAEMON_IN) << 45 $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS << 46 << 47 HV_FCOPY_UIO_DAEMON_IN := $(OUTPUT)hv_fcopy_ui << 48 $(HV_FCOPY_UIO_DAEMON_IN): FORCE << 49 $(Q)$(MAKE) $(build)=hv_fcopy_uio_daem << 50 $(OUTPUT)hv_fcopy_uio_daemon: $(HV_FCOPY_UIO_D << 51 $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS << 52 13 53 clean: 14 clean: 54 rm -f $(ALL_PROGRAMS) !! 15 $(RM) hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon 55 find $(or $(OUTPUT),.) -name '*.o' -de << 56 << 57 install: $(ALL_PROGRAMS) << 58 install -d -m 755 $(DESTDIR)$(sbindir) << 59 install -d -m 755 $(DESTDIR)$(libexecd << 60 install -d -m 755 $(DESTDIR)$(sharedst << 61 for program in $(ALL_PROGRAMS); do \ << 62 install $$program -m 755 $(DES << 63 done; \ << 64 install -m 755 lsvmbus $(DESTDIR)$(sbi << 65 for script in $(ALL_SCRIPTS); do \ << 66 install $$script -m 755 $(DEST << 67 done << 68 << 69 FORCE: << 70 << 71 .PHONY: all install clean FORCE prepare <<
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.