blob: 9636eb941d6079627f3d165be84fefc9f593e9dd [file] [log] [blame]
Louis Verhaard9bfe0f82020-12-03 12:26:25 +01001# Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved.
2#
3# SPDX-License-Identifier: Apache-2.0
4#
5# Licensed under the Apache License, Version 2.0 (the License); you may
6# not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an AS IS BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17
18# Description:
19# Makefile to build tensor_allocator_main
20
21UNAME=$(shell uname -o)
22
23CXXFLAGS=--std=c++11 -pedantic-errors -Wall -Werror -Wdate-time
24CXXFLAGS+=-fwrapv -fstack-protector-strong -flto -fuse-linker-plugin -ffat-lto-objects -fPIC
25
26ifeq ($(DEBUG),1)
27 CXXFLAGS+=-g -O0 -DDEBUG
28else
29 CXXFLAGS+=-O2
30endif
31
32LIBSRCS=tensor_allocator_main.cpp search_allocator.cpp
33LIBHDRS=search_allocator.h
34
35ifeq ($(UNAME),Cygwin)
36 TENSOR_ALLOCATOR_EXE=tensor_allocator_main.exe
37else
38 TENSOR_ALLOCATOR_EXE=tensor_allocator_main
39endif
40
41all: tensor_allocator_exe
42
43.PHONY: tensor_allocator_exe
44tensor_allocator_exe: $(TENSOR_ALLOCATOR_EXE)
45
46clean:
47 rm -f $(TENSOR_ALLOCATOR_EXE)
48
49$(TENSOR_ALLOCATOR_EXE): $(LIBSRCS) $(LIBHDRS) makefile
50 g++ $(CXXFLAGS) $(LIBSRCS) -o $(TENSOR_ALLOCATOR_EXE)