Limbo 3.5.4
Loading...
Searching...
No Matches
FindCompiler.mk
Go to the documentation of this file.
1## @file FindCompiler.mk
2## @brief find compiler under various platform, determine CXX, CC, FC, AR
3##
4## Use following command in the Makefile to view the results
5##
6## $(info Compilers: CC = $(CC), CXX = $(CXX), FC = $(FC), AR = $(AR))
7##
8## @author Yibo Lin
9## @date Jan 2017
10##
11## @param LIMBO_DIR, LIMBO_ROOT_DIR given LIMBO_DIR or LIMBO_ROOT_DIR
12## @param CC, CXX, FC, AR set CC as c compiler, CXX as c++ compiler, FC as fortran compiler, AR as archiver
13
14## @cond
15
16# detect platform
17UNAME_S = $(shell uname -s)
18
19# consider two cases, called when building Limbo library or called from other programs
20ifndef LIMBO_ROOT_DIR
21ifdef LIMBO_DIR
22 LIMBO_ROOT_DIR = $(LIMBO_DIR)/include
23else
24 $(error LIMBO_ROOT_DIR = $(LIMBO_ROOT_DIR), LIMBO_DIR = $(LIMBO_DIR))
25endif
26endif
27
28# ==== search compilers under Linux
29ifeq ($(UNAME_S), Linux)
30#FOUNDCC = $(shell find ${PATH//:/ } -maxdepth 1 -executable -name gcc* -exec basename {} \;)
31
32include $(LIMBO_ROOT_DIR)/limbo/makeutils/FindGcc.mk
33include $(LIMBO_ROOT_DIR)/limbo/makeutils/FindGxx.mk
34include $(LIMBO_ROOT_DIR)/limbo/makeutils/FindGfortran.mk
35include $(LIMBO_ROOT_DIR)/limbo/makeutils/FindAR.mk
36
37endif
38
39# ==== search for compilers under Darwin
40ifeq ($(UNAME_S), Darwin)
41
42include $(LIMBO_ROOT_DIR)/limbo/makeutils/FindClang.mk
43include $(LIMBO_ROOT_DIR)/limbo/makeutils/FindClangxx.mk
44include $(LIMBO_ROOT_DIR)/limbo/makeutils/FindGfortran.mk
45include $(LIMBO_ROOT_DIR)/limbo/makeutils/FindAR.mk
46
47endif
48
49## @endcond
namespace for Limbo