summaryrefslogtreecommitdiff
path: root/unrar/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'unrar/Makefile')
-rw-r--r--unrar/Makefile67
1 files changed, 67 insertions, 0 deletions
diff --git a/unrar/Makefile b/unrar/Makefile
new file mode 100644
index 0000000..32e1906
--- /dev/null
+++ b/unrar/Makefile
@@ -0,0 +1,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
+