diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:25:27 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:25:27 -0700 |
commit | b1c19ca6d82c98a8be6cd9cad7a9c5fa5e8e634e (patch) | |
tree | f0eeb8f52d07819f417411da5104c9d743dd46de /todo/Makefile-new | |
parent | abf180a067223611620dd97dd5681df7c7fa7c9b (diff) | |
download | zlib-1.2.3.1.tar.gz zlib-1.2.3.1.tar.bz2 zlib-1.2.3.1.zip |
zlib 1.2.3.1v1.2.3.1
Diffstat (limited to 'todo/Makefile-new')
-rw-r--r-- | todo/Makefile-new | 201 |
1 files changed, 201 insertions, 0 deletions
diff --git a/todo/Makefile-new b/todo/Makefile-new new file mode 100644 index 0000000..8a09ebb --- /dev/null +++ b/todo/Makefile-new | |||
@@ -0,0 +1,201 @@ | |||
1 | # Makefile for zlib | ||
2 | # Copyright (C) 1995-2006 Jean-loup Gailly. | ||
3 | # For conditions of distribution and use, see copyright notice in zlib.h | ||
4 | |||
5 | # To compile and test, type: | ||
6 | # ./configure; make test | ||
7 | # The call of configure is optional if you don't have special requirements | ||
8 | # If you wish to build zlib as a shared library, use: ./configure -s | ||
9 | |||
10 | # To use the asm code, type: | ||
11 | # cp contrib/asm?86/match.S ./match.S | ||
12 | # make LOC=-DASMV OBJA=match.o | ||
13 | |||
14 | # To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type: | ||
15 | # make install | ||
16 | # To install in $HOME instead of /usr/local, use: | ||
17 | # make install prefix=$HOME | ||
18 | |||
19 | CC=cc | ||
20 | |||
21 | CFLAGS=-O | ||
22 | #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 | ||
23 | #CFLAGS=-g -DDEBUG | ||
24 | #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ | ||
25 | # -Wstrict-prototypes -Wmissing-prototypes | ||
26 | |||
27 | SFLAGS=$(CFLAGS) | ||
28 | #SFLAGS=$(CFLAGS) -fPIC | ||
29 | |||
30 | LD=$(CC) | ||
31 | LDFLAGS=libz.a | ||
32 | LDSHARED=$(CC) | ||
33 | CPP=$(CC) -E | ||
34 | |||
35 | STATICLIB=libz.a | ||
36 | SHAREDLIB=libz.so | ||
37 | SHAREDLIBV=libz.so.1.2.3 | ||
38 | SHAREDLIBM=libz.so.1 | ||
39 | EXE= | ||
40 | |||
41 | LIBS=$(STATICLIB) $(SHAREDLIBV) | ||
42 | |||
43 | AR=ar rc | ||
44 | RANLIB=ranlib | ||
45 | TAR=tar | ||
46 | SHELL=/bin/sh | ||
47 | |||
48 | prefix=/usr/local | ||
49 | exec_prefix=${prefix} | ||
50 | libdir=${exec_prefix}/lib | ||
51 | includedir=${prefix}/include | ||
52 | mandir=${prefix}/share/man | ||
53 | man3dir=${mandir}/man3 | ||
54 | pkgconfigdir = ${libdir}/pkgconfig | ||
55 | |||
56 | OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ | ||
57 | zutil.o inflate.o infback.o inftrees.o inffast.o | ||
58 | |||
59 | OBJA = | ||
60 | #OBJA = match.o | ||
61 | # to use the asm code: make OBJA=match.o | ||
62 | |||
63 | TEST_OBJS = example.o minigzip.o | ||
64 | |||
65 | OBJS_PIC = $(OBJS:.o=.pic.o) | ||
66 | OBJA_PIC = $(OBJA:.o=.pic.o) | ||
67 | |||
68 | .SUFFIXES: .c .o .pic.o | ||
69 | |||
70 | .c.o: | ||
71 | $(CC) -c $(CFLAGS) -o $@ $*.c | ||
72 | |||
73 | .c.pic.o: | ||
74 | $(CC) -c $(SFLAGS) -o $@ $*.c | ||
75 | |||
76 | all: $(STATICLIB) example$(EXE) minigzip$(EXE) | ||
77 | #all: $(STATICLIB) $(SHAREDLIBV) example$(EXE) minigzip$(EXE) | ||
78 | |||
79 | check: test | ||
80 | test: all | ||
81 | @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ | ||
82 | echo hello world | ./minigzip | ./minigzip -d || \ | ||
83 | echo ' *** minigzip test FAILED ***' ; \ | ||
84 | if ./example; then \ | ||
85 | echo ' *** zlib test OK ***'; \ | ||
86 | else \ | ||
87 | echo ' *** zlib test FAILED ***'; \ | ||
88 | fi | ||
89 | |||
90 | match.o: match.S | ||
91 | $(CPP) match.S > _match.s | ||
92 | $(CC) -c _match.s | ||
93 | mv _match.o match.o | ||
94 | rm -f _match.s | ||
95 | |||
96 | match.pic.o: match.S | ||
97 | $(CPP) match.S > _match.s | ||
98 | $(CC) -c -fPIC _match.s | ||
99 | mv _match.o match.pic.o | ||
100 | rm -f _match.s | ||
101 | |||
102 | $(STATICLIB): $(OBJS) $(OBJA) | ||
103 | $(AR) $@ $(OBJS) $(OBJA) | ||
104 | -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 | ||
105 | |||
106 | $(SHAREDLIBV): $(OBJS_PIC) $(OBJA_PIC) | ||
107 | $(LDSHARED) -o $@ $(OBJS_PIC) $(OBJA_PIC) | ||
108 | rm -f $(SHAREDLIB) $(SHAREDLIBM) | ||
109 | ln -s $@ $(SHAREDLIB) | ||
110 | ln -s $@ $(SHAREDLIBM) | ||
111 | |||
112 | example$(EXE): example.o $(STATICLIB) | ||
113 | $(LD) -o $@ example.o $(LDFLAGS) | ||
114 | |||
115 | minigzip$(EXE): minigzip.o $(STATICLIB) | ||
116 | $(LD) -o $@ minigzip.o $(LDFLAGS) | ||
117 | |||
118 | install: $(LIBS) | ||
119 | mkdir -p $(DESTDIR)$(exec_prefix) | ||
120 | mkdir -p $(DESTDIR)$(includedir) | ||
121 | mkdir -p $(DESTDIR)$(libdir) | ||
122 | mkdir -p $(DESTDIR)$(man3dir) | ||
123 | mkdir -p $(DESTDIR)$(pkgconfigdir) | ||
124 | cp zlib.h zconf.h $(DESTDIR)$(includedir) | ||
125 | chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h | ||
126 | cp $(LIBS) $(DESTDIR)$(libdir) | ||
127 | cd $(DESTDIR)$(libdir); chmod 755 $(LIBS) | ||
128 | -@(cd $(DESTDIR)$(libdir); $(RANLIB) $(STATICLIB) || true) >/dev/null 2>&1 | ||
129 | cd $(DESTDIR)$(libdir); if test -f $(SHAREDLIBV); then \ | ||
130 | rm -f $(SHAREDLIB) $(SHAREDLIBM); \ | ||
131 | ln -s $(SHAREDLIBV) $(SHAREDLIB); \ | ||
132 | ln -s $(SHAREDLIBV) $(SHAREDLIBM); \ | ||
133 | (ldconfig || true) >/dev/null 2>&1; \ | ||
134 | fi | ||
135 | cp zlib.3 $(DESTDIR)$(man3dir) | ||
136 | chmod 644 $(DESTDIR)$(man3dir)/zlib.3 | ||
137 | cp zlib.pc $(DESTDIR)$(pkgconfigdir) | ||
138 | chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc | ||
139 | # The ranlib in install is needed on NeXTSTEP which checks file times | ||
140 | # ldconfig is for Linux | ||
141 | |||
142 | uninstall: | ||
143 | cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h | ||
144 | cd $(DESTDIR)$(libdir); rm -f $(STATICLIB); \ | ||
145 | if test -f $(SHAREDLIBV); then \ | ||
146 | rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \ | ||
147 | fi | ||
148 | cd $(DESTDIR)$(man3dir); rm -f zlib.3 | ||
149 | cd $(DESTDIR)$(pkgconfigdir); rm -f zlib.pc | ||
150 | |||
151 | mostlyclean: clean | ||
152 | clean: | ||
153 | rm -f *.o *~ example$(EXE) minigzip$(EXE) \ | ||
154 | libz.* foo.gz so_locations \ | ||
155 | _match.s maketree contrib/infback9/*.o | ||
156 | |||
157 | maintainer-clean: distclean | ||
158 | distclean: clean | ||
159 | cp -p Makefile.in Makefile | ||
160 | cp -p zconf.in.h zconf.h | ||
161 | rm -f zlib.pc .DS_Store | ||
162 | |||
163 | tags: | ||
164 | etags *.[ch] | ||
165 | |||
166 | depend: | ||
167 | makedepend -- $(CFLAGS) -- *.[ch] | ||
168 | |||
169 | # "fake" targets: not real filenames and no deps (else "touch clean" defeats) | ||
170 | .PHONY: install uninstall clean tags depend | ||
171 | |||
172 | # DO NOT DELETE THIS LINE -- "make depend" depends on it. | ||
173 | |||
174 | adler32.o: zlib.h zconf.h | ||
175 | adler32.pic.o: zlib.h zconf.h | ||
176 | compress.o: zlib.h zconf.h | ||
177 | compress.pic.o: zlib.h zconf.h | ||
178 | crc32.o: crc32.h zlib.h zconf.h | ||
179 | crc32.pic.o: crc32.h zlib.h zconf.h | ||
180 | deflate.o: deflate.h zutil.h zlib.h zconf.h | ||
181 | deflate.pic.o: deflate.h zutil.h zlib.h zconf.h | ||
182 | example.o: zlib.h zconf.h | ||
183 | example.pic.o: zlib.h zconf.h | ||
184 | gzio.o: zutil.h zlib.h zconf.h | ||
185 | gzio.pic.o: zutil.h zlib.h zconf.h | ||
186 | inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h | ||
187 | inffast.pic.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h | ||
188 | inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h | ||
189 | inflate.pic.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h | ||
190 | infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h | ||
191 | infback.pic.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h | ||
192 | inftrees.o: zutil.h zlib.h zconf.h inftrees.h | ||
193 | inftrees.pic.o: zutil.h zlib.h zconf.h inftrees.h | ||
194 | minigzip.o: zlib.h zconf.h | ||
195 | minigzip.pic.o: zlib.h zconf.h | ||
196 | trees.o: deflate.h zutil.h zlib.h zconf.h trees.h | ||
197 | trees.pic.o: deflate.h zutil.h zlib.h zconf.h trees.h | ||
198 | uncompr.o: zlib.h zconf.h | ||
199 | uncompr.pic.o: zlib.h zconf.h | ||
200 | zutil.o: zutil.h zlib.h zconf.h | ||
201 | zutil.pic.o: zutil.h zlib.h zconf.h | ||