-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
executable file
·176 lines (162 loc) · 6.06 KB
/
Makefile.am
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
## This file is part of par2cmdline (a PAR 2.0 compatible file verification and
## repair tool). See http://parchive.sourceforge.net for details of PAR 2.0.
##
## Copyright (c) 2003 Peter Brian Clements
## Modifications for specific OS support (Mac, Linux, FreeBSD), and x86/x86_64
## assembly code building (c) 2008-2014 Vincent Tan.
##
## par2cmdline is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## par2cmdline is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
bin_PROGRAMS = par2
if AMD64
ARCH_SCALAR = x86_64
ARCH_MMX = x86_64
endif
if X86MMX
ARCH_SCALAR = i386
ARCH_MMX = i686
else
if X86CPU
ARCH_SCALAR = i386
ARCH_MMX = i686
endif
endif
if PPC64
ARCH_SCALAR = ppc64
endif
if PPC32
ARCH_SCALAR = ppc
endif
if PLATFORM_DARWIN
PLATFORM = darwin
FLAGS_ARCH = -arch $(ARCH_SCALAR)
ASMSOURCES_PLATFORM =
CXXFLAGS_DARWIN = # because the functions in the .s files process RS data
#CXXFLAGS_DARWIN = -fomit-frame-pointer <= if you want GCC to produce slightly better scalar x86 code
#CXXFLAGS_DARWIN = -mmmx -fomit-frame-pointer <= if you want GCC to produce SIMD code using instrinsic fns
else
PLATFORM = posix
FLAGS_ARCH =
ASMSOURCES_PLATFORM = detect-mmx.s
endif
if AMD64
ASMSOURCES = reedsolomon-$(ARCH_SCALAR)-scalar-$(PLATFORM).s reedsolomon-$(ARCH_MMX)-mmx-$(PLATFORM).s
endif
if X86CPU
ASMSOURCES = reedsolomon-$(ARCH_SCALAR)-scalar-$(PLATFORM).s reedsolomon-$(ARCH_MMX)-mmx-$(PLATFORM).s $(ASMSOURCES_PLATFORM)
endif
if GPGPU_CUDA
AM_CXXFLAGS_GPGPU = # -I/usr/local/cuda/include
AM_LDFLAGS_GPGPU = -L/usr/local/cuda/lib -lcudart
if PLATFORM_DARWIN
if X86CPU
#par2_DEPENDENCIES = /Developer/CUDA/lib/libpar2_cuda.dylib
AM_LDFLAGS_GPGPU += -Wl,-rpath -Wl,/usr/local/cuda/lib -L/Developer/CUDA/lib -lpar2_cuda
GPGPU_SOURCES = cuda.cpp cuda.h
else
# ERROR: Darwin builds of par2 only supports CUDA on the i686 architecture (because CUDA ships as a 32-bit dylib that requires 10.5.2)
endif
endif
else
AM_CXXFLAGS_GPGPU =
AM_LDFLAGS_GPGPU =
GPGPU_SOURCES =
endif
.s.o:
$(CCASCOMPILE) $(FLAGS_ARCH) -c -o $@ $<
par2_SOURCES = par2cmdline.cpp par2cmdline.h \
buffer.cpp buffer.h \
commandline.cpp commandline.h \
crc.cpp crc.h \
creatorpacket.cpp creatorpacket.h \
criticalpacket.cpp criticalpacket.h \
datablock.cpp datablock.h \
descriptionpacket.cpp descriptionpacket.h \
diskfile.cpp diskfile.h \
filechecksummer.cpp filechecksummer.h \
galois.cpp galois.h \
letype.h \
mainpacket.cpp mainpacket.h \
md5.cpp md5.h \
par1fileformat.cpp par1fileformat.h \
par1repairer.cpp par1repairer.h \
par1repairersourcefile.cpp par1repairersourcefile.h \
par2creator.cpp par2creator.h \
par2creatorsourcefile.cpp par2creatorsourcefile.h \
par2fileformat.cpp par2fileformat.h \
par2repairer.cpp par2repairer.h \
par2repairersourcefile.cpp par2repairersourcefile.h \
pipeline.cpp pipeline.h \
recoverypacket.cpp recoverypacket.h \
reedsolomon.cpp reedsolomon.h \
verificationhashtable.cpp verificationhashtable.h \
verificationpacket.cpp verificationpacket.h \
$(ASMSOURCES) $(GPGPU_SOURCES)
LDADD = -lstdc++ -ltbb -L.
if PLATFORM_DARWIN
AM_CXXFLAGS = -Wall -I$(top_srcdir)/../tbb43_20141023oss/include -gfull -O3 -fvisibility=hidden -fvisibility-inlines-hidden $(CXXFLAGS_DARWIN) $(AM_CXXFLAGS_GPGPU) $(FLAGS_ARCH) $(PAR2_CXXFLAGS)
if AMD64
AM_CXXFLAGS += -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk
AM_LDFLAGS = -mmacosx-version-min=10.5
endif
if X86CPU
if GPGPU_CUDA # CUDA mandates 10.5 so the two are mutally exclusive: either CUDA or 10.4u support but not both
AM_CXXFLAGS += -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk
AM_LDFLAGS = -mmacosx-version-min=10.5 $(AM_LDFLAGS_GPGPU)
else
AM_CXXFLAGS += -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk
AM_LDFLAGS = -mmacosx-version-min=10.5
endif
endif
if PPC32
# because MacOSX10.4u.sdk requires g++ 4.0, you must invoke configure with: CXX=g++-4.0
AM_CXXFLAGS += -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
AM_LDFLAGS = -mmacosx-version-min=10.4
endif
endif
if PLATFORM_FREEBSD
AM_CXXFLAGS = -Wall -I/usr/local/include $(AM_CXXFLAGS_GPGPU) $(FLAGS_ARCH) $(PAR2_CXXFLAGS)
AM_CCASFLAGS = -Wa,-I$(top_srcdir)
AM_LDFLAGS = -L/usr/local/lib $(AM_LDFLAGS_GPGPU)
endif
if PLATFORM_LINUX
AM_CXXFLAGS = -Wall -I$(top_srcdir)/../tbb43_20141023oss/include $(AM_CXXFLAGS_GPGPU) $(FLAGS_ARCH) $(PAR2_CXXFLAGS)
AM_CCASFLAGS = -Wa,-I$(top_srcdir)
AM_LDFLAGS = '-Wl,-R,$$ORIGIN' $(AM_LDFLAGS_GPGPU)
endif
EXTRA_DIST = Makefile PORTING README_FIRST.txt ROADMAP par2cmdline.sln par2cmdline.vcxproj par2cmdline.vcxproj.filters \
testdata.tar.gz pretest test1 test2 test3 test4 test5 test6 \
posttest \
detect-mmx.s \
reedsolomon-i386-scalar-darwin.s \
reedsolomon-i386-scalar-posix.s \
reedsolomon-i386-scalar.s \
reedsolomon-i686-mmx-darwin.s \
reedsolomon-i686-mmx-posix.s \
reedsolomon-i686-mmx.s \
reedsolomon-x86_64-scalar-darwin.s \
reedsolomon-x86_64-scalar-posix.s \
reedsolomon-x86_64-scalar.s \
reedsolomon-x86_64-mmx-darwin.s \
reedsolomon-x86_64-mmx-posix.s \
reedsolomon-x86_64-mmx.s
TESTS = pretest test1 test2 test3 test4 test5 test6 posttest
install-exec-hook :
ln -f $(DESTDIR)$(bindir)/par2$(EXEEXT) $(DESTDIR)$(bindir)/par2create$(EXEEXT)
ln -f $(DESTDIR)$(bindir)/par2$(EXEEXT) $(DESTDIR)$(bindir)/par2verify$(EXEEXT)
ln -f $(DESTDIR)$(bindir)/par2$(EXEEXT) $(DESTDIR)$(bindir)/par2repair$(EXEEXT)
uninstall-hook :
rm -f $(DESTDIR)$(bindir)/par2create$(EXEEXT)
rm -f $(DESTDIR)$(bindir)/par2verify$(EXEEXT)
rm -f $(DESTDIR)$(bindir)/par2repair$(EXEEXT)