Tools for multicast testing (msend and mreceive)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # -*-Makefile-*- for mtools
  2. # Originally from http://www.cs.virginia.edu/~mngroup/software/
  3. # Figure out root of library, unless used as submodule
  4. ROOTDIR ?= $(shell pwd)
  5. VERSION ?= 2.3
  6. NAME = mtools
  7. PKG = $(NAME)-$(VERSION)
  8. ARCHIVE = $(PKG).tar.gz
  9. CC ?= $(CROSS)gcc
  10. CPPFLAGS += -DVERSION=\"$(VERSION)\"
  11. CPPFLAGS += -W -Wall
  12. prefix ?= /usr/local
  13. sysconfdir ?= /etc
  14. datadir = $(prefix)/share/doc/mtools
  15. mandir = $(prefix)/share/man/man8
  16. # ttcp is currently not part of the distribution because its not tested
  17. # yet. Please test and let me know at GitHub so I can include it! :)
  18. EXEC := msend mreceive
  19. OBJS := $(EXEC:=.o)
  20. DEPS := $(EXEC:=.d)
  21. MANS = $(addsuffix .8,$(EXEC))
  22. DISTFILES = README.md LICENSE.md
  23. all: $(EXEC)
  24. .c.o:
  25. @printf " CC $@\n"
  26. @$(CC) $(CFLAGS) $(CPPFLAGS) -c -MMD -MP -o $@ $<
  27. .o:
  28. @printf " LINK $@\n"
  29. @$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-Map,$@.map -o $@ $< $(LDLIBS$(LDLIBS-$(@)))
  30. msend: msend.o
  31. mreceive: mreceive.o
  32. ttcp: ttcp.o
  33. install: $(EXEC)
  34. @printf " INSTALL $(DESTDIR)$(prefix) ...\n"
  35. @install -d $(DESTDIR)$(prefix)/sbin
  36. @install -d $(DESTDIR)$(datadir)
  37. @install -d $(DESTDIR)$(mandir)
  38. @for file in $(EXEC); do \
  39. install -m 0755 $$file $(DESTDIR)$(prefix)/sbin/$$file; \
  40. done
  41. @for file in $(DISTFILES); do \
  42. install -m 0644 $$file $(DESTDIR)$(datadir)/$$file; \
  43. done
  44. @for file in $(MANS); do \
  45. install -m 0644 $$file $(DESTDIR)$(mandir)/$$file; \
  46. done
  47. uninstall:
  48. @printf " UNINST $(DESTDIR)$(prefix) ...\n"
  49. -@for file in $(EXEC); do \
  50. (RM) $(DESTDIR)$(prefix)/sbin/$$file; \
  51. done
  52. -@$(RM) -r $(DESTDIR)$(datadir)
  53. @for file in $(DISTFILES); do \
  54. $(RM) $(DESTDIR)$(datadir)/$$file; \
  55. done
  56. -@for file in $(MANS); do \
  57. $(RM) $(DESTDIR)$(mandir)/$$file; \
  58. done
  59. clean:
  60. @rm -f $(EXEC) $(OBJS)
  61. distclean: clean
  62. @rm -f *.o *.d *~ *.map msend mreceive ttcp
  63. dist:
  64. @if [ -e ../$(ARCHIVE) ]; then \
  65. echo "Distribution ../$(ARCHIVE) already exists."; \
  66. exit 1; \
  67. fi
  68. @echo "Building .gz tarball of $(PKG) in parent dir..."
  69. @git archive --format=tar --prefix=$(PKG)/ v$(VERSION) | gzip >../$(ARCHIVE)
  70. @(cd ..; md5sum $(ARCHIVE) | tee $(ARCHIVE).md5)
  71. # Include automatically generated rules
  72. -include $(DEPS)