author | yiluzhu |
Tue, 23 Feb 2010 14:22:19 +0000 | |
branch | fix |
changeset 247 | 8426d4dedf84 |
parent 225 | d401dbd3a410 |
child 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 |
||
21 |
OUTPUTPATH:=$(OUTPUTPATH)/$(TARGET)_$(TARGETTYPE)/tools2/$(VARIANTTYPE)$(TOOLPLATFORMDIR) |
|
22 |
||
23 |
ifeq ($(OSTYPE),cygwin) |
|
24 |
CDEFS.TOOLS2:=$(CDEFS.WIN32) $(CDEFS) |
|
25 |
CFLAGS:=$(CFLAGS.WIN32) $(CFLAGS) $(OPTION_GCC) |
|
26 |
COMPILER_PATH:=$(COMPILER_PATH.WIN32) |
|
27 |
else |
|
28 |
CDEFS.TOOLS2:=$(CDEFS.LINUX) $(CDEFS) |
|
29 |
CFLAGS:=$(CFLAGS) $(OPTION_GCC) |
|
30 |
COMPILER_PATH=$(COMPILER_PATH.LINUX) |
|
31 |
endif |
|
32 |
CDEFS.TOOLS2:=$(call makemacrodef,$(OPT.D),$(CDEFS.TOOLS2)) |
|
33 |
||
34 |
## Locally used variables |
|
35 |
CREATABLEPATHS:=$(OUTPUTPATH) $(RELEASEPATH) $(TOOLSPATH) |
|
36 |
||
37 |
## Global targets |
|
38 |
$(ALLTARGET):: $(TARGETS) |
|
39 |
TARGET:: $(TARGETS) |
|
40 |
||
41 |
## Pre-Include directories |
|
42 |
ifneq ($(INC.COMPILER),) |
|
43 |
PINCLUDE:=$(patsubst %,$(OPT.PREINCLUDE)%,$(INC.COMPILER)) |
|
44 |
endif |
|
45 |
||
46 |
## User and System Include directories |
|
47 |
ifneq ($(USERINCLUDE),) |
|
48 |
UINCLUDE:=$(patsubst %,$(OPT.USERINCLUDE)%,$(USERINCLUDE)) |
|
49 |
endif |
|
50 |
ifneq ($(SYSTEMINCLUDE),) |
|
51 |
SINCLUDE:=$(patsubst %,$(OPT.SYSTEMINCLUDE)%,$(SYSTEMINCLUDE)) |
|
52 |
endif |
|
53 |
||
54 |
INCLUDES:=$(PINCLUDE) $(UINCLUDE) $(SINCLUDE) |
|
55 |
||
56 |
## Source files |
|
57 |
CPPFILES:=$(filter %.CPP,$(SOURCE)) |
|
58 |
cppFILES:=$(filter %.cpp,$(SOURCE)) |
|
59 |
CFILES:=$(filter %.C,$(SOURCE)) |
|
60 |
cFILES:=$(filter %.c,$(SOURCE)) |
|
61 |
||
62 |
## Object files |
|
63 |
CPPOBJFILES:=$(patsubst %,$(OUTPUTPATH)/%,$(notdir $(patsubst %.CPP,%.o,$(CPPFILES)))) |
|
64 |
cppOBJFILES:=$(patsubst %,$(OUTPUTPATH)/%,$(notdir $(patsubst %.cpp,%.o,$(cppFILES)))) |
|
65 |
COBJFILES:=$(patsubst %,$(OUTPUTPATH)/%,$(notdir $(patsubst %.C,%.o,$(CFILES)))) |
|
66 |
cOBJFILES:=$(patsubst %,$(OUTPUTPATH)/%,$(notdir $(patsubst %.c,%.o,$(cFILES)))) |
|
67 |
OBJECTFILES:=$(CPPOBJFILES) $(cppOBJFILES) $(cOBJFILES) $(COBJFILES) |
|
68 |
||
69 |
CLEANTARGETS:= |
|
70 |
## Compile CPP and cpp files |
|
71 |
define compile2object |
|
72 |
$(eval compile2object_TARGET:=$(OUTPUTPATH)/$(patsubst %.$(2),%.o,$(notdir $(1)))) |
|
73 |
$(eval DEPENDFILENAME:=$(compile2object_TARGET).d) |
|
74 |
$(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME))) |
|
75 |
$(compile2object_TARGET): $(1) $(if (DEPENDFILE),,EXPORT) |
|
76 |
$(call startrule,compile2object,,$(1)) \ |
|
77 |
$(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
|
78 |
$(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
|
79 |
$(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
|
80 |
$(INCLUDES) $(OPT.O)"$$@" "$(1)" \ |
3 | 81 |
$(call endrule,compile2object) |
82 |
||
220
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
29
diff
changeset
|
83 |
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
|
84 |
CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
29
diff
changeset
|
85 |
endif |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
29
diff
changeset
|
86 |
|
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
29
diff
changeset
|
87 |
ifneq ($(DEPENDFILE),) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
29
diff
changeset
|
88 |
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
|
89 |
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
|
90 |
-include $(DEPENDFILE) |
f7d68ecb923e
Add support for NO_DEPEND_GENERATE to makefile calls and respond accordingly in FLMs.
Jon Chatten
parents:
29
diff
changeset
|
91 |
endif |
3 | 92 |
endif |
93 |
endif |
|
94 |
||
95 |
endef |
|
96 |
||
97 |
$(foreach SRC,$(CPPFILES),$(eval $(call compile2object,$(SRC),CPP))) |
|
98 |
$(foreach SRC,$(cppFILES),$(eval $(call compile2object,$(SRC),cpp))) |
|
99 |
$(foreach SRC,$(CFILES),$(eval $(call compile2object,$(SRC),C))) |
|
100 |
$(foreach SRC,$(cFILES),$(eval $(call compile2object,$(SRC),c))) |
|
101 |
||
102 |
### Conclusion - cleanup and introspection ####################### |
|
103 |
||
104 |
# make the output directories while reading makefile - some build engines prefer this |
|
105 |
$(call makepath,$(CREATABLEPATHS)) |
|
106 |
||
5 | 107 |
## Clean up |
108 |
$(call raptor_clean,$(CLEANTARGETS) $(OBJECTFILES)) |
|
109 |
## 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
|
110 |
$(call raptor_release,$(RELEASABLES)) |
3 | 111 |
|
112 |
## The End |