Makefile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 aoe-flush aoe-stat
  32. PROGS = aoeping aoecfg
  33. COMMANDS := ${CONF_SCRIPTS} aoe-mkdevs aoe-version ${PROGS}
  34. CFLAGS = -Wall -O -g
  35. AOE_PING_OBJ = aoeping.o linux.o
  36. AOE_CFG_OBJ = aoecfg.o linux.o
  37. all : configure ${PROGS}
  38. @true
  39. configure :
  40. @for f in ${CONF_SCRIPTS}; do \
  41. sh -xc "sed -e 's!@devdir@!${DEVDIR}!g' -e 's!@npershelf@!${NPERSHELF}!g' $$f.in > $$f" || break; \
  42. done
  43. # DESTDIR was put in for Rob Holland to make gentoo packaging easier
  44. install : all
  45. mkdir -p ${DESTDIR}${SBINDIR}
  46. mkdir -p ${DESTDIR}${MANDIR}/man8
  47. @for f in ${COMMANDS}; do \
  48. sh -xc "install -m 700 $$f ${DESTDIR}${SBINDIR}/$$f" || break; \
  49. sh -xc "install -m 664 $$f.8 ${DESTDIR}${MANDIR}/man8/$$f.8" || break; \
  50. done
  51. clean :
  52. rm -f ${CONF_SCRIPTS} ${AOE_PING_OBJ} ${PROGS}
  53. aoeping : ${AOE_PING_OBJ}
  54. ${CC} ${CFLAGS} -o $@ ${AOE_PING_OBJ}
  55. aoeping.o : aoeping.c dat.h fns.h
  56. ${CC} ${CFLAGS} -o $@ -c $<
  57. linux.o : linux.c config.h
  58. ${CC} ${CFLAGS} -o $@ -c $<
  59. aoecfg: ${AOE_CFG_OBJ}
  60. ${CC} ${CFLAGS} -o $@ ${AOE_CFG_OBJ}
  61. aoecfg.o : aoecfg.c dat.h fns.h
  62. ${CC} ${CFLAGS} -o $@ -c $<