makefile.cegcc 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # Makefile for creating Windows CE release archives, with the
  2. # mingw32ce compiler.
  3. # Last updated: 22-Jul-2008
  4. # Copyright (C) 2008 Vincent Torri
  5. # This code is released under the libpng license.
  6. # For conditions of distribution and use, see the disclaimer
  7. # and license in png.h
  8. # To get some help, type
  9. #
  10. # make help
  11. #
  12. # To create the archives
  13. #
  14. # make
  15. #
  16. # To remove everything, type:
  17. #
  18. # make clean
  19. VERMAJ = 1
  20. VERMIN = 6
  21. VERMIC = 20
  22. VER = $(VERMAJ).$(VERMIN).$(VERMIC)
  23. NAME = libpng
  24. PACKAGE = $(NAME)-$(VER)
  25. BIN = libpng16-0.dll
  26. LIB = libpng16.a libpng16.dll.a libpng.a libpng.dll.a
  27. INCLUDE = png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  28. PC = libpng16.pc libpng.pc
  29. MANIFESTVERBIN = "Libpng-$(VER): Binary files"
  30. MANIFESTVERDEV = "Libpng-$(VER): Developer files"
  31. MANIFESTVERDESC = "Libpng: the official PNG reference library"
  32. all: $(NAME)
  33. $(NAME): remove-old copy-src compilation copy manifest archive
  34. @echo " * Removal of the directories"
  35. @rm -rf $(PACKAGE)/ $(PACKAGE)-bin/ $(PACKAGE)-dev/
  36. remove-old:
  37. @echo " * Removal of the old files"
  38. @rm -rf $(PACKAGE)-bin*
  39. @rm -rf $(PACKAGE)-dev*
  40. copy-src:
  41. @echo " * Copy of source files"
  42. @cp -R ../src/$(PACKAGE) .
  43. @echo " * Creation of directories and files"
  44. @mkdir -p $(PACKAGE)-bin/bin
  45. @mkdir -p $(PACKAGE)-bin/manifest
  46. @mkdir -p $(PACKAGE)-dev/lib/pkgconfig
  47. @mkdir -p $(PACKAGE)-dev/include/$(NAME)$(VERMAJ)$(VERMIN)
  48. @mkdir -p $(PACKAGE)-dev/manifest
  49. @touch $(PACKAGE)-bin/manifest/$(PACKAGE)-bin.mft
  50. @touch $(PACKAGE)-bin/manifest/$(PACKAGE)-bin.ver
  51. @touch $(PACKAGE)-dev/manifest/$(PACKAGE)-dev.mft
  52. @touch $(PACKAGE)-dev/manifest/$(PACKAGE)-dev.ver
  53. compilation:
  54. @echo " * Compilation of $(PACKAGE)"
  55. cd $(PACKAGE) && CPPFLAGS="$(CPPFLAGS) -DPNG_CONSOLE_IO_SUPPORTED -D_WIN32_WCE=0x0420" \
  56. CFLAGS="$(CFLAGS) -mms-bitfields -O3 -pipe -fomit-frame-pointer" \
  57. LDFLAGS="$(LDFLAGS) -Wl,--enable-auto-import -Wl,-s" \
  58. ./configure --prefix=/opt/wince --host=arm-mingw32ce && make
  59. copy:
  60. @echo " * Copy of binary and development files"
  61. @for i in $(BIN); do \
  62. cp $(PACKAGE)/.libs/$$i $(PACKAGE)-bin/bin; \
  63. done
  64. @for i in $(LIB); do \
  65. cp $(PACKAGE)/.libs/$$i $(PACKAGE)-dev/lib; \
  66. done
  67. @for i in $(INCLUDE); do \
  68. cp $(PACKAGE)/$$i $(PACKAGE)-dev/include/$(NAME)$(VERMAJ)$(VERMIN); \
  69. done
  70. @for i in $(PC); do \
  71. cp $(PACKAGE)/$$i $(PACKAGE)-dev/lib/pkgconfig; \
  72. done
  73. manifest:
  74. @echo " * Creation of the manifest"
  75. @cd $(PACKAGE)-bin && find * >> manifest/$(PACKAGE)-bin.mft
  76. @cd $(PACKAGE)-bin && \
  77. echo $(MANIFESTVERBIN) >> manifest/$(PACKAGE)-bin.ver && \
  78. echo $(MANIFESTVERDESC) >> manifest/$(PACKAGE)-bin.ver
  79. @cd $(PACKAGE)-dev && find * >> manifest/$(PACKAGE)-dev.mft
  80. @cd $(PACKAGE)-dev && \
  81. echo $(MANIFESTVERDEV) >> manifest/$(PACKAGE)-dev.ver && \
  82. echo $(MANIFESTVERDESC) >> manifest/$(PACKAGE)-dev.ver
  83. archive:
  84. @echo " * Creation of the archives"
  85. @tar cf $(PACKAGE)-bin.tar $(PACKAGE)-bin
  86. @bzip2 -9 $(PACKAGE)-bin.tar
  87. @tar cf $(PACKAGE)-dev.tar $(PACKAGE)-dev
  88. @bzip2 -9 $(PACKAGE)-dev.tar
  89. clean:
  90. @echo " * Cleaning"
  91. @rm -rf $(PACKAGE)*
  92. help:
  93. @echo
  94. @echo "To create the archives, type:"
  95. @echo " make"
  96. @echo
  97. @echo "To remove everything, type:"
  98. @echo " make clean"
  99. @echo