blob: a592294fc4506a82b509e37c6b69501e5662fa32 [file] [log] [blame]
The Android Open Source Project893912b2009-03-03 19:30:05 -08001# makefile for libpng using gcc (generic, static library)
Sireesh Tripurarib478e662014-05-09 15:15:10 +05302# Copyright (C) 2008, 2014 Glenn Randers-Pehrson
The Android Open Source Project893912b2009-03-03 19:30:05 -08003# Copyright (C) 2000 Cosmin Truta
4# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
Patrick Scott5f6bd842010-06-28 16:55:16 -04005#
Patrick Scotta0bb96c2009-07-22 11:50:02 -04006# This code is released under the libpng license.
7# For conditions of distribution and use, see the disclaimer
8# and license in png.h
The Android Open Source Project893912b2009-03-03 19:30:05 -08009
10# Location of the zlib library and include files
11ZLIBINC = ../zlib
12ZLIBLIB = ../zlib
13
14# Compiler, linker, lib and other tools
15CC = gcc
16LD = $(CC)
17AR_RC = ar rcs
18RANLIB = ranlib
19RM_F = rm -f
20
Sireesh Tripurarib478e662014-05-09 15:15:10 +053021WARNMORE = -Wwrite-strings -Wpointer-arith -Wshadow \
22 -Wmissing-declarations -Wtraditional -Wcast-align \
23 -Wstrict-prototypes -Wmissing-prototypes # -Wconversion
24CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
25CFLAGS = -W -Wall -O2 # $(WARNMORE) -g
26LDFLAGS =
The Android Open Source Project893912b2009-03-03 19:30:05 -080027LIBS = -lz -lm
28
29# File extensions
Sireesh Tripurarib478e662014-05-09 15:15:10 +053030EXEEXT =
The Android Open Source Project893912b2009-03-03 19:30:05 -080031
32# Variables
Sireesh Tripurarib478e662014-05-09 15:15:10 +053033OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
34 pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
35 pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
The Android Open Source Project893912b2009-03-03 19:30:05 -080036
37# Targets
38all: static
39
Chris Craikb50c2172013-07-29 15:28:30 -070040# see scripts/pnglibconf.mak for more options
41pnglibconf.h: scripts/pnglibconf.h.prebuilt
42 cp scripts/pnglibconf.h.prebuilt $@
43
Sireesh Tripurarib478e662014-05-09 15:15:10 +053044.c.o:
45 $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
The Android Open Source Project893912b2009-03-03 19:30:05 -080046
Sireesh Tripurarib478e662014-05-09 15:15:10 +053047static: libpng.a pngtest$(EXEEXT)
The Android Open Source Project893912b2009-03-03 19:30:05 -080048
49shared:
50 @echo This is a generic makefile that cannot create shared libraries.
51 @echo Please use a configuration that is specific to your platform.
52 @false
53
Sireesh Tripurarib478e662014-05-09 15:15:10 +053054libpng.a: $(OBJS)
The Android Open Source Project893912b2009-03-03 19:30:05 -080055 $(AR_RC) $@ $(OBJS)
56 $(RANLIB) $@
57
Sireesh Tripurarib478e662014-05-09 15:15:10 +053058test: pngtest$(EXEEXT)
59 ./pngtest$(EXEEXT)
The Android Open Source Project893912b2009-03-03 19:30:05 -080060
Sireesh Tripurarib478e662014-05-09 15:15:10 +053061pngtest$(EXEEXT): pngtest.o libpng.a
62 $(LD) $(LDFLAGS) -L$(ZLIBLIB) -o $@ pngtest.o libpng.a $(LIBS)
The Android Open Source Project893912b2009-03-03 19:30:05 -080063
64clean:
Sireesh Tripurarib478e662014-05-09 15:15:10 +053065 $(RM_F) *.o libpng.a pngtest$(EXEEXT) pngout.png pnglibconf.h
The Android Open Source Project893912b2009-03-03 19:30:05 -080066
Sireesh Tripurarib478e662014-05-09 15:15:10 +053067png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
68pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
69pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
70pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
71pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
72pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
73pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
74pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
75pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
76pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
77pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
78pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
79pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
80pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
81pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
The Android Open Source Project893912b2009-03-03 19:30:05 -080082
Sireesh Tripurarib478e662014-05-09 15:15:10 +053083pngtest.o: png.h pngconf.h pnglibconf.h