Makefile 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/bin/make -f
  2. # file: ram/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
  14. TOOLS=config2cfg sdram
  15. PAGES=config2cfg.1 sdram.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. test -d ${MAN} || install -m ${DIR_PERM} -o ${OWNER} -g ${GROUP} -d ${MAN}
  28. install -m ${MAN_PERM} -o ${OWNER} -g ${GROUP} ${PAGES} ${MAN}
  29. install: $(TOOLS) library
  30. install -m ${BIN_PERM} -o ${OWNER} -g ${GROUP} ${TOOLS} ${BIN}
  31. uninstall:
  32. cd ${BIN}; rm -f ${TOOLS}
  33. cd ${MAN}; rm -f ${PAGES}
  34. check:
  35. ${SHELL} ram.sh
  36. fresh: clean compile
  37. clean:
  38. rm -f ${TOOLS} ${TRASH}
  39. ignore:
  40. echo ${TOOLS} | tr ' ' '\n' > .gitignore
  41. # ====================================================================
  42. # rules;
  43. # --------------------------------------------------------------------
  44. %: %.o
  45. ${CC} -o ${@} ${^} ${LDFLAGS}
  46. %.o: %.c
  47. ${CC} -c ${<} ${CFLAGS}
  48. %.h: %.h
  49. # ====================================================================
  50. # programs;
  51. # --------------------------------------------------------------------
  52. config2cfg: config2cfg.o getoptv.o putoptv.o version.o error.o checksum32.o hexencode.o todigit.o
  53. sdram: sdram.o checksum32.o
  54. # ====================================================================
  55. # includes;
  56. # --------------------------------------------------------------------
  57. include ../tools/tools.mak
  58. include ../key/key.mak
  59. include ../ram/ram.mak
  60. include ../pib/pib.mak
  61. include ../plc/plc.mak