]> git.saurik.com Git - wxWidgets.git/blame - src/png/scripts/makefile.dec
define NO_GCC_PRAGMA in wx-config output on Darwin
[wxWidgets.git] / src / png / scripts / makefile.dec
CommitLineData
c801d85f 1# makefile for libpng on DEC Alpha Unix
9dfaa473 2# Copyright (C) 2000-2002 Glenn Randers-Pehrson
c801d85f
KB
3# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
4# For conditions of distribution and use, see copyright notice in png.h
5
9dfaa473
GD
6# where make install puts libpng.a and png.h
7prefix=/usr/local
8INCPATH=$(prefix)/include
9LIBPATH=$(prefix)/lib
10MANPATH=$(prefix)/man
11BINPATH=$(prefix)/bin
12
13# override DESTDIR= on the make install command line to easily support
14# installing into a temporary location. Example:
15#
16# make install DESTDIR=/tmp/build/libpng
17#
18# If you're going to install into a temporary location
19# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
20# you execute make install.
21DESTDIR=
22
23DB=$(DESTDIR)$(BINPATH)
24DI=$(DESTDIR)$(INCPATH)
25DL=$(DESTDIR)$(LIBPATH)
26DM=$(DESTDIR)$(MANPATH)
27
c801d85f
KB
28# Where the zlib library and include files are located
29#ZLIBLIB=/usr/local/lib
30#ZLIBINC=/usr/local/include
31ZLIBLIB=../zlib
32ZLIBINC=../zlib
33
9dfaa473
GD
34PNGMAJ = 0
35PNGMIN = 1.2.4
36PNGVER = $(PNGMAJ).$(PNGMIN)
37LIBNAME = libpng12
38
c801d85f
KB
39CC=cc
40CFLAGS=-std -w1 -I$(ZLIBINC) -O # -g -DPNG_DEBUG=1
41LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
42
43#RANLIB=echo
44RANLIB=ranlib
45
c801d85f
KB
46OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
47 pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
48 pngwtran.o pngmem.o pngerror.o pngpread.o
49
9dfaa473 50all: $(LIBNAME).so libpng.a pngtest libpng.pc libpng-config
c801d85f
KB
51
52libpng.a: $(OBJS)
53 ar rc $@ $(OBJS)
54 $(RANLIB) $@
55
9dfaa473
GD
56libpng.pc:
57 cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! > libpng.pc
58
59libpng-config:
60 ( cat scripts/libpng-config-head.in; \
61 echo prefix=\"$(prefix)\"; \
62 echo cppflags=\"-I$(INCPATH)/$(LIBNAME)\"; \
63 echo cflags=\"-std\"; \
64 echo ldflags=\"-L$(LIBPATH)\"; \
65 echo libs=\"-lpng12 -lz -lm\"; \
66 cat scripts/libpng-config-body.in ) > libpng-config
67 chmod +x libpng-config
68
69$(LIBNAME).so: $(LIBNAME).so.$(PNGMAJ)
70 ln -f -s $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so
71
72$(LIBNAME).so.$(PNGMAJ): $(LIBNAME).so.$(PNGVER)
73 ln -f -s $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ)
74
75$(LIBNAME).so.$(PNGVER): $(OBJS)
76 $(CC) -shared -o $@ $(OBJS) -L$(ZLIBLIB)
77 -soname $(LIBNAME).so.$(PNGMAJ) -lz -lm
78
c801d85f
KB
79pngtest: pngtest.o libpng.a
80 $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
81
82test: pngtest
83 ./pngtest
84
9dfaa473
GD
85install-headers: png.h pngconf.h
86 -@if [ ! -d $(DI) ]; then mkdir $(DI); fi
87 -@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
88 cp png.h pngconf.h $(DI)/$(LIBNAME)
89 chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
90 -@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
91 -@/bin/rm -f $(DI)/libpng
92 (cd $(DI); ln -sf $(LIBNAME) libpng; ln -sf $(LIBNAME)/* .)
93
94install-static: install-headers libpng.a
95 -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
96 cp libpng.a $(DL)/$(LIBNAME).a
97 chmod 644 $(DL)/$(LIBNAME).a
98 -@/bin/rm -f $(DL)/libpng.a
99 (cd $(DL); ln -sf $(LIBNAME).a libpng.a)
100
101install-shared: install-headers $(LIBNAME).so.$(PNGVER) libpng.pc
102 -@if [ ! -d $(DL) ]; then mkdir $(DL); fi
103 -@/bin/rm -f $(DL)/$(LIBNAME).so.$(PNGMAJ)* $(DL)/$(LIBNAME).so
104 -@/bin/rm -f $(DL)/libpng.so
105 -@/bin/rm -f $(DL)/libpng.so.3
106 -@/bin/rm -f $(DL)/libpng.so.3.*
107 cp $(LIBNAME).so.$(PNGVER) $(DL)
108 chmod 755 $(DL)/$(LIBNAME).so.$(PNGVER)
109 (cd $(DL); \
110 ln -sf $(LIBNAME).so.$(PNGVER) libpng.so; \
111 ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3; \
112 ln -sf $(LIBNAME).so.$(PNGVER) libpng.so.3.$(PNGMIN); \
113 ln -sf $(LIBNAME).so.$(PNGVER) $(LIBNAME).so.$(PNGMAJ); \
114 ln -sf $(LIBNAME).so.$(PNGMAJ) $(LIBNAME).so)
115 -@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
116 -@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
117 -@/bin/rm -f $(DL)/pkgconfig/libpng.pc
118 cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
119 chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
120 (cd $(DL)/pkgconfig; ln -sf $(LIBNAME).pc libpng.pc)
121
122install-man: libpng.3 libpngpf.3 png.5
123 -@if [ ! -d $(DM) ]; then mkdir $(DM); fi
124 -@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
125 -@/bin/rm -f $(DM)/man3/libpng.3
126 -@/bin/rm -f $(DM)/man3/libpngpf.3
127 cp libpng.3 $(DM)/man3
128 cp libpngpf.3 $(DM)/man3
129 -@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
130 -@/bin/rm -f $(DM)/man5/png.5
131 cp png.5 $(DM)/man5
132
133install-config: libpng-config
134 -@if [ ! -d $(DB) ]; then mkdir $(DB); fi
135 -@/bin/rm -f $(DB)/libpng-config
136 -@/bin/rm -f $(DB)/$(LIBNAME)-config
137 cp libpng-config $(DB)/$(LIBNAME)-config
138 chmod 755 $(DB)/$(LIBNAME)-config
139 (cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
140
141install: install-static install-shared install-man install-config
142
143# If you installed in $(DESTDIR), test-installed won't work until you
144# move the library to its final location.
145
146test-installed:
147 echo
148 echo Testing installed dynamic shared library.
149 $(CC) -std -w1 -I$(ZLIBINC) \
150 `$(BINPATH)/libpng12-config --cppflags --cflags` pngtest.c \
151 -L$(ZLIBLIB) -R$(ZLIBLIB) \
152 -o pngtesti `$(BINPATH)/libpng12-config --ldflags --libs`
153 ./pngtesti pngtest.png
c801d85f
KB
154
155clean:
9dfaa473
GD
156 /bin/rm -f *.o libpng.a pngtest pngtesti pngout.png libpng.pc \
157 libpng-config $(LIBNAME).so $(LIBNAME).so.$(PNGMAJ)*
c801d85f
KB
158
159# DO NOT DELETE THIS LINE -- make depend depends on it.
160
161png.o: png.h pngconf.h
162pngerror.o: png.h pngconf.h
163pngrio.o: png.h pngconf.h
164pngwio.o: png.h pngconf.h
165pngmem.o: png.h pngconf.h
166pngset.o: png.h pngconf.h
167pngget.o: png.h pngconf.h
168pngread.o: png.h pngconf.h
169pngrtran.o: png.h pngconf.h
170pngrutil.o: png.h pngconf.h
171pngtest.o: png.h pngconf.h
172pngtrans.o: png.h pngconf.h
173pngwrite.o: png.h pngconf.h
174pngwtran.o: png.h pngconf.h
175pngwutil.o: png.h pngconf.h
176pngpread.o: png.h pngconf.h
177