Makefile revision 10915
1# 2# Copyright (c) 2014-2015 ARM Limited 3# All rights reserved 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://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, 13# WITHOUT 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# Authors: Andreas Sandberg 18 19DOXYGEN = doxygen 20 21GCC_VERSION := $(shell $(CC) -dumpversion | sed -e 's/\.//g') 22ifeq "$(shell expr $(GCC_VERSION) \< 47)" "1" 23$(error Default GCC version is too old. Please use gcc 4.7 or newer.) 24endif 25 26CPPFLAGS = -Iinclude/ 27CFLAGS = -fvisibility=hidden -O1 -g -Wall 28CXXFLAGS = -std=c++0x $(CFLAGS) 29LDFLAGS= 30 31LIB_CPPFLAGS = $(CPPFLAGS) 32LIB_CFLAGS = $(CFLAGS) -fPIC 33LIB_CXXFLAGS = $(CXXFLAGS) -fPIC 34LIB_LDFLAGS= $(LDFLAGS) -shared 35 36# Default targets 37ALL := 38 39# Test targets 40ALL_TESTS := 41 42# Dependency includes 43DEPS := 44 45# Files/directories to remove in the clean target 46CLEAN := 47 48all: _all 49 50dir:=lib 51include $(dir)/Rules.mk 52 53dir:=tests 54include $(dir)/Rules.mk 55 56_all: $(ALL) 57 58test: $(ALL_TESTS) 59 @set -e; \ 60 for T in $^ ; do \ 61 echo "Running $${T}"; \ 62 ./$${T}; \ 63 done 64 65docs: 66 $(DOXYGEN) Doxyfile 67 68depclean: 69 $(RM) $(DEPS) 70 71clean: 72 $(RM) -r $(CLEAN) 73 $(RM) -r docs/html 74 75 76.PHONY: all _all test depclean clean docs 77 78# Include dependencies 79-include $(MODEL_OBJS:.o=.d) 80-include $(LIBMIDGARDMODEL_OBJS:.o=.d) 81-include $(LIBNOMALI_OBJS:.o=.d) 82