blob: ba92d150931804e3b34ea3cc323844c2adcdaaf3 [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
Matt Sarett9ea75692016-01-08 13:00:42 -050019CP = cp
The Android Open Source Project893912b2009-03-03 19:30:05 -080020RM_F = rm -f
21
Sireesh Tripurarib478e662014-05-09 15:15:10 +053022WARNMORE = -Wwrite-strings -Wpointer-arith -Wshadow \
23 -Wmissing-declarations -Wtraditional -Wcast-align \
24 -Wstrict-prototypes -Wmissing-prototypes # -Wconversion
25CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
26CFLAGS = -W -Wall -O2 # $(WARNMORE) -g
27LDFLAGS =
The Android Open Source Project893912b2009-03-03 19:30:05 -080028LIBS = -lz -lm
29
30# File extensions
Sireesh Tripurarib478e662014-05-09 15:15:10 +053031EXEEXT =
The Android Open Source Project893912b2009-03-03 19:30:05 -080032
Matt Sarett9ea75692016-01-08 13:00:42 -050033# Pre-built configuration
34# See scripts/pnglibconf.mak for more options
35PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
36
The Android Open Source Project893912b2009-03-03 19:30:05 -080037# Variables
Sireesh Tripurarib478e662014-05-09 15:15:10 +053038OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
39 pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
40 pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
The Android Open Source Project893912b2009-03-03 19:30:05 -080041
42# Targets
43all: static
44
Matt Sarett9ea75692016-01-08 13:00:42 -050045pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
46 $(CP) $(PNGLIBCONF_H_PREBUILT) $@
Chris Craikb50c2172013-07-29 15:28:30 -070047
Sireesh Tripurarib478e662014-05-09 15:15:10 +053048.c.o:
49 $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
The Android Open Source Project893912b2009-03-03 19:30:05 -080050
Sireesh Tripurarib478e662014-05-09 15:15:10 +053051static: libpng.a pngtest$(EXEEXT)
The Android Open Source Project893912b2009-03-03 19:30:05 -080052
53shared:
54 @echo This is a generic makefile that cannot create shared libraries.
55 @echo Please use a configuration that is specific to your platform.
56 @false
57
Sireesh Tripurarib478e662014-05-09 15:15:10 +053058libpng.a: $(OBJS)
The Android Open Source Project893912b2009-03-03 19:30:05 -080059 $(AR_RC) $@ $(OBJS)
60 $(RANLIB) $@
61
Sireesh Tripurarib478e662014-05-09 15:15:10 +053062test: pngtest$(EXEEXT)
63 ./pngtest$(EXEEXT)
The Android Open Source Project893912b2009-03-03 19:30:05 -080064
Sireesh Tripurarib478e662014-05-09 15:15:10 +053065pngtest$(EXEEXT): pngtest.o libpng.a
66 $(LD) $(LDFLAGS) -L$(ZLIBLIB) -o $@ pngtest.o libpng.a $(LIBS)
The Android Open Source Project893912b2009-03-03 19:30:05 -080067
68clean:
Sireesh Tripurarib478e662014-05-09 15:15:10 +053069 $(RM_F) *.o libpng.a pngtest$(EXEEXT) pngout.png pnglibconf.h
The Android Open Source Project893912b2009-03-03 19:30:05 -080070
Sireesh Tripurarib478e662014-05-09 15:15:10 +053071png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
72pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
73pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
74pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
75pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
76pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
77pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
78pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
79pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
80pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
81pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
82pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
83pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
84pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
85pngwutil.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 -080086
Sireesh Tripurarib478e662014-05-09 15:15:10 +053087pngtest.o: png.h pngconf.h pnglibconf.h