File: Makefile

package info (click to toggle)
tuxcmd-modules 0.6.70%2Bds-4
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,872 kB
  • sloc: cpp: 11,743; ansic: 8,064; makefile: 245
file content (188 lines) | stat: -rw-r--r-- 5,326 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# Makefile for ZipArchive library
# Copyright (C) 2000 - 2007 Artpol Software - Tadeusz Dracz
# For conditions of distribution and use, see copyright notice in License.txt
# To install to /usr/lib and /usr/include, type:
#    make install
# to install to a different directory change prefix


#Define this variable to use the bzip2 library provided with the ZipArchive Library
#otherwise, the system's bzip2 library will be used
#INTERNAL_BZIP2 = 1

CC=g++

CCC=cc
#CCC=gcc
	

CFLAGS = -D ZIP_ARCHIVE_LNX 
#CFLAGS =

ifdef INTERNAL_BZIP2
CFLAGS += -D ZIP_ARCHIVE_BZIP2_INTERNAL
endif

ZIPARCHLIB = libziparch.a

ZIPPIELOCATION = ../Zippie/

ZLIBLOCATION = zlib/

ifdef INTERNAL_BZIP2
	BZIP2LOCATION = bzip2/
endif

INCLUDES = -I. -Izlib

ifdef INTERNAL_BZIP2
INCLUDES += -Ibzip2
endif

prefix = /usr
#prefix = 

libdir = ${prefix}/lib
includedir = ${prefix}/include
zipardir = $(includedir)/ziparchive
zlibdir = $(zipardir)/zlib

ifdef INTERNAL_BZIP2
	bzip2dir = $(zipardir)/bzip2
endif

AR=ar rc
RANLIB=ranlib

.SUFFIXES: .c .cpp
.c.o:
	$(CCC) $(CFLAGS) $(INCLUDES) -c -o $*.o $<
.cpp.o:
	$(CC) $(CFLAGS) $(INCLUDES) -c $<

OBJS = $(ZLIBLOCATION)adler32.o $(ZLIBLOCATION)compress.o $(ZLIBLOCATION)crc32.o $(ZLIBLOCATION)uncompr.o $(ZLIBLOCATION)deflate.o $(ZLIBLOCATION)trees.o \
$(ZLIBLOCATION)zutil.o $(ZLIBLOCATION)inflate.o $(ZLIBLOCATION)infback.o $(ZLIBLOCATION)inftrees.o $(ZLIBLOCATION)inffast.o\
ZipArchive.o ZipAutoBuffer.o ZipCentralDir.o \
ZipCompressor.o BaseLibCompressor.o Bzip2Compressor.o DeflateCompressor.o ZipCompatibility.o ZipException.o ZipFile_stl.o ZipFileHeader.o \
ZipMemFile.o ZipPlatformComm.o \
ZipStorage.o ZipString.o ZipExtraData.o ZipExtraField.o \
DirEnumerator.o FileFilter.o Wildcard.o \
ZipCryptograph.o ZipCrc32Cryptograph.o \
Aes.o Hmac.o RandomPool.o ZipAesCryptograph.o Sha1.o

ifdef INTERNAL_BZIP2
	OBJS += $(BZIP2LOCATION)bzlib.o $(BZIP2LOCATION)blocksort.o $(BZIP2LOCATION)bzcompress.o $(BZIP2LOCATION)crctable.o\
	$(BZIP2LOCATION)decompress.o $(BZIP2LOCATION)huffman.o $(BZIP2LOCATION)randtable.o
endif

OBJP = ZipPathComponent_lnx.o ZipPlatform_lnx.o
#OBJP = ZipPathComponent_win.o ZipPlatform_win.o

$(ZIPARCHLIB): $(OBJS) $(OBJP) 
	$(AR) $@ $(OBJS) $(OBJP)
	-@ ($(RANLIB) $@ || true) >/dev/null 2>&1

adler32.o: zlib.h zconf.h
compress.o: zlib.h zconf.h
crc32.o: crc32.h zlib.h zconf.h
deflate.o: deflate.h zutil.h zlib.h zconf.h
inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
uncompr.o: zlib.h zconf.h
zutil.o: zutil.h zlib.h zconf.h

