-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile.components
118 lines (93 loc) · 4.54 KB
/
makefile.components
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# DO-NOT-REMOVE begin-copyright-block
#
# Redistributions of any form whatsoever must retain and/or include the
# following acknowledgment, notices and disclaimer:
#
# This product includes software developed by Carnegie Mellon University.
#
# Copyright 2012 by Mohammad Alisafaee, Eric Chung, Michael Ferdman, Brian
# Gold, Jangwoo Kim, Pejman Lotfi-Kamran, Onur Kocberber, Djordje Jevdjic,
# Jared Smolens, Stephen Somogyi, Evangelos Vlachos, Stavros Volos, Jason
# Zebchuk, Babak Falsafi, Nikos Hardavellas and Tom Wenisch for the SimFlex
# Project, Computer Architecture Lab at Carnegie Mellon, Carnegie Mellon University.
#
# For more information, see the SimFlex project website at:
# http://www.ece.cmu.edu/~simflex
#
# You may not use the name "Carnegie Mellon University" or derivations
# thereof to endorse or promote products derived from this software.
#
# If you modify the software you must place a notice on or within any
# modified version provided or made available to any third party stating
# that you have modified the software. The notice shall include at least
# your name, address, phone number, email address and the date and purpose
# of the modification.
#
# THE SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY WARRANTY OF ANY KIND, EITHER
# EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO ANY WARRANTY
# THAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS OR BE ERROR-FREE AND ANY
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
# TITLE, OR NON-INFRINGEMENT. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
# BE LIABLE FOR ANY DAMAGES, INCLUDING BUT NOT LIMITED TO DIRECT, INDIRECT,
# SPECIAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, OR IN
# ANY WAY CONNECTED WITH THIS SOFTWARE (WHETHER OR NOT BASED UPON WARRANTY,
# CONTRACT, TORT OR OTHERWISE).
#
# DO-NOT-REMOVE end-copyright-block
include makefile.defs
# This makefile is called with:
# $@ set to the name of the directory in which to build the simulator
# TARGET_OPTIONS first word as the target to build for that simulator
# TARGET_OPTIONS second word as the compiler to use
DEBUG_SETTING_OVERRIDE=$(filter crit dev trace iface verb vverb inv,$(TARGET_OPTIONS))
DEBUG_SETTING=$(if $(DEBUG_SETTING_OVERRIDE),$(DEBUG_SETTING_OVERRIDE),iface)
ICC_SELECTED=$(filter icc,$(TARGET_OPTIONS))
DOXYGEN_SELECTED=$(filter doc,$(TARGET_OPTIONS))
GCC_SELECTED=$(if $(ICC_SELECTED)$(DOXYGEN_SELECTED),$(filter gcc,$(TARGET_OPTIONS)),gcc)
override X86_SELECTED=$(filter x86,$(TARGET_OPTIONS))
override V9_SELECTED=$(if $(X86_SELECTED),$(filter v9,$(TARGET_OPTIONS)),v9)
TARGET_NO_DEBUG=$(strip $(filter-out crit dev trace iface verb vverb inv,$(TARGET_OPTIONS)))
TARGET_NO_COMP=$(strip $(filter-out icc,$(filter-out gcc,$(TARGET_NO_DEBUG))))
TARGET=$(strip $(filter-out v9,$(filter-out x86,$(filter-out doc,$(TARGET_NO_COMP)))))
# Detemine if the target component has any parts that are compiled separately (ie if it generates a library)
ifdef LOCAL_COMPONENT_HAS_LIBRARY
ifeq ($(LOCAL_COMPONENT_HAS_LIBRARY),yes)
# There are cpp files besides tester.cpp - we do create a library
.DEFAULT:
# GCC targets
#############
ifeq ($(GCC_SELECTED),gcc)
# x86 with gcc
ifeq ($(X86_SELECTED),x86)
cd $(COMPONENTS_DIR)/$@ ; $(MAKE) $(SILENT_MAKE) -f $(FLEXUS_ROOT)/makefile.component $(TARGET) SELECTED_CC=gcc TARGET_PLATFORM=x86 SELECTED_DEBUG=$(DEBUG_SETTING) COMPONENT=$@
endif
# v9 with gcc
ifeq ($(V9_SELECTED),v9)
cd $(COMPONENTS_DIR)/$@ ; $(MAKE) $(SILENT_MAKE) -f $(FLEXUS_ROOT)/makefile.component $(TARGET) SELECTED_CC=gcc TARGET_PLATFORM=v9 SELECTED_DEBUG=$(DEBUG_SETTING) COMPONENT=$@
endif
endif
# End GCC targets
# ICC targets
#############
ifeq ($(ICC_SELECTED),icc)
# x86 with icc
ifeq ($(X86_SELECTED),x86)
cd $(COMPONENTS_DIR)/$@ ; $(MAKE) $(SILENT_MAKE) -f $(FLEXUS_ROOT)/makefile.component $(TARGET) SELECTED_CC=icc TARGET_PLATFORM=x86 SELECTED_DEBUG=$(DEBUG_SETTING) COMPONENT=$@
endif
# v9 with icc
ifeq ($(V9_SELECTED),v9)
cd $(COMPONENTS_DIR)/$@ ; $(MAKE) $(SILENT_MAKE) -f $(FLEXUS_ROOT)/makefile.component $(TARGET) SELECTED_CC=icc TARGET_PLATFORM=v9 SELECTED_DEBUG=$(DEBUG_SETTING) COMPONENT=$@
endif
endif
# End ICC targets
else # value of LOCAL_COMPONENT_HAS_LIBRARY is no
.DEFAULT:
echo "$@ does not create a library"
endif # value of LOCAL_COMPONENT_HAS_LIBRARY
ifeq ($(DOXYGEN_SELECTED),doc)
cd $(COMPONENTS_DIR)/$@ ; $(MAKE) $(SILENT_MAKE) -f $(FLEXUS_ROOT)/makefile.component doc COMPONENT=$@
endif
else # LOCAL_COMPONENT_HAS_LIBRARY is not defined
.DEFAULT:
$(MAKE) $(SILENT_MAKE) -f makefile.components $@ LOCAL_COMPONENT_HAS_LIBRARY=$(call COMPONENT_HAS_LIBRARY ,$@)
endif