Makefile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. install : all
  43. mkdir -p ${SBINDIR}
  44. mkdir -p ${MANDIR}/man8
  45. @for f in ${COMMANDS}; do \
  46. sh -xc "install -m 700 $$f ${DESTDIR}${SBINDIR}/$$f" || break; \
  47. sh -xc "install -m 664 $$f.8 ${DESTDIR}${MANDIR}/man8/$$f.8" || break; \
  48. done
  49. clean :
  50. rm -f ${CONF_SCRIPTS} ${AOE_PING_OBJ} ${PROGS}
  51. aoeping : ${AOE_PING_OBJ}
  52. ${CC} ${CFLAGS} -o $@ ${AOE_PING_OBJ}
  53. aoeping.o : aoeping.c dat.h fns.h
  54. ${CC} ${CFLAGS} -o $@ -c $<
  55. linux.o : linux.c config.h
  56. ${CC} ${CFLAGS} -o $@ -c $<