Makefile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Makefile
  2. # You can edit this file or override these variables on
  3. # the commandline. For example, "make install MANDIR=/tmp/man"
  4. # would use defaults for all variables except ${MANDIR}.
  5. # You can set this to something like /opt/aoetools-x
  6. # if you want to install everything in one place.
  7. #
  8. # Note that even with ${PREFIX} set, the devices in
  9. # /dev/etherd will be used unless you override ${DEVDIR}.
  10. PREFIX =
  11. # Your aoe-driver device files should be in ${DEVDIR}.
  12. DEVDIR = /dev/etherd
  13. # The programs will be installed in ${SBINDIR}.
  14. SBINDIR = ${PREFIX}/usr/sbin
  15. MANDIR = ${PREFIX}/usr/share/man
  16. # end of user-configurable variables
  17. # these scripts are created from the *.in files
  18. CONF_SCRIPTS = aoe-discover aoe-interfaces
  19. PROGS = aoeping
  20. COMMANDS := ${CONF_SCRIPTS} aoe-mkdevs aoe-mkshelf aoe-stat ${PROG}
  21. CFLAGS = -Wall -O -g
  22. AOE_PING_OBJ = aoeping.o linux.o
  23. all : configure ${PROGS}
  24. @true
  25. configure :
  26. @for f in ${CONF_SCRIPTS}; do \
  27. sh -xc "sed 's!@devdir@!${DEVDIR}!g' $$f.in > $$f" || break; \
  28. done
  29. install : configure
  30. mkdir -p ${SBINDIR}
  31. mkdir -p ${MANDIR}/man8
  32. @for f in ${COMMANDS}; do \
  33. sh -xc "install -m 700 $$f ${SBINDIR}/$$f" || break; \
  34. sh -xc "install -m 664 $$f.8 ${MANDIR}/man8/$$f.8" || break; \
  35. done
  36. clean :
  37. rm -f ${CONF_SCRIPTS} ${AOE_PING_OBJ} ${PROGS}
  38. aoeping : ${AOE_PING_OBJ}
  39. ${CC} ${CFLAGS} -o $@ ${AOE_PING_OBJ}
  40. aoeping.o : aoeping.c dat.h fns.h
  41. ${CC} ${CFLAGS} -o $@ -c $<
  42. linux.o : linux.c config.h
  43. ${CC} ${CFLAGS} -o $@ -c $<