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