summaryrefslogtreecommitdiff
path: root/zip/Makefile
blob: 6beb14b7d35866a4bdbead2b7c7a177f0499c1a9 (plain)
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
# path definitions
DESTDIR = /usr
INSTALL=install -c
INSTALL_DATA = ${INSTALL} -m 644
DIR_ZIPARCHIVE = ./ZipArchive/

# compiler options
CC = gcc
CPP = g++
CFLAGS =-I. -I$(DIR_ZIPARCHIVE) -I/usr/include \
	-Wall -fPIC -O2 -g \
	-DG_DISABLE_DEPRECATED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE \
	-D__VERBOSE_DEBUGx

LIB_SUFFIX=`if test \`uname -m\` = x86_64; then echo 64; fi`


VFS_COMMON_OBJECTS=strutils.o treepathutils.o treepath_vfs.o vfsutils.o

VFS_C_OBJECTS=
VFS_CPP_OBJECTS=zip.o


.SUFFIXES: .c .cpp
.c.o:
	$(CPP) $(CFLAGS) `pkg-config glib-2.0 --cflags` -c $<
.cpp.o:
	$(CPP) $(CFLAGS) `pkg-config glib-2.0 --cflags` -c $<


all shared static: libzip_plugin.so

libzip_plugin.so: ziparchive $(VFS_COMMON_OBJECTS) $(VFS_CPP_OBJECTS) $(VFS_C_OBJECTS)
	$(CPP) -shared -o libzip_plugin.so zip.o $(VFS_COMMON_OBJECTS) $(DIR_ZIPARCHIVE)libziparch.a -lz -lm $(CFLAGS) `pkg-config glib-2.0 --libs`

ziparchive:
	( cd $(DIR_ZIPARCHIVE) && make -f ../Makefile.ziparch ) || exit 1

strutils.o: strutils.c strutils.h
treepathutils.o: treepathutils.c treepathutils.h
vfsutils.o: vfsutils.c vfsutils.h
treepath_vfs.o: treepath_vfs.c treepath_vfs.h


install::
	$(INSTALL) ./libzip_plugin.so $(DESTDIR)/lib$(LIB_SUFFIX)/tuxcmd/

clean: 
	( cd $(DIR_ZIPARCHIVE) && make -f ../Makefile.ziparch clean ) || exit 1
	rm -f *.o *.d *.gch libzip_plugin.so