beta-0.89.2
[luatex.git] / source / libs / libpng / libpng-src / contrib / pngminim / decoder / makefile
blob4acf3c1779b145bb717b76fcca827c15f069b9a0
1 # Makefile for PngMinus (pngm2pnm)
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 CPPFLAGS=-I. -DPNG_USER_CONFIG -DNO_GZCOMPRESS -DZ_SOLO -DNO_GZIP
18 CFLAGS=-O1 -Wall
20 C=.c
21 O=.o
22 L=.a
25 # Where to find the source code:
26 PNGSRC =../../..
27 ZLIBSRC=$(PNGSRC)/../zlib
28 PROGSRC=$(PNGSRC)/contrib/pngminus
30 # Zlib (minimal inflate requirements - crc32 is used by libpng)
31 # zutil can be eliminated if you provide your own zcalloc and zcfree
32 ZSRCS = adler32$(C) crc32$(C) \
33 inffast$(C) inflate$(C) inftrees$(C) \
34 zutil$(C)
36 # Standard headers
37 ZH = zlib.h crc32.h inffast.h inffixed.h \
38 inflate.h inftrees.h zutil.h
40 # Machine generated headers
41 ZCONF = zconf.h
43 # Headers callers use
44 ZINC = zlib.h $(ZCONF)
46 # Headers the Zlib source uses
47 ZHDRS = $(ZH) $(ZCONF)
49 ZOBJS = adler32$(O) crc32$(O) \
50 inffast$(O) inflate$(O) inftrees$(O) \
51 zutil$(O)
53 # libpng
54 PNGSRCS=png$(C) pngerror$(C) pngget$(C) pngmem$(C) \
55 pngread$(C) pngrio$(C) pngrtran$(C) pngrutil$(C) \
56 pngset$(C) pngtrans$(C)
58 # Standard headers
59 PNGH =png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h
61 # Machine generated headers
62 PNGCONF=pnglibconf.h
64 # Headers callers use
65 PNGINC= png.h pngconf.h pngusr.h $(PNGCONF)
67 # Headers the PNG library uses
68 PNGHDRS=$(PNGH) $(PNGCONF) pngusr.h
70 PNGOBJS=png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
71 pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \
72 pngset$(O) pngtrans$(O)
74 PROGSRCS= pngm2pnm$(C)
75 PROGHDRS=
76 PROGDOCS=
77 PROGOBJS= pngm2pnm$(O)
79 OBJS = $(PROGOBJS) $(PNGOBJS) $(ZOBJS)
81 # implicit make rules -------------------------------------------------------
83 # note: dependencies do not work on implicit rule lines
84 .c$(O):
85 $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
87 # dependencies
89 all: pngm2pnm$(E)
91 pngm2pnm$(E): $(OBJS)
92 $(LD) -o pngm2pnm$(E) $(OBJS)
94 # The DFA_XTRA setting turns all libpng options off then
95 # turns on those required for this minimal build.
96 # The CPP_FLAGS setting causes pngusr.h to be included in
97 # both the build of pnglibconf.h and, subsequently, when
98 # building libpng itself.
99 $(PNGCONF): $(PNGSRC)/scripts/pnglibconf.mak $(ZH)\
100 $(PNGSRC)/scripts/pnglibconf.dfa \
101 $(PNGSRC)/scripts/options.awk pngusr.h pngusr.dfa
102 $(RM) pnglibconf.h pnglibconf.dfn
103 $(MAKE) -f $(PNGSRC)/scripts/pnglibconf.mak $(MAKEFLAGS)\
104 srcdir=$(PNGSRC) CPPFLAGS="-DPNG_USER_CONFIG -I."\
105 DFA_XTRA="pngusr.dfa" $@
107 clean:
108 $(MAKE) -f $(PNGSRC)/scripts/pnglibconf.mak $(MAKEFLAGS)\
109 srcdir=$(PNGSRC) clean
110 $(RM) pngm2pnm$(O)
111 $(RM) pngm2pnm$(E)
112 $(RM) $(OBJS)
114 # distclean also removes the copied source and headers
115 distclean: clean
116 $(RM) -r scripts # historical reasons
117 $(RM) $(PNGSRCS) $(PNGH)
118 $(RM) $(ZSRCS) $(ZH) $(ZCONF)
119 $(RM) $(PROGSRCS) $(PROGHDRS) $(PROGDOCS)
121 # Header file dependencies:
122 $(PROGOBJS): $(PROGHDRS) $(PNGINC) $(ZINC)
123 $(PNGOBJS): $(PNGHDRS) $(ZINC)
124 $(ZOBJS): $(ZHDRS)
126 # Gather the source code from the respective directories
127 $(PNGSRCS) $(PNGH): $(PNGSRC)/$@
128 $(RM) $@
129 $(COPY) $(PNGSRC)/$@ $@
131 # No dependency on the ZLIBSRC target so that it only needs
132 # to be specified once.
133 $(ZSRCS) $(ZH):
134 $(RM) $@
135 $(COPY) $(ZLIBSRC)/$@ $@
137 # The unconfigured zconf.h varies in name according to the
138 # zlib release
139 $(ZCONF):
140 $(RM) $@
141 @for f in zconf.h.in zconf.in.h zconf.h; do\
142 test -r $(ZLIBSRC)/$$f &&\
143 echo $(COPY) $(ZLIBSRC)/$$f $@ &&\
144 $(COPY) $(ZLIBSRC)/$$f $@ && exit 0;\
145 done; echo copy: $(ZLIBSRC)/zconf.h not found; exit 1
147 pngm2pnm.c: $(PROGSRC)/png2pnm.c
148 $(RM) $@
149 $(COPY) $(PROGSRC)/png2pnm.c $@
151 # End of makefile for pngm2pnm