Makefile 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #!/usr/bin/make -f
  2. # file: plc-utils/Makefile
  3. # Published 2010 by Qualcomm Atheros;
  4. # ====================================================================
  5. # target platform symbols;
  6. # --------------------------------------------------------------------
  7. include make.def
  8. # ====================================================================
  9. # package symbols;
  10. # --------------------------------------------------------------------
  11. ARCHIVE=$(shell basename "${CURDIR}")
  12. PACKAGE=$(shell basename "${CURDIR}")
  13. LIBRARY=${FTP}/toolkit/${PACKAGE}
  14. FOLDERS=mdio plc programs tools ether serial mme ram nvm pib key nodes nda VisualStudioNET
  15. EXCLUDE=--exclude=.git --exclude=.#* --exclude=*.[0-9][0-9][0-9]
  16. # ====================================================================
  17. # installation targets;
  18. # --------------------------------------------------------------------
  19. .PHONY: all compile compact scripts manuals install uninstall clean check ignore
  20. all compile compact scripts manuals install uninstall clean check ignore:
  21. ifeq ($(shell expr $(LOCALCCVER) \<= $(LASTSUPPORTEDGCCVER)), 1)
  22. @for folder in ${FOLDERS}; do ${MAKE} -C $${folder} ${@} || exit 1; done
  23. else
  24. echo "gcc compiler version supported till 10.2.1, local gcc version:" $(shell gcc -dumpversion)
  25. endif
  26. # ====================================================================
  27. # release targets;
  28. # --------------------------------------------------------------------
  29. .PHONY: package library prepare cleanse
  30. debian: clean
  31. dpkg-buildpackage -rfakeroot -uc -us
  32. debian-setup:
  33. apt-get install dpkg-dev debhelper devscripts fakeroot linda
  34. # apt-get install dpkg dpkg-dev debhelper dh-make devscripts quilt
  35. package: archive prepare library
  36. prepare:
  37. rm -fr t.* install.* *.err *.log *.log *.tlog
  38. rm -fr */t.* */install.* */*.err */*.log */*.o */*.[0-9][0-9][0-9]
  39. # chmod -fR ${MAN_PERM} */*.c */*.h */*.txt */*.mak */*.xsd */*.xsl */*.xml */*.css */*.html */*.png
  40. # chmod -fR ${BIN_PERM} */Makefile */*.sh
  41. # chown -fR root:root *
  42. library:
  43. install -m ${DIR_PERM} -o ${OWNER} -g ${STAFF} -d ${LIBRARY}
  44. install -m ${DIR_PERM} -o ${OWNER} -g ${STAFF} -d ${LIBRARY}/Programs
  45. install -m ${DIR_PERM} -o ${OWNER} -g ${STAFF} -d ${LIBRARY}/Documents
  46. install -m ${BIN_PERM} -o ${OWNER} -g ${STAFF} VisualStudioNET/*.msi ${LIBRARY}
  47. install -m ${BIN_PERM} -o ${OWNER} -g ${STAFF} ../${ARCHIVE}.tar.* ${LIBRARY}
  48. cp -r VisualStudioNET/Programs/* ${LIBRARY}/Programs
  49. cp -r docbook/* ${LIBRARY}/Documents
  50. ${CRLF} < CHANGES > ${LIBRARY}/_CHANGES.txt
  51. ${CRLF} < README > ${LIBRARY}/_README.txt
  52. ${CRLF} < LICENSE > ${LIBRARY}/_LICENSE.txt
  53. ${CRLF} < NOTICES > ${LIBRARY}/_NOTICES.txt
  54. ls -la ${LIBRARY}/*.tar.*
  55. ls -la ${LIBRARY}/*.msi
  56. # ====================================================================
  57. # archive targets;
  58. # --------------------------------------------------------------------
  59. .PHONY: archive restore
  60. archive: clean
  61. tar ${EXCLUDE} -vzcf ../${ARCHIVE}.tar.gz -C .. ${PACKAGE}
  62. tar ${EXCLUDE} -vjcf ../${ARCHIVE}.tar.bz2 -C .. ${PACKAGE}
  63. restore:
  64. tar -vzxf ../${PACKAGE}.tar.gz -C ..