1
0

Makefile 2.5 KB

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