Glenn Randers-Pehrson | 520a764 | 2000-03-21 05:13:06 -0600 | [diff] [blame] | 1 | # makefile for libpng using gcc (generic, static library) |
Glenn Randers-Pehrson | 5af0307 | 2014-01-20 12:36:30 -0600 | [diff] [blame] | 2 | # Copyright (C) 2008, 2014 Glenn Randers-Pehrson |
Glenn Randers-Pehrson | 520a764 | 2000-03-21 05:13:06 -0600 | [diff] [blame] | 3 | # Copyright (C) 2000 Cosmin Truta |
Glenn Randers-Pehrson | d436672 | 2000-06-04 14:29:29 -0500 | [diff] [blame] | 4 | # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. |
Glenn Randers-Pehrson | 3e61d79 | 2009-06-24 09:31:28 -0500 | [diff] [blame] | 5 | # |
Glenn Randers-Pehrson | bfbf865 | 2009-06-26 21:46:52 -0500 | [diff] [blame] | 6 | # This code is released under the libpng license. |
Glenn Randers-Pehrson | c332bbc | 2009-06-25 13:43:50 -0500 | [diff] [blame] | 7 | # For conditions of distribution and use, see the disclaimer |
Glenn Randers-Pehrson | 037023b | 2009-06-24 10:27:36 -0500 | [diff] [blame] | 8 | # and license in png.h |
Glenn Randers-Pehrson | 520a764 | 2000-03-21 05:13:06 -0600 | [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) |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 17 | AR_RC = ar rcs |
Glenn Randers-Pehrson | 520a764 | 2000-03-21 05:13:06 -0600 | [diff] [blame] | 18 | RANLIB = ranlib |
Cosmin Truta | 82200da | 2014-03-22 09:29:59 -0500 | [diff] [blame] | 19 | CP = cp |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 20 | RM_F = rm -f |
Glenn Randers-Pehrson | 520a764 | 2000-03-21 05:13:06 -0600 | [diff] [blame] | 21 | |
Glenn Randers-Pehrson | 4250328 | 2014-01-12 10:44:01 -0600 | [diff] [blame] | 22 | WARNMORE = -Wwrite-strings -Wpointer-arith -Wshadow \ |
| 23 | -Wmissing-declarations -Wtraditional -Wcast-align \ |
| 24 | -Wstrict-prototypes -Wmissing-prototypes # -Wconversion |
| 25 | CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5 |
| 26 | CFLAGS = -W -Wall -O2 # $(WARNMORE) -g |
| 27 | LDFLAGS = |
Glenn Randers-Pehrson | beb572e | 2006-08-19 13:59:24 -0500 | [diff] [blame] | 28 | LIBS = -lz -lm |
Glenn Randers-Pehrson | 520a764 | 2000-03-21 05:13:06 -0600 | [diff] [blame] | 29 | |
| 30 | # File extensions |
Glenn Randers-Pehrson | 4250328 | 2014-01-12 10:44:01 -0600 | [diff] [blame] | 31 | EXEEXT = |
Glenn Randers-Pehrson | 520a764 | 2000-03-21 05:13:06 -0600 | [diff] [blame] | 32 | |
Cosmin Truta | 9ab7b4c | 2014-03-22 13:13:11 -0500 | [diff] [blame] | 33 | # Pre-built configuration |
| 34 | # See scripts/pnglibconf.mak for more options |
| 35 | PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt |
| 36 | |
Glenn Randers-Pehrson | 520a764 | 2000-03-21 05:13:06 -0600 | [diff] [blame] | 37 | # Variables |
Glenn Randers-Pehrson | 4250328 | 2014-01-12 10:44:01 -0600 | [diff] [blame] | 38 | OBJS = 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 |
Glenn Randers-Pehrson | 520a764 | 2000-03-21 05:13:06 -0600 | [diff] [blame] | 41 | |
| 42 | # Targets |
Glenn Randers-Pehrson glennrp@comcast.net | 7ecf7bd | 2009-05-02 15:36:08 -0500 | [diff] [blame] | 43 | all: static |
Glenn Randers-Pehrson | beb572e | 2006-08-19 13:59:24 -0500 | [diff] [blame] | 44 | |
Cosmin Truta | 9ab7b4c | 2014-03-22 13:13:11 -0500 | [diff] [blame] | 45 | pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) |
Glenn Randers-Pehrson | ff649a0 | 2014-08-07 19:51:35 -0500 | [diff] [blame] | 46 | $(CP) $(PNGLIBCONF_H_PREBUILT) $@ |
Glenn Randers-Pehrson | 7253144 | 2010-04-17 08:17:51 -0500 | [diff] [blame] | 47 | |
Glenn Randers-Pehrson | 4250328 | 2014-01-12 10:44:01 -0600 | [diff] [blame] | 48 | .c.o: |
| 49 | $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< |
Glenn Randers-Pehrson | beb572e | 2006-08-19 13:59:24 -0500 | [diff] [blame] | 50 | |
Glenn Randers-Pehrson | 4250328 | 2014-01-12 10:44:01 -0600 | [diff] [blame] | 51 | static: libpng.a pngtest$(EXEEXT) |
Glenn Randers-Pehrson | beb572e | 2006-08-19 13:59:24 -0500 | [diff] [blame] | 52 | |
| 53 | shared: |
| 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 |
Glenn Randers-Pehrson | 520a764 | 2000-03-21 05:13:06 -0600 | [diff] [blame] | 57 | |
Glenn Randers-Pehrson | 4250328 | 2014-01-12 10:44:01 -0600 | [diff] [blame] | 58 | libpng.a: $(OBJS) |
Glenn Randers-Pehrson | 5c60b23 | 2006-03-07 07:09:22 -0600 | [diff] [blame] | 59 | $(AR_RC) $@ $(OBJS) |
Glenn Randers-Pehrson | 520a764 | 2000-03-21 05:13:06 -0600 | [diff] [blame] | 60 | $(RANLIB) $@ |
| 61 | |
Glenn Randers-Pehrson | 4250328 | 2014-01-12 10:44:01 -0600 | [diff] [blame] | 62 | test: pngtest$(EXEEXT) |
| 63 | ./pngtest$(EXEEXT) |
Glenn Randers-Pehrson | 520a764 | 2000-03-21 05:13:06 -0600 | [diff] [blame] | 64 | |
Glenn Randers-Pehrson | 4250328 | 2014-01-12 10:44:01 -0600 | [diff] [blame] | 65 | pngtest$(EXEEXT): pngtest.o libpng.a |
| 66 | $(LD) $(LDFLAGS) -L$(ZLIBLIB) -o $@ pngtest.o libpng.a $(LIBS) |
Glenn Randers-Pehrson | 520a764 | 2000-03-21 05:13:06 -0600 | [diff] [blame] | 67 | |
| 68 | clean: |
Glenn Randers-Pehrson | 4250328 | 2014-01-12 10:44:01 -0600 | [diff] [blame] | 69 | $(RM_F) *.o libpng.a pngtest$(EXEEXT) pngout.png pnglibconf.h |
Glenn Randers-Pehrson | 520a764 | 2000-03-21 05:13:06 -0600 | [diff] [blame] | 70 | |
Glenn Randers-Pehrson | 4250328 | 2014-01-12 10:44:01 -0600 | [diff] [blame] | 71 | png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 72 | pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 73 | pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 74 | pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 75 | pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 76 | pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 77 | pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 78 | pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 79 | pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 80 | pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 81 | pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 82 | pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 83 | pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 84 | pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 85 | pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
Glenn Randers-Pehrson glennrp@comcast.net | 7ecf7bd | 2009-05-02 15:36:08 -0500 | [diff] [blame] | 86 | |
Glenn Randers-Pehrson | 4250328 | 2014-01-12 10:44:01 -0600 | [diff] [blame] | 87 | pngtest.o: png.h pngconf.h pnglibconf.h |