makefile.unix 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. #
  2. # Makefile for UNIX - unrar
  3. #
  4. # Note: you have to 'make clean' before you can build
  5. # the sfx module
  6. #
  7. # Linux using GCC
  8. CXX=g++
  9. CXXFLAGS=-O2
  10. DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
  11. STRIP=strip
  12. DESTDIR=/usr
  13. # Linux using LCC
  14. #CXX=lcc
  15. #CXXFLAGS=-O2
  16. #DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
  17. #STRIP=strip
  18. #DESTDIR=/usr
  19. # HP UX using aCC
  20. #CXX=aCC
  21. #CXXFLAGS=-AA +O2 +Onolimit
  22. #DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
  23. #STRIP=strip
  24. #DESTDIR=/usr
  25. # IRIX using GCC
  26. #CXX=g++
  27. #CXXFLAGS=-O2
  28. #DEFINES=-DBIG_ENDIAN -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_BSD_COMPAT -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1
  29. #STRIP=strip
  30. #DESTDIR=/usr
  31. # IRIX using MIPSPro (experimental)
  32. #CXX=CC
  33. #CXXFLAGS=-O2 -mips3 -woff 1234,1156,3284 -LANG:std
  34. #DEFINES=-DBIG_ENDIAN -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_BSD_COMPAT -Dint64=int64_t
  35. #STRIP=strip
  36. #DESTDIR=/usr
  37. # AIX using xlC (IBM VisualAge C++ 5.0)
  38. #CXX=xlC
  39. #CXXFLAGS=-O -qinline -qro -qroconst -qmaxmem=16384 -qcpluscmt
  40. #DEFINES=-D_LARGE_FILES -D_LARGE_FILE_API
  41. #LIBS=-lbsd
  42. #STRIP=strip
  43. #DESTDIR=/usr
  44. # Solaris using CC
  45. #CXX=CC
  46. #CXXFLAGS=-fast -erroff=wvarhidemem
  47. #DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
  48. #STRIP=strip
  49. #DESTDIR=/usr
  50. # Solaris using GCC (optimized for UltraSPARC 1 CPU)
  51. #CXX=g++
  52. #CXXFLAGS=-O3 -mcpu=v9 -mtune=ultrasparc -m32
  53. #DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
  54. #STRIP=/usr/ccs/bin/strip
  55. #DESTDIR=/usr
  56. # Tru64 5.1B using GCC3
  57. #CXX=g++
  58. #CXXFLAGS=-O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_XOPEN_SOURCE=500
  59. #STRIP=strip
  60. #LDFLAGS=-rpath /usr/local/gcc/lib
  61. #DESTDIR=/usr
  62. # Tru64 5.1B using DEC C++
  63. #CXX=cxx
  64. #CXXFLAGS=-O4 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dint64=long
  65. #STRIP=strip
  66. #LDFLAGS=
  67. #DESTDIR=/usr
  68. # QNX 6.x using GCC
  69. #CXX=g++
  70. #CXXFLAGS=-O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fexceptions
  71. #STRIP=strip
  72. #LDFLAGS=-fexceptions
  73. #DESTDIR=/usr
  74. # Cross-compile
  75. # Linux using arm-linux-g++
  76. #CXX=arm-linux-g++
  77. #CXXFLAGS=-O2
  78. #DEFINES=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
  79. #STRIP=arm-linux-strip
  80. #LDFLAGS=-static
  81. #DESTDIR=/usr
  82. ##########################
  83. COMPILE=$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES)
  84. LINK=$(CXX)
  85. WHAT=UNRAR
  86. UNRAR_OBJ=filestr.o recvol.o rs.o scantree.o
  87. LIB_OBJ=filestr.o scantree.o dll.o
  88. OBJECTS=rar.o strlist.o strfn.o pathfn.o savepos.o smallfn.o global.o file.o filefn.o filcreat.o \
  89. archive.o arcread.o unicode.o system.o isnt.o crypt.o crc.o rawread.o encname.o \
  90. resource.o match.o timefn.o rdwrfn.o consio.o options.o ulinks.o errhnd.o rarvm.o \
  91. rijndael.o getbits.o sha1.o extinfo.o extract.o volume.o list.o find.o unpack.o cmddata.o
  92. .cpp.o:
  93. $(COMPILE) -D$(WHAT) -c $<
  94. all: unrar
  95. install: install-unrar
  96. uninstall: uninstall-unrar
  97. clean:
  98. @rm -f *.o *.bak *~
  99. unrar: $(OBJECTS) $(UNRAR_OBJ)
  100. @rm -f unrar
  101. $(LINK) -o unrar $(LDFLAGS) $(OBJECTS) $(UNRAR_OBJ) $(LIBS)
  102. $(STRIP) unrar
  103. sfx: WHAT=SFX_MODULE
  104. sfx: $(OBJECTS)
  105. @rm -f default.sfx
  106. $(LINK) -o default.sfx $(LDFLAGS) $(OBJECTS)
  107. $(STRIP) default.sfx
  108. lib: WHAT=RARDLL
  109. lib: $(OBJECTS) $(LIB_OBJ)
  110. @rm -f libunrar.so
  111. $(LINK) -shared -o libunrar.so $(LDFLAGS) $(OBJECTS) $(LIB_OBJ)
  112. install-unrar:
  113. install -D unrar $(DESTDIR)/bin/unrar
  114. uninstall-unrar:
  115. rm -f $(DESTDIR)/bin/unrar
  116. install-lib:
  117. install libunrar.so $(DESTDIR)/lib
  118. uninstall-lib:
  119. rm -f $(DESTDIR)/lib/libunrar.so