summaryrefslogtreecommitdiff
path: root/todo
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--todo/Makefile-new201
-rw-r--r--todo/README1
2 files changed, 202 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
19CC=cc
20
21CFLAGS=-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
27SFLAGS=$(CFLAGS)
28#SFLAGS=$(CFLAGS) -fPIC
29
30LD=$(CC)
31LDFLAGS=libz.a
32LDSHARED=$(CC)
33CPP=$(CC) -E
34
35STATICLIB=libz.a
36SHAREDLIB=libz.so
37SHAREDLIBV=libz.so.1.2.3
38SHAREDLIBM=libz.so.1
39EXE=
40
41LIBS=$(STATICLIB) $(SHAREDLIBV)
42
43AR=ar rc
44RANLIB=ranlib
45TAR=tar
46SHELL=/bin/sh
47
48prefix=/usr/local
49exec_prefix=${prefix}
50libdir=${exec_prefix}/lib
51includedir=${prefix}/include
52mandir=${prefix}/share/man
53man3dir=${mandir}/man3
54pkgconfigdir = ${libdir}/pkgconfig
55
56OBJS = 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
59OBJA =
60#OBJA = match.o
61# to use the asm code: make OBJA=match.o
62
63TEST_OBJS = example.o minigzip.o
64
65OBJS_PIC = $(OBJS:.o=.pic.o)
66OBJA_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
76all: $(STATICLIB) example$(EXE) minigzip$(EXE)
77#all: $(STATICLIB) $(SHAREDLIBV) example$(EXE) minigzip$(EXE)
78
79check: test
80test: 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
90match.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
96match.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
112example$(EXE): example.o $(STATICLIB)
113 $(LD) -o $@ example.o $(LDFLAGS)
114
115minigzip$(EXE): minigzip.o $(STATICLIB)
116 $(LD) -o $@ minigzip.o $(LDFLAGS)
117
118install: $(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
142uninstall:
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
151mostlyclean: clean
152clean:
153 rm -f *.o *~ example$(EXE) minigzip$(EXE) \
154 libz.* foo.gz so_locations \
155 _match.s maketree contrib/infback9/*.o
156
157maintainer-clean: distclean
158distclean: clean
159 cp -p Makefile.in Makefile
160 cp -p zconf.in.h zconf.h
161 rm -f zlib.pc .DS_Store
162
163tags:
164 etags *.[ch]
165
166depend:
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
174adler32.o: zlib.h zconf.h
175adler32.pic.o: zlib.h zconf.h
176compress.o: zlib.h zconf.h
177compress.pic.o: zlib.h zconf.h
178crc32.o: crc32.h zlib.h zconf.h
179crc32.pic.o: crc32.h zlib.h zconf.h
180deflate.o: deflate.h zutil.h zlib.h zconf.h
181deflate.pic.o: deflate.h zutil.h zlib.h zconf.h
182example.o: zlib.h zconf.h
183example.pic.o: zlib.h zconf.h
184gzio.o: zutil.h zlib.h zconf.h
185gzio.pic.o: zutil.h zlib.h zconf.h
186inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
187inffast.pic.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
188inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
189inflate.pic.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
190infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
191infback.pic.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
192inftrees.o: zutil.h zlib.h zconf.h inftrees.h
193inftrees.pic.o: zutil.h zlib.h zconf.h inftrees.h
194minigzip.o: zlib.h zconf.h
195minigzip.pic.o: zlib.h zconf.h
196trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
197trees.pic.o: deflate.h zutil.h zlib.h zconf.h trees.h
198uncompr.o: zlib.h zconf.h
199uncompr.pic.o: zlib.h zconf.h
200zutil.o: zutil.h zlib.h zconf.h
201zutil.pic.o: zutil.h zlib.h zconf.h
diff --git a/todo/README b/todo/README
new file mode 100644
index 0000000..f87a7df
--- /dev/null
+++ b/todo/README
@@ -0,0 +1 @@
This "todo" directory contains works in progress. Nothing in here works, so don't try to use it!