1
0

Makefile 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. # NPERSHELF is the number of slot addresses per shelf address.
  17. # This number must match the same setting in the aoe driver.
  18. #
  19. # Older aoe drivers have NPERSHELF set to 10, and newer ones
  20. # use 16.
  21. #
  22. # You can see the setting in your driver like this in the driver
  23. # source directory. (Change into the "linux" directory if you're
  24. # using the standalone driver from the Coraid.)
  25. #
  26. # grep 'NPERSHELF.*=' drivers/block/aoe/aoe.h
  27. #
  28. NPERSHELF=16
  29. # end of user-configurable variables
  30. # these scripts are created from the *.in files
  31. CONF_SCRIPTS = aoe-discover aoe-interfaces aoe-mkshelf aoe-revalidate
  32. PROGS = aoeping
  33. COMMANDS := ${CONF_SCRIPTS} aoe-mkdevs aoe-stat ${PROGS}
  34. CFLAGS = -Wall -O -g
  35. AOE_PING_OBJ = aoeping.o linux.o
  36. all : configure ${PROGS}
  37. @true
  38. configure :
  39. @for f in ${CONF_SCRIPTS}; do \
  40. sh -xc "sed -e 's!@devdir@!${DEVDIR}!g' -e 's!@npershelf@!${NPERSHELF}!g' $$f.in > $$f" || break; \
  41. done
  42. # DESTDIR was put in for Rob Holland to make gentoo packaging easier
  43. install : all
  44. mkdir -p ${SBINDIR}
  45. mkdir -p ${MANDIR}/man8
  46. @for f in ${COMMANDS}; do \
  47. sh -xc "install -m 700 $$f ${DESTDIR}${SBINDIR}/$$f" || break; \
  48. sh -xc "install -m 664 $$f.8 ${DESTDIR}${MANDIR}/man8/$$f.8" || break; \
  49. done
  50. clean :
  51. rm -f ${CONF_SCRIPTS} ${AOE_PING_OBJ} ${PROGS}
  52. aoeping : ${AOE_PING_OBJ}
  53. ${CC} ${CFLAGS} -o $@ ${AOE_PING_OBJ}
  54. aoeping.o : aoeping.c dat.h fns.h
  55. ${CC} ${CFLAGS} -o $@ -c $<
  56. linux.o : linux.c config.h
  57. ${CC} ${CFLAGS} -o $@ -c $<