blob: 52867373037822ae6cd7a94e71c2418e4f5b1de3 (
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
68
69
70
71
72
73
|
# path definitions
DESTDIR = /usr
INSTALL = install -c
INSTALL_DATA = ${INSTALL} -m 644
DIR_UNRAR = unrar
# compiler options
CC = gcc
CPP = g++
CFLAGS = -I. \
-Wall -Wtype-limits -fPIC -O2 -g -ggdb \
-DG_DISABLE_DEPRECATED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE \
-D__DEBUG_INTERNALx -D_LOG_DOMAIN="unrar"
LIB_SUFFIX = `if test \`uname -m\` = x86_64 -o \`uname -m\` = ppc64; then echo 64; fi`
UNRAR_LIB_OBJ = $(DIR_UNRAR)/filestr.o $(DIR_UNRAR)/scantree.o \
$(DIR_UNRAR)/dll.o $(DIR_UNRAR)/qopen.o
UNRAR_OBJECTS = $(DIR_UNRAR)/rar.o $(DIR_UNRAR)/strlist.o $(DIR_UNRAR)/strfn.o \
$(DIR_UNRAR)/pathfn.o $(DIR_UNRAR)/smallfn.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)/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)/errhnd.o \
$(DIR_UNRAR)/rarvm.o $(DIR_UNRAR)/secpassword.o $(DIR_UNRAR)/rijndael.o \
$(DIR_UNRAR)/getbits.o $(DIR_UNRAR)/sha1.o $(DIR_UNRAR)/sha256.o \
$(DIR_UNRAR)/blake2s.o $(DIR_UNRAR)/hash.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)/headers.o \
$(DIR_UNRAR)/threadpool.o $(DIR_UNRAR)/rs16.o $(DIR_UNRAR)/cmddata.o \
$(DIR_UNRAR)/ui.o
VFS_COMMON_OBJECTS = filelist.o filelist-vfs-intf.o strutils.o vfsutils.o logutils.o
VFS_OBJECTS = unrar.o
.SUFFIXES: .c .cpp
.c.o:
$(CC) $(CFLAGS) `pkg-config glib-2.0 gio-2.0 --cflags` -c $<
.cpp.o:
$(CPP) $(CFLAGS) `pkg-config glib-2.0 gio-2.0 --cflags` -c $<
all: shared
shared: CFLAGS += -DMODULE_SHARED -I/usr/include/libunrar -I/usr/include/libunrar6
shared: $(VFS_COMMON_OBJECTS) $(VFS_OBJECTS)
$(CPP) -shared -o libunrar_plugin.so $(VFS_COMMON_OBJECTS) $(VFS_OBJECTS) $(CFLAGS) `pkg-config glib-2.0 gio-2.0 --libs` -lunrar
static: CFLAGS += -I$(DIR_UNRAR)
static: 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 gio-2.0 --libs`
libunrar:
make -C $(DIR_UNRAR) lib
filelist.o: filelist.h filelist.c
filelist-vfs-intf.o: filelist-vfs-intf.h filelist-vfs-intf.c
strutils.o: strutils.h strutils.c
vfsutils.o: vfsutils.h vfsutils.c
logutils.o: logutils.h logutils.c
install::
$(INSTALL) ./libunrar_plugin.so $(DESTDIR)/lib$(LIB_SUFFIX)/tuxcmd/
clean:
make -C $(DIR_UNRAR) clean
rm -f *.o *.d *.gch libunrar_plugin.so
|