Debian Codegraph @

Makefile

raw ◀ ▶
3 Debian patches touch this file
1 # ============================================================================
2 # gzstream, C++ iostream classes wrapping the zlib compression library.
3 # Copyright (C) 2001 Deepak Bandyopadhyay, Lutz Kettner
4 #
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
9 #
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # ============================================================================
19 #
20 # File : Makefile
21 # Revision : $Revision: 1.3 $
22 # Revision_date : $Date: 2001/10/04 15:09:28 $
23 # Author(s) : Deepak Bandyopadhyay, Lutz Kettner
24 #
25 # ============================================================================
26
•27 SOVERSION=0
28
29 # ----------------------------------------------------------------------------
30 # adapt these settings to your need:
31 # add '-DGZSTREAM_NAMESPACE=name' to CPPFLAGS to place the classes
32 # in its own namespace. Note, this macro needs to be set while creating
33 # the library as well while compiling applications based on it.
34 # As an alternative, gzstream.C and gzstream.h can be edited.
35 # ----------------------------------------------------------------------------
36
37 # CXX = CC -n32 -LANG:std # for SGI Irix 6.5, MIPSpro CC version 7.30
38 CXX = g++ # for Linux RedHat 6.1, g++ version 2.95.2
39
•40 CXXFLAGS+= -g -O2 -fstack-protector-strong -Wformat -Werror=format-security
41 CPPFLAGS+= -I. -O
42 LDFLAGS += -L. -lgzstream -lz
43 AR = ar cr
44
45 # ----------------------------------------------------------------------------
46 # plain simple rules to make and cleanup the library:
47 # make default; compiles the library
48 # make test; compiles and executes test. O.K. message marks success.
49 # make clean; removes temporary files
50 # make cleanall; removes temporary files, the library, and programs
51 # ----------------------------------------------------------------------------
52
•53 default: libgzstream.a libgzstream.so
54
55 test: test_gzip test_gunzip
•56 LD_LIBRARY_PATH=".:$$LD_LIBRARY_PATH" ./test_gzip COPYING.LIB gz.tmp.gz
57 gunzip gz.tmp.gz
58 diff COPYING.LIB gz.tmp
59 gzip gz.tmp
•60 LD_LIBRARY_PATH=".:$$LD_LIBRARY_PATH" ./test_gunzip gz.tmp.gz gz.tmp
61 diff COPYING.LIB gz.tmp
62 rm gz.tmp.gz gz.tmp
63 # *** O.K. Test finished successfully. ***
64
65 install: libgzstream.a test
66 cp libgzstream.a /usr/lib
67 cp gzstream.h /usr/include
68 chmod o+r /usr/include/gzstream.h
69 # *** O.K. Installation finished successfully. ***
70
71 gzstream.o : gzstream.C gzstream.h
•72 ${CXX} $(CFLAGS) ${CPPFLAGS} -c -o gzstream.o gzstream.C
73
74 test_gzip.o : test_gzip.C gzstream.h
•75 ${CXX} $(CFLAGS) ${CPPFLAGS} -c -o test_gzip.o test_gzip.C
76
77 test_gunzip.o : test_gunzip.C gzstream.h
•78 ${CXX} $(CFLAGS) ${CPPFLAGS} -c -o test_gunzip.o test_gunzip.C
79
80 libgzstream.a : gzstream.o
81 ${AR} libgzstream.a gzstream.o
82
•83 libgzstream.so : gzstream.C gzstream.h
•84 ${CXX} ${CPPFLAGS} ${CXXFLAGS} -fPIC -c -o gzstream.o gzstream.C
85 ${CXX} ${LDFLAGS} -shared -Wl,-soname,$@.$(SOVERSION) -o $@.$(SOVERSION) gzstream.o
86 ln -s $@.$(SOVERSION) $@
87
88 test_gzip : test_gzip.o libgzstream.a
89 ${CXX} -o test_gzip test_gzip.o ${LDFLAGS}
90
91 test_gunzip : test_gunzip.o libgzstream.a
92 ${CXX} -o test_gunzip test_gunzip.o ${LDFLAGS}
93
94 clean :
•95 rm -f *.o
96
97 cleanall :
•98 rm -f *.o libgzstream.a test_gzip test_gunzip
99
100 uninstall:
101 rm /usr/include/gzstream.h /usr/lib/libgzstream.a
102
103 # ============================================================================
104 # EOF
105