Makefile 970 B

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