Louis Verhaard | 9bfe0f8 | 2020-12-03 12:26:25 +0100 | [diff] [blame] | 1 | # 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 | |
| 21 | UNAME=$(shell uname -o) |
| 22 | |
| 23 | CXXFLAGS=--std=c++11 -pedantic-errors -Wall -Werror -Wdate-time |
| 24 | CXXFLAGS+=-fwrapv -fstack-protector-strong -flto -fuse-linker-plugin -ffat-lto-objects -fPIC |
| 25 | |
| 26 | ifeq ($(DEBUG),1) |
| 27 | CXXFLAGS+=-g -O0 -DDEBUG |
| 28 | else |
| 29 | CXXFLAGS+=-O2 |
| 30 | endif |
| 31 | |
| 32 | LIBSRCS=tensor_allocator_main.cpp search_allocator.cpp |
| 33 | LIBHDRS=search_allocator.h |
| 34 | |
| 35 | ifeq ($(UNAME),Cygwin) |
| 36 | TENSOR_ALLOCATOR_EXE=tensor_allocator_main.exe |
| 37 | else |
| 38 | TENSOR_ALLOCATOR_EXE=tensor_allocator_main |
| 39 | endif |
| 40 | |
| 41 | all: tensor_allocator_exe |
| 42 | |
| 43 | .PHONY: tensor_allocator_exe |
| 44 | tensor_allocator_exe: $(TENSOR_ALLOCATOR_EXE) |
| 45 | |
| 46 | clean: |
| 47 | rm -f $(TENSOR_ALLOCATOR_EXE) |
| 48 | |
| 49 | $(TENSOR_ALLOCATOR_EXE): $(LIBSRCS) $(LIBHDRS) makefile |
| 50 | g++ $(CXXFLAGS) $(LIBSRCS) -o $(TENSOR_ALLOCATOR_EXE) |