OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # | 5 # |
6 # GNU Make based build file. For details on GNU Make see: | 6 # GNU Make based build file. For details on GNU Make see: |
7 # http://www.gnu.org/software/make/manual/make.html | 7 # http://www.gnu.org/software/make/manual/make.html |
8 # | 8 # |
9 | 9 |
10 # | 10 # |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 # $6 = VC Linker Switches | 114 # $6 = VC Linker Switches |
115 # | 115 # |
116 define LINK_RULE | 116 define LINK_RULE |
117 $(call LINKER_RULE,$(OUTDIR)/$(1),$(foreach src,$(2),$(call SRC_TO_OBJ,$(src))),
$(filter-out pthread,$(3)),$(4),$(LIB_PATHS),$(5)) | 117 $(call LINKER_RULE,$(OUTDIR)/$(1),$(foreach src,$(2),$(call SRC_TO_OBJ,$(src))),
$(filter-out pthread,$(3)),$(4),$(LIB_PATHS),$(5)) |
118 endef | 118 endef |
119 | 119 |
120 | 120 |
121 # | 121 # |
122 # Strip Macro | 122 # Strip Macro |
123 # | 123 # |
124 # NOTE: pnacl-strip does not currently support stripping finalized pexes (in a | 124 # NOTE: pnacl-strip does not really do much for finalized pexes (in a |
125 # sense, they are already stripped). So we just copy the file instead. | 125 # sense, they are already stripped), but set this rule up for uniformity. |
126 # | |
127 # See https://code.google.com/p/nativeclient/issues/detail?id=3534 | |
128 # | 126 # |
129 # $1 = Target Name | 127 # $1 = Target Name |
130 # $2 = Input Name | 128 # $2 = Input Name |
131 # | 129 # |
132 define STRIP_RULE | 130 define STRIP_RULE |
133 all: $(OUTDIR)/$(1).pexe | 131 all: $(OUTDIR)/$(1).pexe |
134 $(OUTDIR)/$(1).pexe: $(OUTDIR)/$(2).pexe | 132 $(OUTDIR)/$(1).pexe: $(OUTDIR)/$(2).pexe |
135 » $(CP) $$^ $$@ | 133 » $(call LOG,STRIP,$$@,$(PNACL_STRIP) $$^ -o $$@) |
136 endef | 134 endef |
137 | 135 |
138 | 136 |
139 # | 137 # |
140 # NMF Manifiest generation | 138 # NMF Manifest generation |
141 # | 139 # |
142 # Use the python script create_nmf to scan the binaries for dependencies using | 140 # Use the python script create_nmf to scan the binaries for dependencies using |
143 # objdump. Pass in the (-L) paths to the default library toolchains so that we | 141 # objdump. Pass in the (-L) paths to the default library toolchains so that we |
144 # can find those libraries and have it automatically copy the files (-s) to | 142 # can find those libraries and have it automatically copy the files (-s) to |
145 # the target directory for us. | 143 # the target directory for us. |
146 # | 144 # |
147 # $1 = Target Name (the basename of the nmf | 145 # $1 = Target Name (the basename of the nmf) |
148 # $2 = Additional create_nmf.py arguments | 146 # $2 = Additional create_nmf.py arguments |
149 # | 147 # |
150 NMF:=python $(NACL_SDK_ROOT)/tools/create_nmf.py | 148 NMF:=python $(NACL_SDK_ROOT)/tools/create_nmf.py |
151 | 149 |
152 EXECUTABLES=$(OUTDIR)/$(1).pexe $(OUTDIR)/$(1)_unstripped.bc | 150 EXECUTABLES=$(OUTDIR)/$(1).pexe $(OUTDIR)/$(1)_unstripped.bc |
153 | 151 |
154 define NMF_RULE | 152 define NMF_RULE |
155 all: $(OUTDIR)/$(1).nmf | 153 all: $(OUTDIR)/$(1).nmf |
156 $(OUTDIR)/$(1).nmf: $(EXECUTABLES) | 154 $(OUTDIR)/$(1).nmf: $(EXECUTABLES) |
157 $(call LOG,CREATE_NMF,$$@,$(NMF) -o $$@ $$^ -s $(OUTDIR) $(2)) | 155 $(call LOG,CREATE_NMF,$$@,$(NMF) -o $$@ $$^ -s $(OUTDIR) $(2)) |
158 endef | 156 endef |
159 | 157 |
160 # | 158 # |
161 # HTML file generation | 159 # HTML file generation |
162 # | 160 # |
163 CREATE_HTML := python $(NACL_SDK_ROOT)/tools/create_html.py | 161 CREATE_HTML := python $(NACL_SDK_ROOT)/tools/create_html.py |
164 | 162 |
165 define HTML_RULE | 163 define HTML_RULE |
166 all: $(OUTDIR)/$(1).html | 164 all: $(OUTDIR)/$(1).html |
167 $(OUTDIR)/$(1).html: $(EXECUTABLES) | 165 $(OUTDIR)/$(1).html: $(EXECUTABLES) |
168 $(call LOG,CREATE_HTML,$$@,$(CREATE_HTML) -o $$@ $$^) | 166 $(call LOG,CREATE_HTML,$$@,$(CREATE_HTML) -o $$@ $$^) |
169 endef | 167 endef |
OLD | NEW |