diff options
Diffstat (limited to 'debian/ti-timl/usr/src/timl/src/benchmark/makefile')
-rw-r--r-- | debian/ti-timl/usr/src/timl/src/benchmark/makefile | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/debian/ti-timl/usr/src/timl/src/benchmark/makefile b/debian/ti-timl/usr/src/timl/src/benchmark/makefile new file mode 100644 index 0000000..b02953b --- /dev/null +++ b/debian/ti-timl/usr/src/timl/src/benchmark/makefile | |||
@@ -0,0 +1,82 @@ | |||
1 | ################################################################################ | ||
2 | # | ||
3 | # makefile | ||
4 | # | ||
5 | # Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/ | ||
6 | # | ||
7 | # Redistribution and use in source and binary forms, with or without | ||
8 | # modification, are permitted provided that the following conditions | ||
9 | # are met: | ||
10 | # | ||
11 | # Redistributions of source code must retain the above copyright | ||
12 | # notice, this list of conditions and the following disclaimer. | ||
13 | # | ||
14 | # Redistributions in binary form must reproduce the above copyright | ||
15 | # notice, this list of conditions and the following disclaimer in the | ||
16 | # documentation and/or other materials provided with the | ||
17 | # distribution. | ||
18 | # | ||
19 | # Neither the name of Texas Instruments Incorporated nor the names of | ||
20 | # its contributors may be used to endorse or promote products derived | ||
21 | # from this software without specific prior written permission. | ||
22 | # | ||
23 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
24 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
25 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
26 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
27 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
28 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
29 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
30 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
31 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
32 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
33 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
34 | # | ||
35 | ################################################################################ | ||
36 | |||
37 | C_INCLUDE_PATH = ../common/api ../common/cnn ../common/util \ | ||
38 | /usr/include | ||
39 | C_INCLUDE_PATH_FLAG = $(foreach d, $(C_INCLUDE_PATH), -I$d) | ||
40 | C_LIB = timl blas jpeg m | ||
41 | C_LIB_FLAG = $(foreach d, $(C_LIB), -l$d) | ||
42 | C_LIB_PATH = /usr/lib ../../bin | ||
43 | C_LIB_PATH_FLAG = $(foreach d, $(C_LIB_PATH), -L$d) | ||
44 | CC = gcc | ||
45 | CFLAGS += -g -O3 -fopenmp | ||
46 | |||
47 | CPPC = g++ | ||
48 | |||
49 | AR = @ar | ||
50 | ARFLAGS = -rcs | ||
51 | RM = @rm | ||
52 | RMFLAGS += -fr | ||
53 | |||
54 | # BENCHMARK | ||
55 | BENCHMARK_SRC_DIR = . | ||
56 | BENCHMARK_CFILES = $(shell find $(BENCHMARK_SRC_DIR) -name "*.c") | ||
57 | BENCHMARK_HFILES = $(shell find $(BENCHMARK_SRC_DIR) -name "*.h") | ||
58 | BENCHMARK_OBJS = $(patsubst %.c, %.o, $(BENCHMARK_CFILES)) | ||
59 | |||
60 | # BENCHMARK CNN CLASS | ||
61 | BENCHMARK_CNN_CLASS_BIN_CFILES = $(shell find $(BENCHMARK_SRC_DIR)/cnn/class -name "*.c") | ||
62 | BENCHMARK_CNN_CLASS_BIN_OBJS = $(patsubst %.c, %.o, $(BENCHMARK_CNN_CLASS_BIN_CFILES)) | ||
63 | BENCHMARK_CNN_CLASS_BINS = $(patsubst %.c, %.bin, $(BENCHMARK_CNN_CLASS_BIN_CFILES)) | ||
64 | |||
65 | BENCHMARK_BINS = $(BENCHMARK_CNN_CLASS_BINS) | ||
66 | |||
67 | # benchmarkCNNClass bins | ||
68 | $(BENCHMARK_CNN_CLASS_BINS): %.bin: %.o $(COMMON_LIB_FULL_NAME) | ||
69 | $(CC) $(CFLAGS) -o $@ $^ \ | ||
70 | $(C_LIB_FLAG) $(C_LIB_PATH_FLAG) | ||
71 | |||
72 | # benchmark objs | ||
73 | $(BENCHMARK_OBJS):%.o: %.c $(COMMON_LIB_HFILES) $(BENCHMARK_HFILES) | ||
74 | $(CC) -c $(CFLAGS) -o $@ $< \ | ||
75 | $(C_INCLUDE_PATH_FLAG) | ||
76 | |||
77 | all: $(BENCHMARK_BINS) | ||
78 | |||
79 | clean: | ||
80 | $(RM) $(RMFLAGS) \ | ||
81 | $(BENCHMARK_OBJS) \ | ||
82 | $(BENCHMARK_BINS) | ||