The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 1 | # makefile for libpng using gcc (generic, static library) |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 2 | # Copyright (C) 2008, 2014 Glenn Randers-Pehrson |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 3 | # Copyright (C) 2000 Cosmin Truta |
| 4 | # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. |
Patrick Scott | 5f6bd84 | 2010-06-28 16:55:16 -0400 | [diff] [blame] | 5 | # |
Patrick Scott | a0bb96c | 2009-07-22 11:50:02 -0400 | [diff] [blame] | 6 | # 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 Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 9 | |
| 10 | # Location of the zlib library and include files |
| 11 | ZLIBINC = ../zlib |
| 12 | ZLIBLIB = ../zlib |
| 13 | |
| 14 | # Compiler, linker, lib and other tools |
| 15 | CC = gcc |
| 16 | LD = $(CC) |
| 17 | AR_RC = ar rcs |
| 18 | RANLIB = ranlib |
| 19 | RM_F = rm -f |
| 20 | |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 21 | WARNMORE = -Wwrite-strings -Wpointer-arith -Wshadow \ |
| 22 | -Wmissing-declarations -Wtraditional -Wcast-align \ |
| 23 | -Wstrict-prototypes -Wmissing-prototypes # -Wconversion |
| 24 | CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5 |
| 25 | CFLAGS = -W -Wall -O2 # $(WARNMORE) -g |
| 26 | LDFLAGS = |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 27 | LIBS = -lz -lm |
| 28 | |
| 29 | # File extensions |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 30 | EXEEXT = |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 31 | |
| 32 | # Variables |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 33 | OBJS = 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 Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 36 | |
| 37 | # Targets |
| 38 | all: static |
| 39 | |
Chris Craik | b50c217 | 2013-07-29 15:28:30 -0700 | [diff] [blame] | 40 | # see scripts/pnglibconf.mak for more options |
| 41 | pnglibconf.h: scripts/pnglibconf.h.prebuilt |
| 42 | cp scripts/pnglibconf.h.prebuilt $@ |
| 43 | |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 44 | .c.o: |
| 45 | $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 46 | |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 47 | static: libpng.a pngtest$(EXEEXT) |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 48 | |
| 49 | shared: |
| 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 Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 54 | libpng.a: $(OBJS) |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 55 | $(AR_RC) $@ $(OBJS) |
| 56 | $(RANLIB) $@ |
| 57 | |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 58 | test: pngtest$(EXEEXT) |
| 59 | ./pngtest$(EXEEXT) |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 60 | |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 61 | pngtest$(EXEEXT): pngtest.o libpng.a |
| 62 | $(LD) $(LDFLAGS) -L$(ZLIBLIB) -o $@ pngtest.o libpng.a $(LIBS) |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 63 | |
| 64 | clean: |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 65 | $(RM_F) *.o libpng.a pngtest$(EXEEXT) pngout.png pnglibconf.h |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 66 | |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 67 | png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 68 | pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 69 | pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 70 | pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 71 | pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 72 | pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 73 | pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 74 | pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 75 | pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 76 | pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 77 | pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 78 | pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 79 | pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 80 | pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 81 | pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
The Android Open Source Project | 893912b | 2009-03-03 19:30:05 -0800 | [diff] [blame] | 82 | |
Sireesh Tripurari | b478e66 | 2014-05-09 15:15:10 +0530 | [diff] [blame] | 83 | pngtest.o: png.h pngconf.h pnglibconf.h |