makefile.cegcc 3.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
# Makefile for creating Windows CE release archives, with the
# mingw32ce compiler.

# Last updated: 22-Jul-2008

# Copyright (C) 2008 Vincent Torri

# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h

# To get some help, type
#
# make help
#
# To create the archives
#
# make
#
# To remove everything, type:
#
# make clean

VERMAJ = 1
25 26
VERMIN = 4
VERMIC = 0
27 28 29 30
VER = $(VERMAJ).$(VERMIN).$(VERMIC)
NAME = libpng
PACKAGE = $(NAME)-$(VER)

31 32 33 34
BIN = libpng14-0.dll libpng-14.dll
LIB = libpng14.a libpng14.dll.a libpng.a libpng.dll.a scripts/png32ce.def
INCLUDE = png.h pngconf.h pngpriv.h
PC = libpng14.pc libpng.pc
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66

MANIFESTVERBIN = "Libpng-$(VER): Binary files"
MANIFESTVERDEV = "Libpng-$(VER): Developer files"
MANIFESTVERDESC = "Libpng: the official PNG reference library"

all: $(NAME)

$(NAME): remove-old copy-src compilation copy manifest archive
	@echo " * Removal of the directories"
	@rm -rf $(PACKAGE)/ $(PACKAGE)-bin/ $(PACKAGE)-dev/

remove-old:
	@echo " * Removal of the old files"
	@rm -rf $(PACKAGE)-bin*
	@rm -rf $(PACKAGE)-dev*

copy-src:
	@echo " * Copy of source files"
	@cp -R ../src/$(PACKAGE) .
	@echo " * Creation of directories and files"
	@mkdir -p $(PACKAGE)-bin/bin
	@mkdir -p $(PACKAGE)-bin/manifest
	@mkdir -p $(PACKAGE)-dev/lib/pkgconfig
	@mkdir -p $(PACKAGE)-dev/include/$(NAME)$(VERMAJ)$(VERMIN)
	@mkdir -p $(PACKAGE)-dev/manifest
	@touch $(PACKAGE)-bin/manifest/$(PACKAGE)-bin.mft
	@touch $(PACKAGE)-bin/manifest/$(PACKAGE)-bin.ver
	@touch $(PACKAGE)-dev/manifest/$(PACKAGE)-dev.mft
	@touch $(PACKAGE)-dev/manifest/$(PACKAGE)-dev.ver

compilation:
	@echo " * Compilation of $(PACKAGE)"
67
	cd $(PACKAGE) && CPPFLAGS="$(CPPFLAGS) -DPNG_BUILD_DLL -DPNG_CONSOLE_IO_SUPPORTED -DPNG_NO_MMX_CODE -D_WIN32_WCE=0x0420" CFLAGS="$(CFLAGS) -mms-bitfields -O3 -pipe -fomit-frame-pointer" LDFLAGS="$(LDFLAGS) -Wl,--enable-auto-import -Wl,-s" ./configure --prefix=/opt/wince --host=arm-mingw32ce && make
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113

copy:
	@echo " * Copy of binary and development files"
	@for i in $(BIN); do \
	  cp $(PACKAGE)/.libs/$$i $(PACKAGE)-bin/bin; \
	done
	@for i in $(LIB); do \
	  cp $(PACKAGE)/.libs/$$i $(PACKAGE)-dev/lib; \
	done
	@for i in $(INCLUDE); do \
	  cp $(PACKAGE)/$$i $(PACKAGE)-dev/include/$(NAME)$(VERMAJ)$(VERMIN); \
	done
	@for i in $(PC); do \
	  cp $(PACKAGE)/$$i $(PACKAGE)-dev/lib/pkgconfig; \
	done

manifest:
	@echo " * Creation of the manifest"
	@cd $(PACKAGE)-bin && find * >> manifest/$(PACKAGE)-bin.mft
	@cd $(PACKAGE)-bin && \
	  echo $(MANIFESTVERBIN) >> manifest/$(PACKAGE)-bin.ver && \
	  echo $(MANIFESTVERDESC) >> manifest/$(PACKAGE)-bin.ver
	@cd $(PACKAGE)-dev && find * >> manifest/$(PACKAGE)-dev.mft
	@cd $(PACKAGE)-dev && \
	  echo $(MANIFESTVERDEV) >> manifest/$(PACKAGE)-dev.ver && \
	  echo $(MANIFESTVERDESC) >> manifest/$(PACKAGE)-dev.ver

archive:
	@echo " * Creation of the archives"
	@tar cf $(PACKAGE)-bin.tar $(PACKAGE)-bin
	@bzip2 -9 $(PACKAGE)-bin.tar
	@tar cf $(PACKAGE)-dev.tar $(PACKAGE)-dev
	@bzip2 -9 $(PACKAGE)-dev.tar

clean:
	@echo " * Cleaning"
	@rm -rf $(PACKAGE)*

help:
	@echo
	@echo "To create the archives, type:"
	@echo " make"
	@echo
	@echo "To remove everything, type:"
	@echo " make clean"
	@echo