beta-0.89.2
[luatex.git] / source / libs / libpng / libpng-src / contrib / pngminim / preader / makefile
blobb625199114c76a39cf2e32baff6eb15b52767aba
1 # Makefile for PngMinus (rpng2)
2 # Linux / Unix
4 #CC=cc
5 CC=gcc
6 LD=$(CC)
8 # If awk fails try
9 # make AWK=nawk
11 # If cpp fails try
12 # make CPP=/lib/cpp
14 RM=rm -f
15 COPY=cp
17 #XINC = -I/usr/include # old-style, stock X distributions
18 #XLIB = -L/usr/lib/X11 -lX11 # (including SGI IRIX)
20 #XINC = -I/usr/openwin/include # Sun workstations (OpenWindows)
21 #XLIB = -L/usr/openwin/lib -lX11
23 XINC = -I/usr/X11R6/include # new X distributions (X.org, etc.)
24 XLIB = -L/usr/X11R6/lib -lX11
25 #XLIB = -L/usr/X11R6/lib64 -lX11 # e.g., Red Hat on AMD64
27 #XINC = -I/usr/local/include # FreeBSD
28 #XLIB = -L/usr/local/lib -lX11
30 #LIBS = $(XLIB)
31 LIBS = $(XLIB) -lm #platforms that need libm
33 CPPFLAGS=-I. $(XINC) -DPNG_USER_CONFIG -DNO_GZCOMPRESS -DZ_SOLO -DNO_GZIP
34 CFLAGS=-O1 -Wall
36 C=.c
37 O=.o
38 L=.a
41 # Where to find the source code:
42 PNGSRC =../../..
43 ZLIBSRC=$(PNGSRC)/../zlib
44 PROGSRC=$(PNGSRC)/contrib/gregbook
46 # Zlib (minimal inflate requirements - crc32 is used by libpng)
47 # zutil can be eliminated if you provide your own zcalloc and zcfree
48 ZSRCS = adler32$(C) crc32$(C) \
49 inffast$(C) inflate$(C) inftrees$(C) \
50 zutil$(C)
52 # Standard headers
53 ZH = zlib.h crc32.h inffast.h inffixed.h \
54 inflate.h inftrees.h zutil.h
56 # Machine generated headers
57 ZCONF = zconf.h
59 # Headers callers use
60 ZINC = zlib.h $(ZCONF)
62 # Headers the Zlib source uses
63 ZHDRS = $(ZH) $(ZCONF)
65 ZOBJS = adler32$(O) crc32$(O) \
66 inffast$(O) inflate$(O) inftrees$(O) \
67 zutil$(O)
69 # libpng
70 PNGSRCS=png$(C) pngerror$(C) pngget$(C) pngmem$(C) \
71 pngpread$(C) pngread$(C) pngrio$(C) pngrtran$(C) pngrutil$(C) \
72 pngset$(C) pngtrans$(C)
74 # Standard headers
75 PNGH =png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h
77 # Machine generated headers
78 PNGCONF=pnglibconf.h
80 # Headers callers use
81 PNGINC= png.h pngconf.h pngusr.h $(PNGCONF)
83 # Headers the PNG library uses
84 PNGHDRS=$(PNGH) $(PNGCONF) pngusr.h
86 PNGOBJS=png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
87 pngpread$(O) pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \
88 pngset$(O) pngtrans$(O)
90 PROGSRCS= rpng2-x$(C) readpng2$(C)
91 PROGHDRS= readpng2.h
92 PROGDOCS= COPYING LICENSE
93 PROGOBJS= rpng2-x$(O) readpng2$(O)
95 OBJS = $(PROGOBJS) $(PNGOBJS) $(ZOBJS)
97 # implicit make rules -------------------------------------------------------
99 .c$(O):
100 $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
102 # dependencies
104 all: $(PROGDOCS) rpng2-x$(E)
106 rpng2-x$(E): $(OBJS)
107 $(LD) -o rpng2-x$(E) $(OBJS) $(LIBS)
109 # The DFA_XTRA setting turns all libpng options off then
110 # turns on those required for this minimal build.
111 # The CPP_FLAGS setting causes pngusr.h to be included in
112 # both the build of pnglibconf.h and, subsequently, when
113 # building libpng itself.
114 $(PNGCONF): $(PNGSRC)/scripts/pnglibconf.mak $(ZH)\
115 $(PNGSRC)/scripts/pnglibconf.dfa \
116 $(PNGSRC)/scripts/options.awk pngusr.h pngusr.dfa
117 $(RM) pnglibconf.h pnglibconf.dfn
118 $(MAKE) -f $(PNGSRC)/scripts/pnglibconf.mak $(MAKEFLAGS)\
119 srcdir=$(PNGSRC) CPPFLAGS="-DPNG_USER_CONFIG -I."\
120 DFA_XTRA="pngusr.dfa" $@
122 clean:
123 $(MAKE) -f $(PNGSRC)/scripts/pnglibconf.mak $(MAKEFLAGS)\
124 srcdir=$(PNGSRC) clean
125 $(RM) rpng2-x$(O)
126 $(RM) rpng2-x$(E)
127 $(RM) $(OBJS)
129 # distclean also removes the copied source and headers
130 distclean: clean
131 $(RM) -r scripts # historical reasons
132 $(RM) $(PNGSRCS) $(PNGH)
133 $(RM) $(ZSRCS) $(ZH) $(ZCONF)
134 $(RM) $(PROGSRCS) $(PROGHDRS) $(PROGDOCS)
136 # Header file dependencies:
137 $(PROGOBJS): $(PROGHDRS) $(PNGINC) $(ZINC)
138 $(PNGOBJS): $(PNGHDRS) $(ZINC)
139 $(ZOBJS): $(ZHDRS)
141 # Gather the source code from the respective directories
142 $(PNGSRCS) $(PNGH): $(PNGSRC)/$@
143 $(RM) $@
144 $(COPY) $(PNGSRC)/$@ $@
146 # No dependency on the ZLIBSRC target so that it only needs
147 # to be specified once.
148 $(ZSRCS) $(ZH):
149 $(RM) $@
150 $(COPY) $(ZLIBSRC)/$@ $@
152 # The unconfigured zconf.h varies in name according to the
153 # zlib release
154 $(ZCONF):
155 $(RM) $@
156 @for f in zconf.h.in zconf.in.h zconf.h; do\
157 test -r $(ZLIBSRC)/$$f &&\
158 echo $(COPY) $(ZLIBSRC)/$$f $@ &&\
159 $(COPY) $(ZLIBSRC)/$$f $@ && exit 0;\
160 done; echo copy: $(ZLIBSRC)/zconf.h not found; exit 1
162 $(PROGSRCS) $(PROGHDRS) $(PROGDOCS): $(PROGSRC)/$@
163 $(RM) $@
164 $(COPY) $(PROGSRC)/$@ $@
166 # End of makefile for rpng2-x