author | Richard Taylor <richard.i.taylor@nokia.com> |
Thu, 18 Mar 2010 15:12:39 +0000 | |
branch | wip |
changeset 381 | 8052c8afe93e |
parent 342 | f0e42ff3359f |
permissions | -rw-r--r-- |
225
d401dbd3a410
Ensure that parallel parsing sbs calls pass on --no-depend-generate and --no-depend-include (as these influence makefile generation).
Jon Chatten
parents:
220
diff
changeset
|
1 |
# Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 | 2 |
# All rights reserved. |
3 |
# This component and the accompanying materials are made available |
|
4 |
# under the terms of the License "Eclipse Public License v1.0" |
|
5 |
# which accompanies this distribution, and is available |
|
6 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
# |
|
8 |
# Initial Contributors: |
|
9 |
# Nokia Corporation - initial contribution. |
|
10 |
# |
|
11 |
# Contributors: |
|
12 |
# |
|
13 |
# Description: |
|
14 |
# Function-Like Makefile to build common TOOLS2 objects with gcc |
|
15 |
# (included by tools2exe.flm and tools2lib.flm) |
|
16 |
# |
|
17 |
# |
|
18 |
||
19 |
## Input parameters |
|
20 |
||
319 | 21 |
ifeq ($(filter win,$(HOSTPLATFORM)),win) |
3 | 22 |
CDEFS.TOOLS2:=$(CDEFS.WIN32) $(CDEFS) |
23 |
CFLAGS:=$(CFLAGS.WIN32) $(CFLAGS) $(OPTION_GCC) |
|
24 |
COMPILER_PATH:=$(COMPILER_PATH.WIN32) |
|
25 |
OUTPUTPATH:=$(OUTPUTPATH)/$(TARGET)_$(TARGETTYPE)/tools2/$(VARIANTTYPE)$(TOOLPLATFORMDIR) |
|
26 |
else |
|
317 | 27 |
ifneq ($(TOOLS2WIN32),) |
28 |
# Build win32 tools in Linux |
|
3 | 29 |
CDEFS.TOOLS2:=$(CDEFS.WIN32) $(CDEFS) |
30 |
CFLAGS:=$(CFLAGS.WIN32) $(CFLAGS) $(OPTION_GCC) |
|
31 |
COMPILER_PATH:=$(COMPILER_PATH.WIN32) |
|
317 | 32 |
OUTPUTPATH:=$(OUTPUTPATH)/$(TARGET)_$(TARGETTYPE)/tools2/$(VARIANTTYPE) |
3 | 33 |
else |
317 | 34 |
# Build linux tools in Linux |
3 | 35 |
CDEFS.TOOLS2:=$(CDEFS.LINUX) $(CDEFS) |
36 |
CFLAGS:=$(CFLAGS) $(OPTION_GCC) |
|
37 |
COMPILER_PATH=$(COMPILER_PATH.LINUX) |
|
317 | 38 |
OUTPUTPATH:=$(OUTPUTPATH)/$(TARGET)_$(TARGETTYPE)/tools2/$(VARIANTTYPE)$(TOOLPLATFORMDIR) |
3 | 39 |
endif |
317 | 40 |
endif |
41 |
||
42 |
||
3 | 43 |
CDEFS.TOOLS2:=$(call makemacrodef,$(OPT.D),$(CDEFS.TOOLS2)) |
44 |
||
45 |
## Locally used variables |
|
46 |
CREATABLEPATHS:=$(OUTPUTPATH) $(RELEASEPATH) $(TOOLSPATH) |
|
47 |
||
48 |
## Global targets |
|
49 |
$(ALLTARGET):: $(TARGETS) |
|
50 |
TARGET:: $(TARGETS) |
|
51 |
||
52 |
## Pre-Include directories |
|
53 |
ifneq ($(INC.COMPILER),) |
|
54 |
PINCLUDE:=$(patsubst %,$(OPT.PREINCLUDE)%,$(INC.COMPILER)) |
|
55 |
endif |
|
56 |
||
57 |
## User and System Include directories |
|
58 |
ifneq ($(USERINCLUDE),) |
|
59 |
UINCLUDE:=$(patsubst %,$(OPT.USERINCLUDE)%,$(USERINCLUDE)) |
|
60 |
endif |
|
61 |
ifneq ($(SYSTEMINCLUDE),) |
|
62 |
SINCLUDE:=$(patsubst %,$(OPT.SYSTEMINCLUDE)%,$(SYSTEMINCLUDE)) |
|
63 |
endif |
|
64 |
||
65 |
INCLUDES:=$(PINCLUDE) $(UINCLUDE) $(SINCLUDE) |
|
66 |
||
67 |
## Source files |
|
68 |
CPPFILES:=$(filter %.CPP,$(SOURCE)) |
|
69 |
cppFILES:=$(filter %.cpp,$(SOURCE)) |
|
70 |
CFILES:=$(filter %.C,$(SOURCE)) |
|
71 |
cFILES:=$(filter %.c,$(SOURCE)) |
|
72 |
||
73 |
## Object files |
|
74 |
CPPOBJFILES:=$(patsubst %,$(OUTPUTPATH)/%,$(notdir $(patsubst %.CPP,%.o,$(CPPFILES)))) |
|
75 |
cppOBJFILES:=$(patsubst %,$(OUTPUTPATH)/%,$(notdir $(patsubst %.cpp,%.o,$(cppFILES)))) |
|
76 |
COBJFILES:=$(patsubst %,$(OUTPUTPATH)/%,$(notdir $(patsubst %.C,%.o,$(CFILES)))) |
|
77 |
cOBJFILES:=$(patsubst %,$(OUTPUTPATH)/%,$(notdir $(patsubst %.c,%.o,$(cFILES)))) |
|
78 |
OBJECTFILES:=$(CPPOBJFILES) $(cppOBJFILES) $(cOBJFILES) $(COBJFILES) |
|
79 |
||
80 |
CLEANTARGETS:= |
|
81 |
## Compile CPP and cpp files |
|
82 |
define compile2object |
|
83 |
$(eval compile2object_TARGET:=$(OUTPUTPATH)/$(patsubst %.$(2),%.o,$(notdir $(1)))) |
|
84 |
$(eval DEPENDFILENAME:=$(compile2object_TARGET).d) |
|
85 |
$(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME))) |
|
86 |
$(compile2object_TARGET): $(1) $(if (DEPENDFILE),,EXPORT) |
|
87 |
$(call startrule,compile2object,,$(1)) \ |
|
88 |
$(if $(COMPILER_PATH),COMPILER_PATH="$(COMPILER_PATH)",) \ |
|
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
29
diff
changeset
|
89 |
$(COMPILER) $(CFLAGS) $(CDEFS.TOOLS2) \ |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
29
diff
changeset
|
90 |
$(if $(NO_DEPEND_GENERATE),,-MD -MT"$$@" -MF"$(DEPENDFILENAME)") \ |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
29
diff
changeset
|
91 |
$(INCLUDES) $(OPT.O)"$$@" "$(1)" \ |
3 | 92 |
$(call endrule,compile2object) |
93 |
||
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
29
diff
changeset
|
94 |
ifeq ($(NO_DEPEND_GENERATE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
29
diff
changeset
|
95 |
CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
29
diff
changeset
|
96 |
endif |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
29
diff
changeset
|
97 |
|
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
29
diff
changeset
|
98 |
ifneq ($(DEPENDFILE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
29
diff
changeset
|
99 |
ifeq ($(NO_DEPEND_INCLUDE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
29
diff
changeset
|
100 |
ifeq ($(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS))),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
29
diff
changeset
|
101 |
-include $(DEPENDFILE) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
29
diff
changeset
|
102 |
endif |
3 | 103 |
endif |
104 |
endif |
|
105 |
||
106 |
endef |
|
107 |
||
108 |
$(foreach SRC,$(CPPFILES),$(eval $(call compile2object,$(SRC),CPP))) |
|
109 |
$(foreach SRC,$(cppFILES),$(eval $(call compile2object,$(SRC),cpp))) |
|
110 |
$(foreach SRC,$(CFILES),$(eval $(call compile2object,$(SRC),C))) |
|
111 |
$(foreach SRC,$(cFILES),$(eval $(call compile2object,$(SRC),c))) |
|
112 |
||
113 |
### Conclusion - cleanup and introspection ####################### |
|
114 |
||
115 |
# make the output directories while reading makefile - some build engines prefer this |
|
116 |
$(call makepath,$(CREATABLEPATHS)) |
|
117 |
||
5 | 118 |
## Clean up |
119 |
$(call raptor_clean,$(CLEANTARGETS) $(OBJECTFILES)) |
|
120 |
## for the --what option and the log file |
|
29
ee00c00df073
Catchup to Perforce WIP with timing, python24
timothy.murphy@nokia.com
parents:
5
diff
changeset
|
121 |
$(call raptor_release,$(RELEASABLES)) |
3 | 122 |
|
123 |
## The End |