~random-stuff/libpng/libpng-1.6.x

« back to all changes in this revision

Viewing changes to contrib/pngminim/preader/makefile

  • Committer: Sérgio Benjamim
  • Date: 2015-10-10 23:00:20 UTC
  • Revision ID: sergio_br2@yahoo.com.br-20151010230020-gdtmmv30zn25396n
Update to 1.6.18.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
CC=gcc
6
6
LD=$(CC)
7
7
 
 
8
# If awk fails try
 
9
# make AWK=nawk
 
10
 
 
11
# If cpp fails try
 
12
# make CPP=/lib/cpp
 
13
 
8
14
RM=rm -f
 
15
COPY=cp
9
16
 
10
17
#XINC = -I/usr/include                  # old-style, stock X distributions
11
18
#XLIB = -L/usr/lib/X11 -lX11            #  (including SGI IRIX)
23
30
#LIBS = $(XLIB)
24
31
LIBS = $(XLIB) -lm                      #platforms that need libm
25
32
 
26
 
CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP \
27
 
       -DdeflateParams\(a,b,c\)=Z_OK -I. $(XINC) -O1
 
33
CPPFLAGS=-I. $(XINC) -DPNG_USER_CONFIG -DNO_GZCOMPRESS -DZ_SOLO -DNO_GZIP
 
34
CFLAGS=-O1 -Wall
28
35
 
29
36
C=.c
30
37
O=.o
31
38
L=.a
32
39
E=
33
40
 
 
41
# Where to find the source code:
 
42
PNGSRC =../../..
 
43
ZLIBSRC=$(PNGSRC)/../zlib
 
44
PROGSRC=$(PNGSRC)/contrib/gregbook
 
45
 
 
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)
 
51
 
 
52
# Standard headers
 
53
ZH     = zlib.h crc32.h inffast.h inffixed.h \
 
54
         inflate.h inftrees.h zutil.h
 
55
 
 
56
# Machine generated headers
 
57
ZCONF  = zconf.h
 
58
 
 
59
# Headers callers use
 
60
ZINC   = zlib.h $(ZCONF)
 
61
 
 
62
# Headers the Zlib source uses
 
63
ZHDRS  = $(ZH) $(ZCONF)
 
64
 
34
65
ZOBJS  = adler32$(O) crc32$(O) \
35
 
         infback$(O) inffast$(O) inflate$(O) inftrees$(O) \
36
 
         trees$(O) uncompr$(O) zutil$(O)
37
 
 
38
 
OBJS  = rpng2-x$(O) readpng2$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
 
66
         inffast$(O) inflate$(O) inftrees$(O) \
 
67
         zutil$(O)
 
68
 
 
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)
 
73
 
 
74
# Standard headers
 
75
PNGH   =png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h
 
76
 
 
77
# Machine generated headers
 
78
PNGCONF=pnglibconf.h
 
79
 
 
80
# Headers callers use
 
81
PNGINC= png.h pngconf.h pngusr.h $(PNGCONF)
 
82
 
 
83
# Headers the PNG library uses
 
84
PNGHDRS=$(PNGH) $(PNGCONF) pngusr.h
 
85
 
 
86
PNGOBJS=png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
39
87
        pngpread$(O) pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \
40
 
        pngset$(O) pngtrans$(O)  $(ZOBJS)
 
88
        pngset$(O) pngtrans$(O)
 
89
 
 
90
PROGSRCS= rpng2-x$(C) readpng2$(C)
 
91
PROGHDRS= readpng2.h
 
92
PROGDOCS= COPYING LICENSE
 
93
PROGOBJS= rpng2-x$(O) readpng2$(O)
 
94
 
 
95
OBJS    = $(PROGOBJS) $(PNGOBJS) $(ZOBJS)
41
96
 
42
97
# implicit make rules -------------------------------------------------------
43
98
 
44
 
.c$(O): png.h pngconf.h pngpriv.h readpng2.h pngusr.h zlib.h
45
 
        $(CC) -c $(CFLAGS) $<
 
99
.c$(O):
 
100
        $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
46
101
 
47
102
# dependencies
48
103
 
49
 
all: rpng2-x$(E)
 
104
all: $(PROGDOCS) rpng2-x$(E)
50
105
 
51
106
rpng2-x$(E): $(OBJS)
52
107
        $(LD) -o rpng2-x$(E) $(OBJS) $(LIBS)
53
108
 
 
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" $@
 
121
 
54
122
clean:
 
123
        $(MAKE) -f $(PNGSRC)/scripts/pnglibconf.mak $(MAKEFLAGS)\
 
124
            srcdir=$(PNGSRC) clean
55
125
        $(RM) rpng2-x$(O)
56
126
        $(RM) rpng2-x$(E)
57
127
        $(RM) $(OBJS)
58
128
 
 
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)
 
135
 
 
136
# Header file dependencies:
 
137
$(PROGOBJS): $(PROGHDRS) $(PNGINC) $(ZINC)
 
138
$(PNGOBJS): $(PNGHDRS) $(ZINC)
 
139
$(ZOBJS): $(ZHDRS)
 
140
 
 
141
# Gather the source code from the respective directories
 
142
$(PNGSRCS) $(PNGH): $(PNGSRC)/$@
 
143
        $(RM) $@
 
144
        $(COPY) $(PNGSRC)/$@ $@
 
145
 
 
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)/$@ $@
 
151
 
 
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
 
161
 
 
162
$(PROGSRCS) $(PROGHDRS) $(PROGDOCS): $(PROGSRC)/$@
 
163
        $(RM) $@
 
164
        $(COPY) $(PROGSRC)/$@ $@
 
165
 
59
166
# End of makefile for rpng2-x