]>
Commit | Line | Data |
---|---|---|
1 | # makefile for libpng | |
2 | # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc. | |
3 | # For conditions of distribution and use, see copyright notice in png.h | |
4 | ||
5 | CC=cc | |
6 | CFLAGS=-I../zlib -O | |
7 | LDFLAGS=-L. -L../zlib/ -lpng -lz -lm | |
8 | # flags for ansi2knr | |
9 | ANSI2KNRFLAGS= | |
10 | ||
11 | RANLIB=ranlib | |
12 | #RANLIB=echo | |
13 | ||
14 | # where make install puts libpng.a and png.h | |
15 | prefix=/usr/local | |
16 | ||
17 | OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \ | |
18 | pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \ | |
19 | pngwtran.o pngmem.o pngerror.o pngpread.o | |
20 | ||
21 | all: ansi2knr libpng.a pngtest | |
22 | ||
23 | # general rule to allow ansi2knr to work | |
24 | .c.o: | |
25 | ./ansi2knr $*.c T$*.c | |
26 | $(CC) $(CFLAGS) -c T$*.c | |
27 | rm -f T$*.c $*.o | |
28 | mv T$*.o $*.o | |
29 | ||
30 | ansi2knr: ansi2knr.c | |
31 | $(CC) $(CFLAGS) $(ANSI2KNRFLAGS) -o ansi2knr ansi2knr.c | |
32 | ||
33 | libpng.a: ansi2knr $(OBJS) | |
34 | ar rc $@ $(OBJS) | |
35 | $(RANLIB) $@ | |
36 | ||
37 | pngtest: pngtest.o libpng.a | |
38 | $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS) | |
39 | ||
40 | test: pngtest | |
41 | ./pngtest | |
42 | ||
43 | install: libpng.a | |
44 | -@mkdir $(prefix)/include | |
45 | -@mkdir $(prefix)/lib | |
46 | cp png.h $(prefix)/include | |
47 | cp pngconf.h $(prefix)/include | |
48 | chmod 644 $(prefix)/include/png.h | |
49 | chmod 644 $(prefix)/include/pngconf.h | |
50 | cp libpng.a $(prefix)/lib | |
51 | chmod 644 $(prefix)/lib/libpng.a | |
52 | ||
53 | clean: | |
54 | rm -f *.o libpng.a pngtest pngout.png ansi2knr | |
55 | ||
56 | # DO NOT DELETE THIS LINE -- make depend depends on it. | |
57 | ||
58 | png.o: png.h pngconf.h | |
59 | pngerror.o: png.h pngconf.h | |
60 | pngrio.o: png.h pngconf.h | |
61 | pngwio.o: png.h pngconf.h | |
62 | pngmem.o: png.h pngconf.h | |
63 | pngset.o: png.h pngconf.h | |
64 | pngget.o: png.h pngconf.h | |
65 | pngread.o: png.h pngconf.h | |
66 | pngpread.o: png.h pngconf.h | |
67 | pngrtran.o: png.h pngconf.h | |
68 | pngrutil.o: png.h pngconf.h | |
69 | pngtest.o: png.h pngconf.h | |
70 | pngtrans.o: png.h pngconf.h | |
71 | pngwrite.o: png.h pngconf.h | |
72 | pngwtran.o: png.h pngconf.h | |
73 | pngwutil.o: png.h pngconf.h |