summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'debian/ti-timl/usr/src/timl/src/benchmark/makefile')
-rw-r--r--debian/ti-timl/usr/src/timl/src/benchmark/makefile82
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
37C_INCLUDE_PATH = ../common/api ../common/cnn ../common/util \
38/usr/include
39C_INCLUDE_PATH_FLAG = $(foreach d, $(C_INCLUDE_PATH), -I$d)
40C_LIB = timl blas jpeg m
41C_LIB_FLAG = $(foreach d, $(C_LIB), -l$d)
42C_LIB_PATH = /usr/lib ../../bin
43C_LIB_PATH_FLAG = $(foreach d, $(C_LIB_PATH), -L$d)
44CC = gcc
45CFLAGS += -g -O3 -fopenmp
46
47CPPC = g++
48
49AR = @ar
50ARFLAGS = -rcs
51RM = @rm
52RMFLAGS += -fr
53
54# BENCHMARK
55BENCHMARK_SRC_DIR = .
56BENCHMARK_CFILES = $(shell find $(BENCHMARK_SRC_DIR) -name "*.c")
57BENCHMARK_HFILES = $(shell find $(BENCHMARK_SRC_DIR) -name "*.h")
58BENCHMARK_OBJS = $(patsubst %.c, %.o, $(BENCHMARK_CFILES))
59
60# BENCHMARK CNN CLASS
61BENCHMARK_CNN_CLASS_BIN_CFILES = $(shell find $(BENCHMARK_SRC_DIR)/cnn/class -name "*.c")
62BENCHMARK_CNN_CLASS_BIN_OBJS = $(patsubst %.c, %.o, $(BENCHMARK_CNN_CLASS_BIN_CFILES))
63BENCHMARK_CNN_CLASS_BINS = $(patsubst %.c, %.bin, $(BENCHMARK_CNN_CLASS_BIN_CFILES))
64
65BENCHMARK_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
77all: $(BENCHMARK_BINS)
78
79clean:
80 $(RM) $(RMFLAGS) \
81 $(BENCHMARK_OBJS) \
82 $(BENCHMARK_BINS)