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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 # $2 = List of Sources | 144 # $2 = List of Sources |
145 # $3 = List of LIBS | 145 # $3 = List of LIBS |
146 # $4 = List of DEPS | 146 # $4 = List of DEPS |
147 # $5 = POSIX Linker Switches | 147 # $5 = POSIX Linker Switches |
148 # $6 = VC Linker Switches | 148 # $6 = VC Linker Switches |
149 # | 149 # |
150 define LINK_RULE | 150 define LINK_RULE |
151 $(call LINKER_RULE,$(OUTDIR)/$(1)$(HOST_EXT),$(foreach src,$(2),$(call SRC_TO_OB
J,$(src))),$(filter-out pthread,$(3)),$(4),$(LIB_PATHS),$(5)) | 151 $(call LINKER_RULE,$(OUTDIR)/$(1)$(HOST_EXT),$(foreach src,$(2),$(call SRC_TO_OB
J,$(src))),$(filter-out pthread,$(3)),$(4),$(LIB_PATHS),$(5)) |
152 endef | 152 endef |
153 | 153 |
| 154 |
| 155 # |
| 156 # Macro to generate linker scripts |
| 157 # |
| 158 # $1 = Target Name |
| 159 # $2 = Static Linker Script |
| 160 # $3 = Shared Linker Script |
| 161 # |
| 162 define LINKER_SCRIPT_RULE |
| 163 $(STAMPDIR)/$(1).stamp: |
| 164 @echo " STAMP $$@" |
| 165 @echo "TOUCHED $$@" > $(STAMPDIR)/$(1).stamp |
| 166 |
| 167 install: $(LIBDIR)/$(OSNAME)_host/$(CONFIG)/lib$(1).a |
| 168 $(LIBDIR)/$(OSNAME)_host/$(CONFIG)/lib$(1).a: $(2) |
| 169 $(MKDIR) -p $$(dir $$@) |
| 170 $(call LOG,CP ,$$@,$(OSHELPERS) cp $$^ $$@) |
| 171 |
| 172 install: $(LIBDIR)/$(OSNAME)_host/$(CONFIG)/lib$(1).so |
| 173 $(LIBDIR)/$(OSNAME)_host/$(CONFIG)/lib$(1).so: $(3) |
| 174 $(MKDIR) -p $$(dir $$@) |
| 175 $(call LOG,CP ,$$@,$(OSHELPERS) cp $$^ $$@) |
| 176 endef |
| 177 |
| 178 |
154 all: $(LIB_LIST) $(DEPS_LIST) | 179 all: $(LIB_LIST) $(DEPS_LIST) |
155 | 180 |
156 | 181 |
157 # | 182 # |
158 # Strip Macro | 183 # Strip Macro |
159 # The host build makes shared libraries, so the best we can do is -S, which | 184 # The host build makes shared libraries, so the best we can do is -S, which |
160 # only strip debug symbols. We don't strip the symbol names. | 185 # only strip debug symbols. We don't strip the symbol names. |
161 # | 186 # |
162 # $1 = Target Name | 187 # $1 = Target Name |
163 # $2 = Input Name | 188 # $2 = Input Name |
164 # | 189 # |
165 define STRIP_RULE | 190 define STRIP_RULE |
166 all: $(OUTDIR)/$(1)$(HOST_EXT) | 191 all: $(OUTDIR)/$(1)$(HOST_EXT) |
167 $(OUTDIR)/$(1)$(HOST_EXT): $(OUTDIR)/$(2)$(HOST_EXT) | 192 $(OUTDIR)/$(1)$(HOST_EXT): $(OUTDIR)/$(2)$(HOST_EXT) |
168 $(call LOG,STRIP,$$@,$(STRIP) -S -o $$@ $$^) | 193 $(call LOG,STRIP,$$@,$(STRIP) -S -o $$@ $$^) |
169 endef | 194 endef |
170 | 195 |
171 | 196 |
172 # | 197 # |
173 # Run standalone builds (command line builds outside of chrome) | 198 # Run standalone builds (command line builds outside of chrome) |
174 # | 199 # |
175 ifdef STANDALONE | 200 ifdef STANDALONE |
176 run: all | 201 run: all |
177 $(RUN_UNDER) $(OUTDIR)/$(TARGET)$(HOST_EXT) $(EXE_ARGS) | 202 $(RUN_UNDER) $(OUTDIR)/$(TARGET)$(HOST_EXT) $(EXE_ARGS) |
178 endif | 203 endif |
OLD | NEW |