Makefile 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/make -f
  2. # file: tools/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 *.txt *.c *.h *.xml *.css
  14. TOOLS=
  15. PAGES=
  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. # install -m ${MAN_PERM} -o ${OWNER} -g ${GROUP} ${PAGES} ${MAN}
  28. install: $(TOOLS) library
  29. # install -m ${BIN_PERM} -o ${OWNER} -g ${GROUP} ${TOOLS} ${BIN}
  30. uninstall:
  31. cd ${BIN}; rm -f ${TOOLS}
  32. cd ${MAN}; rm -f ${PAGES}
  33. check:
  34. ${SHELL} tools.sh
  35. fresh: clean compile
  36. clean:
  37. rm -f ${TOOLS} ${TRASH}
  38. ignore:
  39. echo ${TOOLS} | tr ' ' '\n' > .gitignore
  40. # ====================================================================
  41. #
  42. # --------------------------------------------------------------------
  43. %: %.o
  44. ${CC} -o ${@} ${^} ${LDFLAGS}
  45. %.o: %.c
  46. ${CC} -c ${<} ${CFLAGS}
  47. %.h: %.h
  48. # ====================================================================
  49. # programs;
  50. # --------------------------------------------------------------------
  51. grab: grab.o getoptv.o putoptv.o version.o basespec.o todigit.o error.o efreopen.o
  52. # ====================================================================
  53. # libraries;
  54. # --------------------------------------------------------------------
  55. libmtools.a: binout.o bytespec.o confirmfilename.o checksum32.o dataspec.o decdecode.o decout.o emalloc.o reverse.o error.o fdchecksum32.o filepart.o getoptv.o hexdecode.o hexdump.o hexencode.o hexin.o hexout.o hexstring.o hexview.o regview.o ipv4spec.o ipv6spec.o memdecr.o memincr.o memswap.o output.o putoptv.o strdecr.o strfbits.o strincr.o synonym.o todigit.o typename.o basespec.o uintspec.o version.o
  56. rm -f ${@}
  57. $(AR) rc ${@} ${^}
  58. $(RANLIB) ${@}
  59. # ====================================================================
  60. #
  61. # --------------------------------------------------------------------
  62. include ../nodes/nodes.mak