fukasawa e60969
# Makefile for creating Windows CE release archives, with the
fukasawa e60969
# mingw32ce compiler.
fukasawa e60969
fukasawa e60969
# Last updated: 22-Jul-2008
fukasawa e60969
fukasawa e60969
# Copyright (C) 2008 Vincent Torri
fukasawa e60969
fukasawa e60969
# This code is released under the libpng license.
fukasawa e60969
# For conditions of distribution and use, see the disclaimer
fukasawa e60969
# and license in png.h
fukasawa e60969
fukasawa e60969
# To get some help, type
fukasawa e60969
#
fukasawa e60969
# make help
fukasawa e60969
#
fukasawa e60969
# To create the archives
fukasawa e60969
#
fukasawa e60969
# make
fukasawa e60969
#
fukasawa e60969
# To remove everything, type:
fukasawa e60969
#
fukasawa e60969
# make clean
fukasawa e60969
fukasawa e60969
VERMAJ = 1
fukasawa e60969
VERMIN = 6
fukasawa e60969
VERMIC = 21
fukasawa e60969
VER = $(VERMAJ).$(VERMIN).$(VERMIC)
fukasawa e60969
NAME = libpng
fukasawa e60969
PACKAGE = $(NAME)-$(VER)
fukasawa e60969
fukasawa e60969
BIN = libpng16-0.dll
fukasawa e60969
LIB = libpng16.a libpng16.dll.a libpng.a libpng.dll.a
fukasawa e60969
INCLUDE = png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
PC = libpng16.pc libpng.pc
fukasawa e60969
fukasawa e60969
MANIFESTVERBIN = "Libpng-$(VER): Binary files"
fukasawa e60969
MANIFESTVERDEV = "Libpng-$(VER): Developer files"
fukasawa e60969
MANIFESTVERDESC = "Libpng: the official PNG reference library"
fukasawa e60969
fukasawa e60969
all: $(NAME)
fukasawa e60969
fukasawa e60969
$(NAME): remove-old copy-src compilation copy manifest archive
fukasawa e60969
	@echo " * Removal of the directories"
fukasawa e60969
	@rm -rf $(PACKAGE)/ $(PACKAGE)-bin/ $(PACKAGE)-dev/
fukasawa e60969
fukasawa e60969
remove-old:
fukasawa e60969
	@echo " * Removal of the old files"
fukasawa e60969
	@rm -rf $(PACKAGE)-bin*
fukasawa e60969
	@rm -rf $(PACKAGE)-dev*
fukasawa e60969
fukasawa e60969
copy-src:
fukasawa e60969
	@echo " * Copy of source files"
fukasawa e60969
	@cp -R ../src/$(PACKAGE) .
fukasawa e60969
	@echo " * Creation of directories and files"
fukasawa e60969
	@mkdir -p $(PACKAGE)-bin/bin
fukasawa e60969
	@mkdir -p $(PACKAGE)-bin/manifest
fukasawa e60969
	@mkdir -p $(PACKAGE)-dev/lib/pkgconfig
fukasawa e60969
	@mkdir -p $(PACKAGE)-dev/include/$(NAME)$(VERMAJ)$(VERMIN)
fukasawa e60969
	@mkdir -p $(PACKAGE)-dev/manifest
fukasawa e60969
	@touch $(PACKAGE)-bin/manifest/$(PACKAGE)-bin.mft
fukasawa e60969
	@touch $(PACKAGE)-bin/manifest/$(PACKAGE)-bin.ver
fukasawa e60969
	@touch $(PACKAGE)-dev/manifest/$(PACKAGE)-dev.mft
fukasawa e60969
	@touch $(PACKAGE)-dev/manifest/$(PACKAGE)-dev.ver
fukasawa e60969
fukasawa e60969
compilation:
fukasawa e60969
	@echo " * Compilation of $(PACKAGE)"
fukasawa e60969
	cd $(PACKAGE) && CPPFLAGS="$(CPPFLAGS) -DPNG_CONSOLE_IO_SUPPORTED -D_WIN32_WCE=0x0420" \
fukasawa e60969
		CFLAGS="$(CFLAGS) -mms-bitfields -O3 -pipe -fomit-frame-pointer" \
fukasawa e60969
		LDFLAGS="$(LDFLAGS) -Wl,--enable-auto-import -Wl,-s" \
fukasawa e60969
		./configure --prefix=/opt/wince --host=arm-mingw32ce && make
fukasawa e60969
fukasawa e60969
copy:
fukasawa e60969
	@echo " * Copy of binary and development files"
fukasawa e60969
	@for i in $(BIN); do \
fukasawa e60969
	  cp $(PACKAGE)/.libs/$$i $(PACKAGE)-bin/bin; \
fukasawa e60969
	done
fukasawa e60969
	@for i in $(LIB); do \
fukasawa e60969
	  cp $(PACKAGE)/.libs/$$i $(PACKAGE)-dev/lib; \
fukasawa e60969
	done
fukasawa e60969
	@for i in $(INCLUDE); do \
fukasawa e60969
	  cp $(PACKAGE)/$$i $(PACKAGE)-dev/include/$(NAME)$(VERMAJ)$(VERMIN); \
fukasawa e60969
	done
fukasawa e60969
	@for i in $(PC); do \
fukasawa e60969
	  cp $(PACKAGE)/$$i $(PACKAGE)-dev/lib/pkgconfig; \
fukasawa e60969
	done
fukasawa e60969
fukasawa e60969
manifest:
fukasawa e60969
	@echo " * Creation of the manifest"
fukasawa e60969
	@cd $(PACKAGE)-bin && find * >> manifest/$(PACKAGE)-bin.mft
fukasawa e60969
	@cd $(PACKAGE)-bin && \
fukasawa e60969
	  echo $(MANIFESTVERBIN) >> manifest/$(PACKAGE)-bin.ver && \
fukasawa e60969
	  echo $(MANIFESTVERDESC) >> manifest/$(PACKAGE)-bin.ver
fukasawa e60969
	@cd $(PACKAGE)-dev && find * >> manifest/$(PACKAGE)-dev.mft
fukasawa e60969
	@cd $(PACKAGE)-dev && \
fukasawa e60969
	  echo $(MANIFESTVERDEV) >> manifest/$(PACKAGE)-dev.ver && \
fukasawa e60969
	  echo $(MANIFESTVERDESC) >> manifest/$(PACKAGE)-dev.ver
fukasawa e60969
fukasawa e60969
archive:
fukasawa e60969
	@echo " * Creation of the archives"
fukasawa e60969
	@tar cf $(PACKAGE)-bin.tar $(PACKAGE)-bin
fukasawa e60969
	@bzip2 -9 $(PACKAGE)-bin.tar
fukasawa e60969
	@tar cf $(PACKAGE)-dev.tar $(PACKAGE)-dev
fukasawa e60969
	@bzip2 -9 $(PACKAGE)-dev.tar
fukasawa e60969
fukasawa e60969
clean:
fukasawa e60969
	@echo " * Cleaning"
fukasawa e60969
	@rm -rf $(PACKAGE)*
fukasawa e60969
fukasawa e60969
help:
fukasawa e60969
	@echo
fukasawa e60969
	@echo "To create the archives, type:"
fukasawa e60969
	@echo " make"
fukasawa e60969
	@echo
fukasawa e60969
	@echo "To remove everything, type:"
fukasawa e60969
	@echo " make clean"
fukasawa e60969
	@echo