Makefile 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/usr/bin/make -f
  2. # file: lldp/Makefile
  3. # ====================================================================
  4. # environment definitions;
  5. # --------------------------------------------------------------------
  6. include ../make.def
  7. # ====================================================================
  8. # symbols;
  9. # --------------------------------------------------------------------
  10. CFLAGS+=-g
  11. LDFLAGS+=
  12. TRASH=*.o *.obj *.exe t t.* *~ *.[0-9][0-9][0-9]
  13. FILES=Makefile *.mak *.sh *.c
  14. TOOLS=solicit respond
  15. PAGES=solicit.1 respond.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 ${SUID_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} lldp.sh
  38. ignore:
  39. echo ${TOOLS} | tr ' ' '\n' > .gitignore
  40. # ====================================================================
  41. # rules;
  42. # --------------------------------------------------------------------
  43. %: %.o
  44. ${CC} -o ${@} ${^} ${LDFLAGS}
  45. %.o: %.c
  46. ${CC} -c ${<} ${CFLAGS}
  47. # ====================================================================
  48. # programs;
  49. # --------------------------------------------------------------------
  50. respond: respond.o EthernetHeader.o lldp.o TLVPack.o TLVPackOS.o TLVPeek.o TLVPick.o channel.o closechannel.o config.o decdecode.o decstring.o error.o getoptv.o hexcopy.o hexdecode.o hexdump.o hexencode.o hexstring.o openchannel.o putoptv.o readpacket.o sendpacket.o strfbits.o synonym.o todigit.o uintspec.o version.o
  51. solicit: solicit.o EthernetHeader.o lldp.o TLVPack.o TLVPackOS.o TLVPeek.o TLVPick.o channel.o closechannel.o decdecode.o decstring.o error.o getoptv.o hexdecode.o hexdump.o hexencode.o hexstring.o memswap.o openchannel.o putoptv.o readpacket.o sendpacket.o strfbits.o synonym.o todigit.o uintspec.o version.o
  52. # ====================================================================
  53. # includes;
  54. # --------------------------------------------------------------------
  55. include ../tools/tools.mak
  56. include ../ether/ether.mak
  57. include ../mme/mme.mak
  58. include ../plc/plc.mak