2009-11-10 16:48:42 +01:00
|
|
|
#
|
|
|
|
# Makefile for UNIX - unrar
|
|
|
|
|
|
|
|
# Linux using GCC
|
2020-07-15 00:40:26 +02:00
|
|
|
CXX=c++
|
|
|
|
CXXFLAGS=-O2 -Wno-logical-op-parentheses -Wno-switch -Wno-dangling-else
|
|
|
|
LIBFLAGS=-fPIC
|
|
|
|
DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DRAR_SMP
|
2009-11-10 16:48:42 +01:00
|
|
|
STRIP=strip
|
2020-07-15 00:40:26 +02:00
|
|
|
AR=ar
|
|
|
|
LDFLAGS=-pthread
|
2009-11-10 16:48:42 +01:00
|
|
|
DESTDIR=/usr
|
|
|
|
|
|
|
|
# Linux using LCC
|
|
|
|
#CXX=lcc
|
|
|
|
#CXXFLAGS=-O2
|
|
|
|
#DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
|
|
|
|
#STRIP=strip
|
2020-07-15 00:40:26 +02:00
|
|
|
#AR=ar
|
|
|
|
#DESTDIR=/usr
|
|
|
|
|
|
|
|
# CYGWIN using GCC
|
|
|
|
#CXX=c++
|
|
|
|
#CXXFLAGS=-O2
|
|
|
|
#LIBFLAGS=
|
|
|
|
#DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DRAR_SMP
|
|
|
|
#STRIP=strip
|
|
|
|
#AR=ar
|
|
|
|
#LDFLAGS=-pthread
|
2009-11-10 16:48:42 +01:00
|
|
|
#DESTDIR=/usr
|
|
|
|
|
|
|
|
# HP UX using aCC
|
|
|
|
#CXX=aCC
|
|
|
|
#CXXFLAGS=-AA +O2 +Onolimit
|
|
|
|
#DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
|
|
|
|
#STRIP=strip
|
2020-07-15 00:40:26 +02:00
|
|
|
#AR=ar
|
2009-11-10 16:48:42 +01:00
|
|
|
#DESTDIR=/usr
|
|
|
|
|
|
|
|
# IRIX using GCC
|
|
|
|
#CXX=g++
|
|
|
|
#CXXFLAGS=-O2
|
|
|
|
#DEFINES=-DBIG_ENDIAN -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_BSD_COMPAT -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1
|
|
|
|
#STRIP=strip
|
2020-07-15 00:40:26 +02:00
|
|
|
#AR=ar
|
2009-11-10 16:48:42 +01:00
|
|
|
#DESTDIR=/usr
|
|
|
|
|
|
|
|
# IRIX using MIPSPro (experimental)
|
|
|
|
#CXX=CC
|
|
|
|
#CXXFLAGS=-O2 -mips3 -woff 1234,1156,3284 -LANG:std
|
|
|
|
#DEFINES=-DBIG_ENDIAN -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_BSD_COMPAT -Dint64=int64_t
|
|
|
|
#STRIP=strip
|
2020-07-15 00:40:26 +02:00
|
|
|
#AR=ar
|
2009-11-10 16:48:42 +01:00
|
|
|
#DESTDIR=/usr
|
|
|
|
|
|
|
|
# AIX using xlC (IBM VisualAge C++ 5.0)
|
|
|
|
#CXX=xlC
|
|
|
|
#CXXFLAGS=-O -qinline -qro -qroconst -qmaxmem=16384 -qcpluscmt
|
|
|
|
#DEFINES=-D_LARGE_FILES -D_LARGE_FILE_API
|
|
|
|
#LIBS=-lbsd
|
|
|
|
#STRIP=strip
|
2020-07-15 00:40:26 +02:00
|
|
|
#AR=ar
|
2009-11-10 16:48:42 +01:00
|
|
|
#DESTDIR=/usr
|
|
|
|
|
|
|
|
# Solaris using CC
|
|
|
|
#CXX=CC
|
|
|
|
#CXXFLAGS=-fast -erroff=wvarhidemem
|
|
|
|
#DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
|
|
|
|
#STRIP=strip
|
2020-07-15 00:40:26 +02:00
|
|
|
#AR=ar
|
2009-11-10 16:48:42 +01:00
|
|
|
#DESTDIR=/usr
|
|
|
|
|
|
|
|
# Solaris using GCC (optimized for UltraSPARC 1 CPU)
|
|
|
|
#CXX=g++
|
|
|
|
#CXXFLAGS=-O3 -mcpu=v9 -mtune=ultrasparc -m32
|
|
|
|
#DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
|
|
|
|
#STRIP=/usr/ccs/bin/strip
|
2020-07-15 00:40:26 +02:00
|
|
|
#AR=/usr/ccs/bin/ar
|
2009-11-10 16:48:42 +01:00
|
|
|
#DESTDIR=/usr
|
|
|
|
|
|
|
|
# Tru64 5.1B using GCC3
|
|
|
|
#CXX=g++
|
|
|
|
#CXXFLAGS=-O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_XOPEN_SOURCE=500
|
|
|
|
#STRIP=strip
|
2020-07-15 00:40:26 +02:00
|
|
|
#AR=ar
|
2009-11-10 16:48:42 +01:00
|
|
|
#LDFLAGS=-rpath /usr/local/gcc/lib
|
|
|
|
#DESTDIR=/usr
|
|
|
|
|
|
|
|
# Tru64 5.1B using DEC C++
|
|
|
|
#CXX=cxx
|
|
|
|
#CXXFLAGS=-O4 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dint64=long
|
|
|
|
#STRIP=strip
|
2020-07-15 00:40:26 +02:00
|
|
|
#AR=ar
|
2009-11-10 16:48:42 +01:00
|
|
|
#LDFLAGS=
|
|
|
|
#DESTDIR=/usr
|
|
|
|
|
|
|
|
# QNX 6.x using GCC
|
|
|
|
#CXX=g++
|
|
|
|
#CXXFLAGS=-O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fexceptions
|
|
|
|
#STRIP=strip
|
2020-07-15 00:40:26 +02:00
|
|
|
#AR=ar
|
2009-11-10 16:48:42 +01:00
|
|
|
#LDFLAGS=-fexceptions
|
|
|
|
#DESTDIR=/usr
|
|
|
|
|
|
|
|
# Cross-compile
|
|
|
|
# Linux using arm-linux-g++
|
|
|
|
#CXX=arm-linux-g++
|
|
|
|
#CXXFLAGS=-O2
|
|
|
|
#DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
|
|
|
|
#STRIP=arm-linux-strip
|
2020-07-15 00:40:26 +02:00
|
|
|
#AR=arm-linux-ar
|
2009-11-10 16:48:42 +01:00
|
|
|
#LDFLAGS=-static
|
|
|
|
#DESTDIR=/usr
|
|
|
|
|
|
|
|
##########################
|
|
|
|
|
|
|
|
COMPILE=$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES)
|
|
|
|
LINK=$(CXX)
|
|
|
|
|
|
|
|
WHAT=UNRAR
|
|
|
|
|
2020-07-15 00:40:26 +02:00
|
|
|
UNRAR_OBJ=filestr.o recvol.o rs.o scantree.o qopen.o
|
|
|
|
LIB_OBJ=filestr.o scantree.o dll.o qopen.o
|
2009-11-10 16:48:42 +01:00
|
|
|
|
2020-07-15 00:40:26 +02:00
|
|
|
OBJECTS=rar.o strlist.o strfn.o pathfn.o smallfn.o global.o file.o filefn.o filcreat.o \
|
2009-11-10 16:48:42 +01:00
|
|
|
archive.o arcread.o unicode.o system.o isnt.o crypt.o crc.o rawread.o encname.o \
|
2020-07-15 00:40:26 +02:00
|
|
|
resource.o match.o timefn.o rdwrfn.o consio.o options.o errhnd.o rarvm.o secpassword.o \
|
|
|
|
rijndael.o getbits.o sha1.o sha256.o blake2s.o hash.o extinfo.o extract.o volume.o \
|
|
|
|
list.o find.o unpack.o headers.o threadpool.o rs16.o cmddata.o ui.o
|
2009-11-10 16:48:42 +01:00
|
|
|
|
|
|
|
.cpp.o:
|
|
|
|
$(COMPILE) -D$(WHAT) -c $<
|
|
|
|
|
|
|
|
all: unrar
|
|
|
|
|
|
|
|
install: install-unrar
|
|
|
|
|
|
|
|
uninstall: uninstall-unrar
|
|
|
|
|
|
|
|
clean:
|
2020-07-15 00:40:26 +02:00
|
|
|
@rm -f *.bak *~
|
|
|
|
@rm -f $(OBJECTS) $(UNRAR_OBJ) $(LIB_OBJ)
|
|
|
|
@rm -f unrar libunrar.*
|
2009-11-10 16:48:42 +01:00
|
|
|
|
2020-07-15 00:40:26 +02:00
|
|
|
unrar: clean $(OBJECTS) $(UNRAR_OBJ)
|
2009-11-10 16:48:42 +01:00
|
|
|
@rm -f unrar
|
|
|
|
$(LINK) -o unrar $(LDFLAGS) $(OBJECTS) $(UNRAR_OBJ) $(LIBS)
|
|
|
|
$(STRIP) unrar
|
|
|
|
|
|
|
|
sfx: WHAT=SFX_MODULE
|
2020-07-15 00:40:26 +02:00
|
|
|
sfx: clean $(OBJECTS)
|
2009-11-10 16:48:42 +01:00
|
|
|
@rm -f default.sfx
|
|
|
|
$(LINK) -o default.sfx $(LDFLAGS) $(OBJECTS)
|
|
|
|
$(STRIP) default.sfx
|
|
|
|
|
|
|
|
lib: WHAT=RARDLL
|
2020-07-15 00:40:26 +02:00
|
|
|
lib: CXXFLAGS+=$(LIBFLAGS)
|
|
|
|
lib: clean $(OBJECTS) $(LIB_OBJ)
|
|
|
|
@rm -f libunrar.*
|
2009-11-10 16:48:42 +01:00
|
|
|
$(LINK) -shared -o libunrar.so $(LDFLAGS) $(OBJECTS) $(LIB_OBJ)
|
2020-07-15 00:40:26 +02:00
|
|
|
$(AR) rcs libunrar.a $(OBJECTS) $(LIB_OBJ)
|
2009-11-10 16:48:42 +01:00
|
|
|
|
|
|
|
install-unrar:
|
2020-07-15 00:40:26 +02:00
|
|
|
install -D unrar $(DESTDIR)/bin/unrar
|
2009-11-10 16:48:42 +01:00
|
|
|
|
|
|
|
uninstall-unrar:
|
|
|
|
rm -f $(DESTDIR)/bin/unrar
|
|
|
|
|
|
|
|
install-lib:
|
|
|
|
install libunrar.so $(DESTDIR)/lib
|
2020-07-15 00:40:26 +02:00
|
|
|
install libunrar.a $(DESTDIR)/lib
|
2009-11-10 16:48:42 +01:00
|
|
|
|
|
|
|
uninstall-lib:
|
|
|
|
rm -f $(DESTDIR)/lib/libunrar.so
|