Makefile revision 10915
110915Sandreas.sandberg@arm.com# 210915Sandreas.sandberg@arm.com# Copyright (c) 2014-2015 ARM Limited 310915Sandreas.sandberg@arm.com# All rights reserved 410915Sandreas.sandberg@arm.com# 510915Sandreas.sandberg@arm.com# Licensed under the Apache License, Version 2.0 (the "License"); 610915Sandreas.sandberg@arm.com# you may not use this file except in compliance with the License. 710915Sandreas.sandberg@arm.com# You may obtain a copy of the License at 810915Sandreas.sandberg@arm.com# 910915Sandreas.sandberg@arm.com# http://www.apache.org/licenses/LICENSE-2.0 1010915Sandreas.sandberg@arm.com# 1110915Sandreas.sandberg@arm.com# Unless required by applicable law or agreed to in writing, software 1210915Sandreas.sandberg@arm.com# distributed under the License is distributed on an "AS IS" BASIS, 1310915Sandreas.sandberg@arm.com# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1410915Sandreas.sandberg@arm.com# See the License for the specific language governing permissions and 1510915Sandreas.sandberg@arm.com# limitations under the License. 1610915Sandreas.sandberg@arm.com# 1710915Sandreas.sandberg@arm.com# Authors: Andreas Sandberg 1810915Sandreas.sandberg@arm.com 1910915Sandreas.sandberg@arm.comDOXYGEN = doxygen 2010915Sandreas.sandberg@arm.com 2110915Sandreas.sandberg@arm.comGCC_VERSION := $(shell $(CC) -dumpversion | sed -e 's/\.//g') 2210915Sandreas.sandberg@arm.comifeq "$(shell expr $(GCC_VERSION) \< 47)" "1" 2310915Sandreas.sandberg@arm.com$(error Default GCC version is too old. Please use gcc 4.7 or newer.) 2410915Sandreas.sandberg@arm.comendif 2510915Sandreas.sandberg@arm.com 2610915Sandreas.sandberg@arm.comCPPFLAGS = -Iinclude/ 2710915Sandreas.sandberg@arm.comCFLAGS = -fvisibility=hidden -O1 -g -Wall 2810915Sandreas.sandberg@arm.comCXXFLAGS = -std=c++0x $(CFLAGS) 2910915Sandreas.sandberg@arm.comLDFLAGS= 3010915Sandreas.sandberg@arm.com 3110915Sandreas.sandberg@arm.comLIB_CPPFLAGS = $(CPPFLAGS) 3210915Sandreas.sandberg@arm.comLIB_CFLAGS = $(CFLAGS) -fPIC 3310915Sandreas.sandberg@arm.comLIB_CXXFLAGS = $(CXXFLAGS) -fPIC 3410915Sandreas.sandberg@arm.comLIB_LDFLAGS= $(LDFLAGS) -shared 3510915Sandreas.sandberg@arm.com 3610915Sandreas.sandberg@arm.com# Default targets 3710915Sandreas.sandberg@arm.comALL := 3810915Sandreas.sandberg@arm.com 3910915Sandreas.sandberg@arm.com# Test targets 4010915Sandreas.sandberg@arm.comALL_TESTS := 4110915Sandreas.sandberg@arm.com 4210915Sandreas.sandberg@arm.com# Dependency includes 4310915Sandreas.sandberg@arm.comDEPS := 4410915Sandreas.sandberg@arm.com 4510915Sandreas.sandberg@arm.com# Files/directories to remove in the clean target 4610915Sandreas.sandberg@arm.comCLEAN := 4710915Sandreas.sandberg@arm.com 4810915Sandreas.sandberg@arm.comall: _all 4910915Sandreas.sandberg@arm.com 5010915Sandreas.sandberg@arm.comdir:=lib 5110915Sandreas.sandberg@arm.cominclude $(dir)/Rules.mk 5210915Sandreas.sandberg@arm.com 5310915Sandreas.sandberg@arm.comdir:=tests 5410915Sandreas.sandberg@arm.cominclude $(dir)/Rules.mk 5510915Sandreas.sandberg@arm.com 5610915Sandreas.sandberg@arm.com_all: $(ALL) 5710915Sandreas.sandberg@arm.com 5810915Sandreas.sandberg@arm.comtest: $(ALL_TESTS) 5910915Sandreas.sandberg@arm.com @set -e; \ 6010915Sandreas.sandberg@arm.com for T in $^ ; do \ 6110915Sandreas.sandberg@arm.com echo "Running $${T}"; \ 6210915Sandreas.sandberg@arm.com ./$${T}; \ 6310915Sandreas.sandberg@arm.com done 6410915Sandreas.sandberg@arm.com 6510915Sandreas.sandberg@arm.comdocs: 6610915Sandreas.sandberg@arm.com $(DOXYGEN) Doxyfile 6710915Sandreas.sandberg@arm.com 6810915Sandreas.sandberg@arm.comdepclean: 6910915Sandreas.sandberg@arm.com $(RM) $(DEPS) 7010915Sandreas.sandberg@arm.com 7110915Sandreas.sandberg@arm.comclean: 7210915Sandreas.sandberg@arm.com $(RM) -r $(CLEAN) 7310915Sandreas.sandberg@arm.com $(RM) -r docs/html 7410915Sandreas.sandberg@arm.com 7510915Sandreas.sandberg@arm.com 7610915Sandreas.sandberg@arm.com.PHONY: all _all test depclean clean docs 7710915Sandreas.sandberg@arm.com 7810915Sandreas.sandberg@arm.com# Include dependencies 7910915Sandreas.sandberg@arm.com-include $(MODEL_OBJS:.o=.d) 8010915Sandreas.sandberg@arm.com-include $(LIBMIDGARDMODEL_OBJS:.o=.d) 8110915Sandreas.sandberg@arm.com-include $(LIBNOMALI_OBJS:.o=.d) 82