Limbo 3.5.4
Loading...
Searching...
No Matches
GCCVersion.mk
Go to the documentation of this file.
1## @file GCCVersion.mk
2## @brief compute version of CXX, set GCCVERSION, assume CXX is gcc
3##
4## calculate gcc version without . and save to GCCVERSION
5## Use following command in the Makefile to view the results
6##
7## $(info GCCVERSION = $(GCCVERSION))
8##
9## @author Yibo Lin
10## @date Aug 2015
11##
12## @param CXX given CXX and assume it is gcc
13## @param GCCVERSION set version of gcc
14
15## @cond
16
17empty:=
18space:= $(empty) $(empty)
19GCCVERSIONSTRING := $(shell expr `$(CXX) -dumpversion`)
20#Create version number without "."
21GCCVERSION := $(shell expr `echo $(GCCVERSIONSTRING)` | cut -f1 -d.)
22GCCVERSION += $(shell expr `echo $(GCCVERSIONSTRING)` | cut -f2 -d.)
23GCCVERSION += $(shell expr `echo $(GCCVERSIONSTRING)` | cut -f3 -d.)
24# Make sure the version number has at least 3 decimals
25GCCVERSION += 00
26# Remove spaces from the version number
27GCCVERSION := $(subst $(space),$(empty),$(GCCVERSION))
28# Crop the version number to 3 decimals.
29GCCVERSION := $(shell expr `echo $(GCCVERSION)` | cut -b1-3)
30
31## @endcond