-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathMakefile.in
137 lines (105 loc) · 4.46 KB
/
Makefile.in
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
#
# @version 0.1.3 (2011)
# @author Paolo Margara <[email protected]>
#
# Copyright 2011 Paolo Margara
#
# This file is part of engine-cuda.
#
# engine-cuda 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 3 of the License or
# any later version.
#
# engine-cuda 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 engine-cuda. If not, see <http://www.gnu.org/licenses/>.
CC = @CC@
NVCC = @NVCC@
DOC = asciidoc
VERBOSE = @VERBOSE@
ifndef VERBOSE
QUIET_CC = @echo ' CC' $@;
QUIET_NVCC = @echo ' NVCC' $@;
QUIET_DOC = @echo ' ASCIIDOC' $@;
endif
VERSION = @VERSION@
LDFLAGS= @LDFLAGS@
NVLDFLAGS= @NVLDFLAGS@
CPPFLAGS= @CPPFLAGS@
NVCPPFLAGS= @NVCPPFLAGS@
CFLAGS= @CFLAGS@
NVCFLAGS_LIBS = @NVCFLAGS@ --compiler-options '@CFLAGS@'
NVCFLAGS_TEST = @NVCFLAGS@ --compiler-options '@CFLAGS_TEST@'
LIBS_OPENCL = -lcrypto -lOpenCL
LIBS = @LIBS@
LIBNAME = @LIBNAME@
LIBNAME_OPENCL = @LIBNAME_OPENCL@
TESTNAME= teststate
COMMONSRC_CUDA = common.h cuda_common.h cuda_common.cu
COMMONSRC_OPENCL = common.h opencl_common.c opencl_common.h
TESTSRC= teststate.c aes_cuda.cu
LIBOBJ = e_cuda.o
LIBOBJ_CUDA = aes_cuda.o des_cuda.o idea_cuda.o bf_cuda.o cast_cuda.o cmll_cuda.o cuda_common.o
LIBOBJ_OPENCL = e_opencl.o aes_opencl.o bf_opencl.o des_opencl.o cast_opencl.o cmll_opencl.o idea_opencl.o opencl_common.o
SOURCES= aes_cuda.cu e_cuda.c teststate.c
HEADERS= aes_cuda.h
OTHERFILES= configure COPYING openssl.cnf.example README CHANGES configure.in Makefile.in
OTHER_DIRS= openssl-patch test-enc test-speed test-file
OTHER_DIRS_CONTENT= openssl-patch/openssl-0.9.8.k-apps_speed.c.patch test-enc/aes-ecb-decrypt.plt test-enc/test-enc-plot.sh test-speed/aes-ecb-decrypt.plt \
openssl-patch/openssl-0.9.8.k-crypto_evp_bio_enc.c.patch test-enc/aes-ecb-encrypt.plt test-file/test-file.sh test-speed/aes-ecb-encrypt.plt test-enc/aes-cbc-decrypt.plt \
test-enc/test-enc-cpu.sh test-speed/aes-cbc-decrypt.plt test-enc/aes-cbc-encrypt.plt test-enc/test-enc-gpu.sh test-speed/aes-cbc-encrypt.plt test-speed/test-speed.sh
ALLFILES=$(SOURCES) $(HEADERS) $(OTHERFILES) $(OTHER_DIRS)
distdir= @DISTDIR@
tarname= @TARNAME@
TESTOBJ= aes_cuda.o teststate.o
all: $(LIBNAME) $(LIBNAME_OPENCL)
$(LIBNAME): $(LIBOBJ) $(LIBOBJ_CUDA)
$(QUIET_CC) $(CC) -fPIC -shared -Wl $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LIBS) -o $(LIBNAME) $(LIBOBJ) $(LIBOBJ_CUDA)
$(LIBOBJ): %.o: %.c $(COMMONSRC_CUDA)
$(QUIET_CC) $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -c -o $@ $<
$(LIBOBJ_CUDA): %.o: %.cu $(COMMONSRC_CUDA)
$(QUIET_NVCC) $(NVCC) $(NVCPPFLAGS) $(NVCFLAGS_LIBS) -c -o $@ $<
$(LIBNAME_OPENCL): $(LIBOBJ_OPENCL)
$(QUIET_CC) $(CC) -fPIC -shared -Wl $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LIBS_OPENCL) -o $(LIBNAME_OPENCL) $(LIBOBJ_OPENCL)
$(LIBOBJ_OPENCL): %.o: %.c $(COMMONSRC_OPENCL)
$(QUIET_CC) $(CC) $(CFLAGS) -Wno-comments $(CPPFLAGS) $(LDFLAGS) -c -o $@ $<
test: $(TESTSRC)
$(QUIET_NVCC) $(NVCC) $(NVCPPFLAGS) $(NVCFLAGS_TEST) $(NVLDFLAGS) $(LIBS) -o $(TESTNAME) $(TESTSRC)
kernels.ptx: opencl_kernels.cl
clcc "-cl-nv-arch sm_11" opencl_kernels.cl $@
install: $(LIBNAME)
mkdir -p @prefix@/@ENGINEDIR@
cp $(LIBNAME) @prefix@/@ENGINEDIR@
chmod 644 @prefix@/@ENGINEDIR@/$(LIBNAME)
uninstall:
-rm -f @prefix@/@ENGINEDIR@/$(LIBNAME)
clean:
rm -rf *.o *.obj tags core .pure *.out .nfs* *.old *.bak fluff \
*.linkinfo *.so *.a teststate config.log config.status *.cpp1.ii \
*.cpp2.i *.cpp3.i *.cpp4.ii *.cu.cpp *.cudafe1.c *.cudafe1.cpp \
*.cudafe1.gpu autom4te.cache *.cudafe1.stub.c *.cudafe2.c *.cudafe2.gpu \
*.cudafe2.stub.c *.fatbin.c *.hash *.ptx *.sm_*.cubin doc/*
distclean: clean FORCE
rm -f config.* Makefile
dist: $(tarname)
doc: doc/TODO.html doc/README.html doc/CHANGES.html
doc/%.html: %
@mkdir -p doc
$(QUIET_DOC) $(DOC) -d book -o $@ $<
$(tarname): $(distdir)
tar cvzf $(tarname) $(distdir)
rm -rf $(distdir)
$(distdir): $(ALLFILES) FORCE
mkdir -p $(distdir)
cp $(SOURCES) $(HEADERS) $(OTHERFILES) $(distdir)
for i in $(OTHER_DIRS); do mkdir -p $(distdir)/$$i; done
for i in $(OTHER_DIRS_CONTENT); do cp $$i $(distdir)/$$i; done
FORCE:
-rm -rf $(distdir)
-rm -f $(tarname)
.PHONY: all clean distclean dist FORCE install uninstall