Makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/usr/bin/make -f
  2. # file: mdio/Makefile
  3. # ====================================================================
  4. # environment definitions;
  5. # --------------------------------------------------------------------
  6. include ../make.def
  7. # ====================================================================
  8. # symbols;
  9. # --------------------------------------------------------------------
  10. CFLAGS+=
  11. LDFLAGS+=
  12. TRASH=*.o *.obj *.exe t t.* *~ *.[0-9][0-9][0-9]
  13. FILES=Makefile *.mak *.sh *.c *.h
  14. TOOLS=mdioblock mdioblock2 mdiodump mdiogen
  15. PAGES=mdioblock.1 mdioblock2.1 mdiodump.1
  16. # ====================================================================
  17. # pseudo targets;
  18. # --------------------------------------------------------------------
  19. all compile: ${TOOLS}
  20. compact: compile
  21. if [ ! -z ${STRIP} ]; then ${STRIP} ${TOOLS}; fi
  22. if [ -x /usr/local/bin/upx ]; then upx --best ${TOOLS}; fi
  23. library:
  24. install -m ${DIR_PERM} -o ${OWNER} -g ${GROUP} -d ${BIN}
  25. scripts:
  26. manuals:
  27. if [ ! -d ${MAN} ]; then install -m ${DIR_PERM} -o ${OWNER} -g ${GROUP} -d ${MAN}; fi
  28. install -m ${MAN_PERM} -o ${OWNER} -g ${GROUP} ${PAGES} ${MAN}
  29. install: compile library
  30. install -m ${BIN_PERM} -o ${OWNER} -g ${GROUP} ${TOOLS} ${BIN}
  31. uninstall:
  32. cd ${BIN}; rm -f int6k ${TOOLS}
  33. cd ${MAN}; rm -f int6k ${PAGES}
  34. clean:
  35. rm -f ${TRASH} ${TOOLS}
  36. check:
  37. ${SHELL} mdio.sh
  38. ignore:
  39. echo ${TOOLS} | tr ' ' '\n' > .gitignore
  40. # ====================================================================
  41. # programs;
  42. # --------------------------------------------------------------------
  43. %: %.o
  44. ${CC} -o ${@} ${^} ${LDFLAGS}
  45. %.o: %.c
  46. ${CC} -c ${<} ${CFLAGS}
  47. %.h: %.h
  48. # ====================================================================
  49. # programs;
  50. # --------------------------------------------------------------------
  51. mdioblock: mdioblock.o error.o getoptv.o putoptv.o todigit.o version.o
  52. mdioblock2: mdioblock2.o error.o getoptv.o putoptv.o todigit.o version.o
  53. mdiodump: mdiodump.o assist.o error.o codelist.o getoptv.o hexdecode.o hexstring.o lookup.o putoptv.o version.o
  54. mdiogen: mdiogen.o error.o
  55. # ====================================================================
  56. # includes;
  57. # --------------------------------------------------------------------
  58. include ../mdio/mdio.mak
  59. include ../tools/tools.mak
  60. include ../key/key.mak
  61. include ../ether/ether.mak
  62. include ../nodes/nodes.mak
  63. include ../ram/ram.mak
  64. include ../pib/pib.mak
  65. include ../nvm/nvm.mak
  66. include ../mme/mme.mak
  67. include ../plc/plc.mak