author | Jon Chatten |
Wed, 17 Mar 2010 15:19:15 +0000 | |
branch | fix |
changeset 383 | 770bd0892cdd |
parent 5 | 593a8820b912 |
child 384 | e5b9f05748b8 |
permissions | -rw-r--r-- |
383
770bd0892cdd
Remove .pdb generation from tools deb builds (enabling full parallel builds).
Jon Chatten
parents:
5
diff
changeset
|
1 |
# Copyright (c) 2008-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 |
# MSVC TOOLS EXE/LIB Function Like Makefile (FLM) |
|
15 |
# Knows how to build all possible executables for the TOOLS build |
|
16 |
# |
|
17 |
# |
|
18 |
||
19 |
CLEANTARGETS:= |
|
20 |
RELEASABLES:= |
|
21 |
INSTALLTARGET:= |
|
22 |
||
23 |
RELEASEPATH:=$(RELEASEPATHROOT)/$(FULLVARIANTPATH) |
|
24 |
BUILDPATH:=$(OUTPUTPATH)/$(FULLVARIANTPATH) |
|
25 |
RELEASETARGET:=$(RELEASEPATH)/$(TARGET).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(TARGETTYPE)) |
|
26 |
||
27 |
# make the output directories while reading makefile - some build engines prefer this |
|
28 |
$(call makepath,$(RELEASEPATH)) |
|
29 |
$(call makepath,$(BUILDPATH)) |
|
30 |
||
31 |
RELEASEABLES:=$(RELEASEABLES) $(RELEASETARGET) |
|
32 |
||
33 |
GENDEBUGINFO:=$(if $(findstring deb,$(VARIANTTYPE)),1,) |
|
34 |
||
35 |
# MSVC "no space" arguments must take the form /<ARG><PATH_WITH_DOS_SLASHES> e.g. |
|
36 |
# /FoF:\object\file\to\be\created.obj |
|
37 |
define msvcformatarg |
|
38 |
$(1)$(subst /,\\\,$(2)) |
|
39 |
endef |
|
40 |
||
41 |
############# |
|
42 |
## COMPILE ## |
|
43 |
############# |
|
44 |
||
45 |
# object files and related |
|
46 |
OBJFILES:=$(patsubst %,$(BUILDPATH)/%.obj,$(basename $(notdir $(SOURCE)))) |
|
47 |
SBRFILES:=$(addsuffix .sbr, $(basename $(OBJFILES))) |
|
48 |
LISFILES:=$(addsuffix .lis, $(basename $(OBJFILES))) |
|
49 |
LSTFILES:=$(addsuffix .tools.lst, $(basename $(SOURCE))) |
|
50 |
CLEANTARGETS:=$(CLEANTARGETS) $(OBJFILES) $(SBRFILES) $(LISFILES) $(LSTFILES) |
|
51 |
||
52 |
# include paths and preinclude file |
|
53 |
UINCLUDE:=$(patsubst %,$(OPT.USERINCLUDE)%,$(USERINCLUDE)) |
|
54 |
SINCLUDE:=$(patsubst %,$(OPT.SYSINCLUDE)%,$(SYSTEMINCLUDE)) |
|
55 |
PINCLUDE:=$(OPT.PREINCLUDE)$(notdir $(PRODUCT_INCLUDE)) |
|
56 |
INCLUDES:=$(PINCLUDE) $(UINCLUDE) $(SINCLUDE) |
|
57 |
||
58 |
# macros |
|
59 |
DEFINES:=$(call makemacrodef,$(OPT.DEFINE),$(CDEFS) $(BASE_MACRO) $(CFLAGS.ADD)) |
|
60 |
||
61 |
# other |
|
383
770bd0892cdd
Remove .pdb generation from tools deb builds (enabling full parallel builds).
Jon Chatten
parents:
5
diff
changeset
|
62 |
CLEANTARGETS:=$(CLEANTARGETS) |
3 | 63 |
|
64 |
#compile |
|
65 |
define msvctoolscompile |
|
66 |
$(BUILDPATH)/$(basename $(notdir $(1))).obj: $(1) $(PROJECT_META) $(if $(HAVE_ORDERONLY),|,) EXPORT |
|
67 |
$(call startrule,msvctoolscompile,,$(1)) \ |
|
68 |
$(CC) \ |
|
69 |
$(if $(findstring staticlib,$(BASE_TYPE)),,$(CFLAGS.LIB)) \ |
|
70 |
$(CFLAGS) $$(subst /,-,$(OPTION_MSVC)) \ |
|
71 |
$(if $(findstring /W,$(OPTION_MSVC)),,$(CFLAGS.DEFAULT.WARNLEVEL)) \ |
|
72 |
$(DEFINES) $(INCLUDES) \ |
|
73 |
$$(call msvcformatarg,$(OPT.BROWSEFILE),$(BUILDPATH)/$(basename $(notdir $(1))).sbr) \ |
|
74 |
$$(call msvcformatarg,$(OPT.OBJECTFILE),$$@) $(1) \ |
|
75 |
$(call endrule,msvctoolscompile) |
|
76 |
endef |
|
77 |
# make the output directories while reading makefile - some build engines prefer this |
|
78 |
$(call makepath,$(BUILDPATH)) |
|
79 |
$(foreach SRCFILE,$(SOURCE),$(eval $(call msvctoolscompile,$(SRCFILE)))) |
|
80 |
||
81 |
# assembler listing |
|
82 |
define msvctoolslisting |
|
83 |
LISTING:: $(BUILDPATH)/$(basename $(notdir $(1))).lis |
|
84 |
$(GNUCP) $$< $(basename $(1)).tools.lst |
|
85 |
||
86 |
$(BUILDPATH)/$(basename $(notdir $(1))).lis: $(1) |
|
87 |
$(call startrule,msvctoolslisting) \ |
|
88 |
$(CC) \ |
|
89 |
$(if $(findstring staticlib,$(BASE_TYPE)),,$(CFLAGS.LIB)) \ |
|
90 |
$(CFLAGS) $$(subst /,-,$(OPTION_MSVC)) \ |
|
91 |
$(if $(findstring /W,$(OPTION_MSVC)),,$(CFLAGS.DEFAULT.WARNLEVEL)) \ |
|
92 |
$(DEFINES) $(INCLUDES) \ |
|
93 |
$$(call msvcformatarg,$(OPT.LISTING),$(BUILDPATH)/$(basename $(notdir $(1))).lis) \ |
|
94 |
$(1) \ |
|
95 |
$(call endrule,msvctoolslisting) |
|
96 |
||
97 |
endef |
|
98 |
$(foreach SRCFILE,$(SOURCE),$(eval $(call msvctoolslisting,$(SRCFILE)))) |
|
99 |
||
100 |
||
101 |
ifeq ($(BASE_TYPE),staticlib) |
|
102 |
||
103 |
############# |
|
104 |
## ARCHIVE ## |
|
105 |
############# |
|
106 |
||
107 |
ARCHIVERRESPONSEFILE:=$(BUILDPATH)/$(TARGET).arf |
|
108 |
CLEANTARGETS:=$(CLEANTARGETS) $(ARCHIVERRESPONSEFILE) |
|
109 |
||
110 |
define msvctoolsarchive |
|
111 |
$(RELEASETARGET): $(OBJFILES) |
|
112 |
@echo "" > $(ARCHIVERRESPONSEFILE); |
|
113 |
$(call groupin10infile,$(ARCHIVERRESPONSEFILE),$(OBJFILES)) ; |
|
114 |
$(call startrule,msvctoolsarchive) \ |
|
115 |
$(AR) $(ARFLAGS) $(OPT.SUBSYSTEM)$(SUBSYSTEM) $$(call msvcformatarg,$(OPT.OUTFILE),$$@) \ |
|
116 |
$$(call msvcformatarg,$(PREFIX.RESPONSEFILE),$(ARCHIVERRESPONSEFILE)) \ |
|
117 |
$(if $(SAVESPACE),; $(GNURM) -f $(OBJFILES); true,) \ |
|
118 |
$(call endrule,msvctoolsarchive) |
|
119 |
||
120 |
endef |
|
121 |
$(eval $(msvctoolsarchive)) |
|
122 |
||
123 |
else |
|
124 |
||
125 |
########## |
|
126 |
## LINK ## |
|
127 |
########## |
|
128 |
||
129 |
STATICLIBS:=$(patsubst %,$(RELEASEPATH)/%.lib,$(STATICLIBRARY)) |
|
130 |
IMPORTLIBS:=$(patsubst %.dso,$(IMPORTLIBPATH)/%.lib,$(LIBRARY)) |
|
131 |
LINKERRESPONSEFILE:=$(BUILDPATH)/$(TARGET).lrf |
|
132 |
CLEANTARGETS:=$(CLEANTARGETS) $(RELEASETARGET).lib $(LINKERRESPONSEFILE) |
|
133 |
||
134 |
define msvctoolslink |
|
135 |
$(RELEASETARGET): $(OBJFILES) $(STATICLIBS) $(IMPORTLIBS) |
|
136 |
@echo "" > $(LINKERRESPONSEFILE); |
|
137 |
$(call groupin10infile,$(LINKERRESPONSEFILE),$(STATICLIBS) $(IMPORTLIBS) $(OBJFILES)) ; |
|
138 |
$(call startrule,msvctoolslink) \ |
|
139 |
$(LD) $(LFLAGS) $(WIN32_LIBRARY) $(OPT.SUBSYSTEM)$(SUBSYSTEM) \ |
|
140 |
$$(call msvcformatarg,$(OPT.OUTFILE),$$@) \ |
|
141 |
$$(call msvcformatarg,$(OPT.IMPLIB),$(RELEASETARGET).lib) \ |
|
142 |
$$(call msvcformatarg,$(PREFIX.RESPONSEFILE),$(LINKERRESPONSEFILE)) \ |
|
143 |
$(if $(SAVESPACE),; $(GNURM) -f $(OBJFILES); true,) \ |
|
144 |
$(call endrule,msvctoolslink) |
|
145 |
endef |
|
146 |
$(eval $(msvctoolslink)) |
|
147 |
||
148 |
endif |
|
149 |
||
150 |
||
151 |
############# |
|
152 |
## INSTALL ## |
|
153 |
############# |
|
154 |
||
155 |
ifneq ($(INSTALLPATH),) |
|
156 |
INSTALLTARGET:=$(INSTALLPATH)/$(TARGET).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(TARGETTYPE)) |
|
157 |
RELEASEABLES:=$(RELEASEABLES) $(INSTALLTARGET) |
|
158 |
||
159 |
define msvctoolsinstall |
|
160 |
$(INSTALLTARGET): $(RELEASETARGET) |
|
161 |
$(call startrule,msvctoolsinstall) \ |
|
162 |
$(GNUCP) $$< $$@ && \ |
|
163 |
$(GNUCHMOD) a+rwx $$@ \ |
|
164 |
$(call endrule,msvctoolsinstall) |
|
165 |
endef |
|
166 |
# make the output directories while reading makefile - some build engines prefer this |
|
167 |
$(call makepath,$(INSTALLPATH)) |
|
168 |
$(eval $(msvctoolsinstall)) |
|
169 |
endif |
|
170 |
||
171 |
||
172 |
########################## |
|
173 |
## BROWSE DB GENERATION ## |
|
174 |
########################## |
|
175 |
||
176 |
ifneq ($(GENDEBUGINFO),) |
|
177 |
BSCFILE:=$(RELEASEPATH)/$(TARGET).bsc |
|
178 |
BSCRESPONSEFILE:=$(BUILDPATH)/$(TARGET).brf |
|
5 | 179 |
CLEANTARGETS:=$(CLEANTARGETS) $(BSCRESPONSEFILE) |
3 | 180 |
RELEASEABLES:=$(RELEASEABLES) $(BSCFILE) |
181 |
||
182 |
define msvctoolsgenbrowse |
|
183 |
$(BSCFILE): $(OBJFILES) |
|
184 |
@echo "" > $(BSCRESPONSEFILE); |
|
185 |
$(call groupin10infile,$(BSCRESPONSEFILE),$(SBRFILES)) ; |
|
186 |
$(call startrule,msvctoolsgenbrowse) \ |
|
187 |
$(BROWSETOOL) $(BROWSEFLAGS) $$(call msvcformatarg,$(OPT.BROWSEDB),$$@) \ |
|
188 |
$$(call msvcformatarg,$(PREFIX.RESPONSEFILE),$(BSCRESPONSEFILE)) \ |
|
189 |
$(if $(SAVESPACE),; $(GNURM) -f $(SBRFILES); true,) \ |
|
190 |
$(call endrule,msvctoolsgenbrowse) |
|
191 |
endef |
|
192 |
$(eval $(msvctoolsgenbrowse)) |
|
193 |
endif |
|
194 |
||
195 |
||
196 |
# Global targets |
|
197 |
.PHONY:: $(ALLTARGET) |
|
198 |
$(ALLTARGET):: $(RELEASEABLES) |
|
199 |
TARGET:: $(RELEASEABLES) |
|
200 |
||
201 |
ifeq ($(BASE_TYPE),staticlib) |
|
202 |
LIBRARY:: $(RELEASETARGET) $(INSTALLTARGET) |
|
203 |
endif |
|
204 |
||
205 |
# clean up |
|
5 | 206 |
$(call raptor_clean,$(CLEANTARGETS)) |
207 |
# for the --what option and the log file |
|
208 |
$(call raptor_release,$(INSTALLTARGET)) |