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