1 | # makefile for libpng using gcc (generic, static library)
|
---|
2 | # Copyright (C) 2000, 2020-2024 Cosmin Truta
|
---|
3 | # Copyright (C) 2002, 2006-2009, 2014 Glenn Randers-Pehrson
|
---|
4 | # Copyright (C) 2000 Marc O. Gloor (AIX support added, from makefile.gcc)
|
---|
5 | # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
---|
6 | #
|
---|
7 | # This code is released under the libpng license.
|
---|
8 | # For conditions of distribution and use, see the disclaimer
|
---|
9 | # and license in png.h
|
---|
10 |
|
---|
11 | # Location of the zlib library and include files
|
---|
12 | ZLIBINC = ../zlib
|
---|
13 | ZLIBLIB = ../zlib
|
---|
14 |
|
---|
15 | # Compiler, linker, lib and other tools
|
---|
16 | CC = gcc
|
---|
17 | LD = $(CC)
|
---|
18 | AR = ar
|
---|
19 | RANLIB = ranlib
|
---|
20 | RM_F = rm -f
|
---|
21 |
|
---|
22 | LIBNAME = libpng16
|
---|
23 | PNGMAJ = 16
|
---|
24 |
|
---|
25 | WARNMORE =
|
---|
26 | CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
|
---|
27 | CFLAGS = -O2 -Wall -Wextra -Wundef # $(WARNMORE) -g
|
---|
28 | ARFLAGS = rc
|
---|
29 | LDFLAGS = -L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g
|
---|
30 |
|
---|
31 | # File lists
|
---|
32 | OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
|
---|
33 | pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
|
---|
34 | pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
|
---|
35 |
|
---|
36 | # Targets
|
---|
37 | .c.o:
|
---|
38 | $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
---|
39 |
|
---|
40 | all: $(LIBNAME).a pngtest
|
---|
41 |
|
---|
42 | include scripts/pnglibconf.mak
|
---|
43 | REMOVE = $(RM_F)
|
---|
44 | DFNFLAGS = $(DEFS) $(CPPFLAGS)
|
---|
45 |
|
---|
46 | $(LIBNAME).a: $(OBJS)
|
---|
47 | $(AR) $(ARFLAGS) $@ $(OBJS)
|
---|
48 | $(RANLIB) $@
|
---|
49 |
|
---|
50 | test: pngtest
|
---|
51 | ./pngtest
|
---|
52 |
|
---|
53 | pngtest: pngtest.o $(LIBNAME).a
|
---|
54 | $(LD) -o $@ pngtest.o $(LDFLAGS)
|
---|
55 |
|
---|
56 | install:
|
---|
57 | @echo "The $@ target is no longer supported by this makefile."
|
---|
58 | @false
|
---|
59 |
|
---|
60 | clean:
|
---|
61 | $(RM_F) *.o $(LIBNAME).a pngtest pngout.png pnglibconf.h
|
---|
62 |
|
---|
63 | png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
64 | pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
65 | pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
66 | pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
67 | pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
68 | pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
69 | pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
70 | pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
71 | pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
72 | pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
73 | pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
74 | pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
75 | pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
76 | pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
77 | pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
78 |
|
---|
79 | pngtest.o: png.h pngconf.h pnglibconf.h
|
---|