ifdef INTERNAL_BZIP2
	bzlib.o: bzlib.h bzlib_private.h
	blocksort.o: bzlib_private.h
	bzcompress.o: bzlib_private.h
	crctable.o: bzlib_private.h
	decompress.o: bzlib_private.h
	huffman.o: bzlib_private.h
	randtable.o: bzlib_private.h
endif

ZipArchive.o: ZipArchive.h
ZipAutoBuffer.o: ZipAutoBuffer.h
ZipCentralDir.o: ZipCentralDir.h
ZipCompressor.o: ZipCompressor.h
BaseLibCompressor.o: BaseLibCompressor.h
Bzip2Compressor.o: Bzip2Compressor.h
DeflateCompressor.o: DeflateCompressor.h
ZipCompatibility.o: ZipCompatibility.h
ZipException.o: ZipException.h
ZipFile_stl.o: ZipFile.h
ZipFileHeader.o: ZipFileHeader.h
ZipMemFile.o: ZipMemFile.h
ZipStorage.o: ZipStorage.h
ZipString.o: ZipString.h
ZipExtraData.o: ZipExtraData.h
ZipExtraField.o: ZipExtraField.h
DirEnumerator.o: DirEnumerator.cpp
FileFilter.o: FileFilter.cpp
Wildcard.o: Wildcard.cpp
ZipCryptograph.o: ZipCryptograph.h
ZipCrc32Cryptograph.o: ZipCrc32Cryptograph.h
Aes.o: Aes.h
Hmac.o: Hmac.h
RandomPool.o: RandomPool.h
ZipAesCryptograph.o: ZipAesCryptograph.h
Sha1.o: Sha1.h

ZipPathComponent_lnx.o: ZipPathComponent.h
#ZipPathComponent_win.o: ZipPathComponent.h

ZipPlatform_lnx.o: ZipPlatform.h
#ZipPlatform_win.o: ZipPlatform.h


LIBS = -lstdc++ -lziparch

ifndef INTERNAL_BZIP2
	LIBS += -lbz2
endif

clean:
	-rm -f *.o *~ $(ZIPARCHLIB) $(ZLIBLOCATION)*.o $(ZLIBLOCATION)*~ $(BZIP2LOCATION)*.o $(BZIP2LOCATION)*~

zippie:
	$(CC) -I$(zipardir) $(CFLAGS) -o zippie $(ZIPPIELOCATION)zippie.cpp $(ZIPPIELOCATION)CmdLine.cpp $(LIBS)
	#$(CC) -I$(zipardir) -L$(libdir) $(CFLAGS) -o zippie $(ZIPPIELOCATION)zippie.cpp $(ZIPPIELOCATION)CmdLine.cpp $(LIBS)

cleanzippie:
	-rm -f zippie
	#-rm -f zippie.exe

install:
	-@if [ ! -d $(includedir)  ]; then mkdir $(includedir); fi
	-@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
	-@if [ ! -d $(zipardir)  ]; then mkdir $(zipardir); fi
	-@if [ ! -d $(zlibdir)  ]; then mkdir $(zlibdir); fi
	cp libziparch.a $(libdir)
	chmod 755 $(libdir)/$(ZIPARCHLIB)
	cp *.h $(zipardir)
	chmod 644 $(zipardir)/*h
	cp $(ZLIBLOCATION)*.h $(zlibdir)
	chmod 644 $(zlibdir)/*h
ifdef INTERNAL_BZIP2	
	-@if [ ! -d $(bzip2dir)  ]; then mkdir $(bzip2dir); fi
	cp $(BZIP2LOCATION)*.h $(bzip2dir)
	chmod 644 $(bzip2dir)/*h
endif	
	
uninstall:
	rm -f $(zlibdir)/*h	
	rm -f $(zipardir)/*h	
	rm -f $(libdir)/$(ZIPARCHLIB)
	rmdir $(zlibdir)		
	
ifdef INTERNAL_BZIP2	
	rm -f $(bzip2dir)/*h
	rmdir $(bzip2dir)
endif
	rmdir $(zipardir)