summaryrefslogtreecommitdiff
path: root/unrar/Makefile
blob: 32e1906c8ceba1efc725c499f5b3e7288de8f09c (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# path definitions
DESTDIR = /usr
INSTALL=install -c
INSTALL_DATA = ${INSTALL} -m 644
DIR_UNRAR = unrar

# compiler options
CC = gcc
CPP = g++
CFLAGS =-I. -I/usr/include -I$(DIR_UNRAR) \
	-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`


UNRAR_LIB_OBJ=$(DIR_UNRAR)/filestr.o $(DIR_UNRAR)/scantree.o $(DIR_UNRAR)/dll.o

UNRAR_OBJECTS=$(DIR_UNRAR)/rar.o $(DIR_UNRAR)/strlist.o $(DIR_UNRAR)/strfn.o \
	$(DIR_UNRAR)/pathfn.o $(DIR_UNRAR)/int64.o $(DIR_UNRAR)/savepos.o \
	$(DIR_UNRAR)/global.o $(DIR_UNRAR)/file.o $(DIR_UNRAR)/filefn.o \
	$(DIR_UNRAR)/filcreat.o $(DIR_UNRAR)/archive.o $(DIR_UNRAR)/arcread.o \
	$(DIR_UNRAR)/unicode.o $(DIR_UNRAR)/system.o $(DIR_UNRAR)/isnt.o \
	$(DIR_UNRAR)/crypt.o $(DIR_UNRAR)/crc.o $(DIR_UNRAR)/rawread.o \
	$(DIR_UNRAR)/encname.o $(DIR_UNRAR)/resource.o $(DIR_UNRAR)/match.o \
	$(DIR_UNRAR)/timefn.o $(DIR_UNRAR)/rdwrfn.o $(DIR_UNRAR)/consio.o \
	$(DIR_UNRAR)/options.o $(DIR_UNRAR)/ulinks.o $(DIR_UNRAR)/errhnd.o \
	$(DIR_UNRAR)/rarvm.o $(DIR_UNRAR)/rijndael.o $(DIR_UNRAR)/getbits.o \
	$(DIR_UNRAR)/sha1.o $(DIR_UNRAR)/extinfo.o $(DIR_UNRAR)/extract.o \
	$(DIR_UNRAR)/volume.o $(DIR_UNRAR)/list.o $(DIR_UNRAR)/find.o \
	$(DIR_UNRAR)/unpack.o $(DIR_UNRAR)/cmddata.o


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

VFS_OBJECTS=unrar.o rarlog.o


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


all shared static: libunrar_plugin.so

libunrar_plugin.so: libunrar $(VFS_COMMON_OBJECTS) $(VFS_OBJECTS)
	$(CPP) -shared -o libunrar_plugin.so $(VFS_COMMON_OBJECTS) $(VFS_OBJECTS) $(UNRAR_OBJECTS) $(UNRAR_LIB_OBJ) $(CFLAGS) `pkg-config glib-2.0 --libs`

libunrar:
	( cd $(DIR_UNRAR) && make -f ../Makefile.unrar ) || 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
rarlog.o: rarlog.cpp rarlog.hpp

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

clean: 
	( cd $(DIR_UNRAR) && make -f ../Makefile.unrar clean ) || exit 1
	rm -f *.o *.d *.gch libunrar_plugin.so