]>
Commit | Line | Data |
---|---|---|
0272a10d | 1 | # makefile for libpng using gcc (generic, static library) |
970f6abe | 2 | # Copyright (C) 2008 Glenn Randers-Pehrson |
0272a10d VZ |
3 | # Copyright (C) 2000 Cosmin Truta |
4 | # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. | |
5 | # For conditions of distribution and use, see copyright notice in png.h | |
6 | ||
7 | # Location of the zlib library and include files | |
8 | ZLIBINC = ../zlib | |
9 | ZLIBLIB = ../zlib | |
10 | ||
11 | # Compiler, linker, lib and other tools | |
12 | CC = gcc | |
13 | LD = $(CC) | |
14 | AR_RC = ar rcs | |
15 | RANLIB = ranlib | |
16 | RM_F = rm -f | |
17 | ||
18 | CDEBUG = -g -DPNG_DEBUG=5 | |
19 | LDDEBUG = | |
20 | CRELEASE = -O2 | |
21 | LDRELEASE = -s | |
970f6abe VZ |
22 | #CFLAGS = -W -Wall $(CDEBUG) |
23 | CFLAGS = -W -Wall $(CRELEASE) | |
0272a10d VZ |
24 | #LDFLAGS = $(LDDEBUG) |
25 | LDFLAGS = $(LDRELEASE) | |
26 | LIBS = -lz -lm | |
27 | ||
28 | # File extensions | |
29 | O=.o | |
30 | A=.a | |
31 | EXE= | |
32 | ||
33 | # Variables | |
34 | OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \ | |
35 | pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \ | |
36 | pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O) | |
37 | ||
38 | # Targets | |
39 | all: static | |
40 | ||
41 | .c$(O): | |
42 | $(CC) -c $(CFLAGS) -I$(ZLIBINC) $< | |
43 | ||
44 | static: libpng$(A) pngtest$(EXE) | |
45 | ||
46 | shared: | |
47 | @echo This is a generic makefile that cannot create shared libraries. | |
48 | @echo Please use a configuration that is specific to your platform. | |
49 | @false | |
50 | ||
51 | libpng$(A): $(OBJS) | |
52 | $(AR_RC) $@ $(OBJS) | |
53 | $(RANLIB) $@ | |
54 | ||
55 | test: pngtest$(EXE) | |
56 | ./pngtest$(EXE) | |
57 | ||
58 | pngtest$(EXE): pngtest$(O) libpng$(A) | |
59 | $(LD) $(LDFLAGS) -L$(ZLIBLIB) -o $@ pngtest$(O) libpng$(A) $(LIBS) | |
60 | ||
61 | clean: | |
62 | $(RM_F) *$(O) libpng$(A) pngtest$(EXE) pngout.png | |
63 | ||
64 | png$(O): png.h pngconf.h | |
65 | pngerror$(O): png.h pngconf.h | |
66 | pngget$(O): png.h pngconf.h | |
67 | pngmem$(O): png.h pngconf.h | |
68 | pngpread$(O): png.h pngconf.h | |
69 | pngread$(O): png.h pngconf.h | |
70 | pngrio$(O): png.h pngconf.h | |
71 | pngrtran$(O): png.h pngconf.h | |
72 | pngrutil$(O): png.h pngconf.h | |
73 | pngset$(O): png.h pngconf.h | |
74 | pngtest$(O): png.h pngconf.h | |
75 | pngtrans$(O): png.h pngconf.h | |
76 | pngwio$(O): png.h pngconf.h | |
77 | pngwrite$(O): png.h pngconf.h | |
78 | pngwtran$(O): png.h pngconf.h | |
79 | pngwutil$(O): png.h pngconf.h | |
80 |