Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(731)

Side by Side Diff: native_client_sdk/src/tools/host_vc.mk

Issue 11882012: Convert all project to use common.mk (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « native_client_sdk/src/tools/host_gcc.mk ('k') | native_client_sdk/src/tools/nacl_gcc.mk » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 #
6 # GNU Make based build file. For details on GNU Make see:
7 # http://www.gnu.org/software/make/manual/make.html
8 #
9 #
10
11
12 #
13 # Macros for TOOLS
14 #
15 # We use the C++ compiler for everything and then use the -Wl,-as-needed flag
16 # in the linker to drop libc++ unless it's actually needed.
17 #
18 HOST_CC?=cl.exe /nologo /WX
19 HOST_CXX?=cl.exe /nologo /EHsc /WX
20 HOST_LINK?=link.exe /nologo
21 HOST_LIB?=lib.exe /nologo
22
23
24 ifeq ('Debug','$(CONFIG)')
25 WIN_OPT_FLAGS?=/Od /MTd /Z7
26 else
27 WIN_OPT_FLAGS?=/O2 /MT /Z7
28 endif
29
30 WIN_FLAGS?=-D WIN32 -D _WIN32 -D PTW32_STATIC_LIB
31
32
33 #
34 # Individual Macros
35 #
36 # $1 = Source Name
37 # $2 = Compile Flags
38 #
39 define C_COMPILER_RULE
40 $(OUTDIR)/$(basename $(1)).o : $(1) $(TOP_MAKE) | $(OUTDIR)
41 $(HOST_CC) /Fo$$@ /c $$< $(WIN_OPT_FLAGS) $(2) $(WIN_FLAGS)
42 endef
43
44 define CXX_COMPILER_RULE
45 $(OUTDIR)/$(basename $(1)).o : $(1) $(TOP_MAKE) | $(OUTDIR)
46 $(HOST_CXX) /Fo$$@ -c $$< $(WIN_OPT_FLAGS) $(2) $(WIN_FLAGS)
47 endef
48
49
50 # $1 = Source Name
51 # $2 = POSIX Compile Flags (unused)
52 # $3 = VC Compile Flags
53 #
54 define COMPILE_RULE
55 ifeq ('.c','$(suffix $(1))')
56 $(call C_COMPILER_RULE,$(1),$(3) $(foreach inc,$(INC_PATHS),/I$(inc)))
57 else
58 $(call CXX_COMPILER_RULE,$(1),$(3) $(foreach inc,$(INC_PATHS),/I$(inc)))
59 endif
60 endef
61
62
63 #
64 # LIB Macro
65 #
66 # $1 = Target Name
67 # $2 = List of Sources
68 #
69 #
70 define LIB_RULE
71 all:$(NACL_SDK_ROOT)/lib/$(OSNAME)_host/$(CONFIG)/$(1).lib
72 $(NACL_SDK_ROOT)/lib/$(OSNAME)_host/$(CONFIG)/$(1).lib : $(foreach src,$(2),$(OU TDIR)/$(basename $(src)).o)
73 $(MKDIR) -p $(dir $$@)
74 $(HOST_LIB) $$@ $$^ $(WIN_LDFLAGS)
75 endef
76
77
78 #
79 # Link Macro
80 #
81 # $1 = Target Name
82 # $2 = List of inputs
83 # $3 = List of libs
84 # $4 = List of deps
85 # $5 = List of lib dirs
86 # $6 = Other Linker Args
87 #
88 define LINKER_RULE
89 all: $(1)
90 $(1) : $(2) $(4)
91 $(HOST_LINK) /DLL /OUT:$(1) /PDB:$(1).pdb $(2) /DEBUG $(foreach path,$(5 ),/LIBPATH:$(path)) $(foreach lib,$(3),$(lib.lib)) $(6)
92 endef
93
94
95 #
96 # Link Macro
97 #
98 # $1 = Target Name
99 # $2 = List of Sources
100 # $3 = List of LIBS
101 # $4 = List of DEPS
102 # $5 = POSIX Linker Switches
103 # $6 = VC Linker Switches
104 #
105 define LINK_RULE
106 $(call LINKER_RULE,$(OUTDIR)/$(1)$(HOST_EXT),$(foreach src,$(2),$(OUTDIR)/$(base name $(src)).o),$(3),$(4),$(LIB_PATHS),$(6))
107 endef
108
109
110 #
111 # NMF Manifiest generation
112 #
113 # Use the python script create_nmf to scan the binaries for dependencies using
114 # objdump. Pass in the (-L) paths to the default library toolchains so that we
115 # can find those libraries and have it automatically copy the files (-s) to
116 # the target directory for us.
117 #
118 # $1 = Target Name (the basename of the nmf
119 # $2 = Additional create_nmf.py arguments
120 #
121 NMF:=python $(NACL_SDK_ROOT)/tools/create_nmf.py
122
123 define NMF_RULE
124 NMF_LIST+=$(OUTDIR)/$(1).nmf
125 $(OUTDIR)/$(1).nmf : $(OUTDIR)/$(1)$(HOST_EXT)
126 @echo "Host Toolchain" > $$@
127 endef
128
129 all : $(LIB_LIST) $(DEPS_LIST) $(NMF_LIST)
130
OLDNEW
« no previous file with comments | « native_client_sdk/src/tools/host_gcc.mk ('k') | native_client_sdk/src/tools/nacl_gcc.mk » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698