blob: a369be8cd09a4609efb11bc59bd0501ede92da33 [file] [log] [blame]
John Koleszar0ea50ce2010-05-18 11:58:33 -04001##
John Koleszarc2140b82010-09-09 08:16:39 -04002## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
John Koleszar94c52e42010-06-18 12:39:21 -04003##
4## Use of this source code is governed by a BSD-style license
John Koleszar09202d82010-06-04 16:19:40 -04005## that can be found in the LICENSE file in the root of the source
6## tree. An additional intellectual property rights grant can be found
John Koleszar94c52e42010-06-18 12:39:21 -04007## in the file PATENTS. All contributing project authors may
8## be found in the AUTHORS file in the root of the source tree.
John Koleszar0ea50ce2010-05-18 11:58:33 -04009##
10
11
12include config.mk
13quiet?=true
14ifeq ($(target),)
15# If a target wasn't specified, invoke for all enabled targets.
16.DEFAULT:
17 @for t in $(ALL_TARGETS); do \
18 $(MAKE) --no-print-directory target=$$t $(MAKECMDGOALS) || exit $$?;\
19 done
20all: .DEFAULT
21clean:: .DEFAULT
John Koleszaree8bcb12010-05-24 10:16:44 -040022install:: .DEFAULT
James Berrya0769f72012-05-02 17:25:58 -040023test:: .DEFAULT
John Koleszar1d0dc7c2012-11-02 15:17:36 -070024testdata:: .DEFAULT
John Koleszar0ea50ce2010-05-18 11:58:33 -040025
26
27# Note: md5sum is not installed on OS X, but openssl is. Openssl may not be
28# installed on cygwin, so we need to autodetect here.
29md5sum := $(firstword $(wildcard \
30 $(foreach e,md5sum openssl,\
31 $(foreach p,$(subst :, ,$(PATH)),$(p)/$(e)*))\
32 ))
33md5sum := $(if $(filter %openssl,$(md5sum)),$(md5sum) dgst -md5,$(md5sum))
34
35TGT_CC:=$(word 3, $(subst -, ,$(TOOLCHAIN)))
John Koleszaree8bcb12010-05-24 10:16:44 -040036dist:
John Koleszar0ea50ce2010-05-18 11:58:33 -040037 @for t in $(ALL_TARGETS); do \
38 $(MAKE) --no-print-directory target=$$t $(MAKECMDGOALS) || exit $$?;\
39 done
40 # Run configure for the user with the current toolchain.
41 @if [ -d "$(DIST_DIR)/src" ]; then \
42 mkdir -p "$(DIST_DIR)/build"; \
43 cd "$(DIST_DIR)/build"; \
John Koleszar23d68a52010-06-22 09:53:23 -040044 echo "Rerunning configure $(CONFIGURE_ARGS)"; \
45 ../src/configure $(CONFIGURE_ARGS); \
John Koleszar0ea50ce2010-05-18 11:58:33 -040046 $(if $(filter vs%,$(TGT_CC)),make NO_LAUNCH_DEVENV=1;) \
47 fi
48 @if [ -d "$(DIST_DIR)" ]; then \
49 echo " [MD5SUM] $(DIST_DIR)"; \
50 cd $(DIST_DIR) && \
51 $(md5sum) `find . -name md5sums.txt -prune -o -type f -print` \
52 | sed -e 's/MD5(\(.*\))= \([0-9a-f]\{32\}\)/\2 \1/' \
53 > md5sums.txt;\
54 fi
55
56
John Koleszar0ea50ce2010-05-18 11:58:33 -040057endif
58
59ifneq ($(target),)
60# Normally, we want to build the filename from the target and the toolchain.
61# This disambiguates from the $(target).mk file that exists in the source tree.
62# However, the toolchain is part of the target in universal builds, so we
63# don't want to include TOOLCHAIN in that case. FAT_ARCHS is used to test
64# if we're in the universal case.
65include $(target)$(if $(FAT_ARCHS),,-$(TOOLCHAIN)).mk
66endif
67BUILD_ROOT?=.
68VPATH=$(SRC_PATH_BARE)
69CFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH)
John Koleszar1d0dc7c2012-11-02 15:17:36 -070070CXXFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH)
John Koleszar2ad48102010-10-25 10:28:45 -040071ASFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT)/ -I$(SRC_PATH)/
John Koleszar0ea50ce2010-05-18 11:58:33 -040072DIST_DIR?=dist
73HOSTCC?=gcc
74TGT_ISA:=$(word 1, $(subst -, ,$(TOOLCHAIN)))
75TGT_OS:=$(word 2, $(subst -, ,$(TOOLCHAIN)))
76TGT_CC:=$(word 3, $(subst -, ,$(TOOLCHAIN)))
Luca Barbato44881a52013-01-06 19:19:43 +010077quiet:=$(if $(or $(verbose), $(V)),, yes)
John Koleszar0ea50ce2010-05-18 11:58:33 -040078qexec=$(if $(quiet),@)
79
80# Cancel built-in implicit rules
81%: %.o
82%.asm:
83%.a:
James Berrya0769f72012-05-02 17:25:58 -040084%: %.cc
John Koleszar0ea50ce2010-05-18 11:58:33 -040085
86#
87# Common rules"
88#
James Berrya0769f72012-05-02 17:25:58 -040089.PHONY: all
90all:
John Koleszar0ea50ce2010-05-18 11:58:33 -040091
92.PHONY: clean
93clean::
94 rm -f $(OBJS-yes) $(OBJS-yes:.o=.d) $(OBJS-yes:.asm.s.o=.asm.s)
95 rm -f $(CLEAN-OBJS)
96
John Koleszaree8bcb12010-05-24 10:16:44 -040097.PHONY: dist
98dist:
John Koleszar0ea50ce2010-05-18 11:58:33 -040099.PHONY: install
John Koleszaree8bcb12010-05-24 10:16:44 -0400100install::
James Berrya0769f72012-05-02 17:25:58 -0400101.PHONY: test
102test::
John Koleszar1d0dc7c2012-11-02 15:17:36 -0700103.PHONY: testdata
104testdata::
John Koleszar0ea50ce2010-05-18 11:58:33 -0400105
John Koleszar1760c392012-11-27 15:54:54 -0800106$(BUILD_PFX)%.c.d: %.c
107 $(if $(quiet),@echo " [DEP] $@")
108 $(qexec)mkdir -p $(dir $@)
109 $(qexec)$(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -M $< | $(fmt_deps) > $@
John Koleszar0ea50ce2010-05-18 11:58:33 -0400110
John Koleszar1760c392012-11-27 15:54:54 -0800111$(BUILD_PFX)%.c.o: %.c
112 $(if $(quiet),@echo " [CC] $@")
113 $(qexec)$(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -c -o $@ $<
John Koleszar0ea50ce2010-05-18 11:58:33 -0400114
John Koleszar1760c392012-11-27 15:54:54 -0800115$(BUILD_PFX)%.cc.d: %.cc
116 $(if $(quiet),@echo " [DEP] $@")
117 $(qexec)mkdir -p $(dir $@)
118 $(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -M $< | $(fmt_deps) > $@
James Berrya0769f72012-05-02 17:25:58 -0400119
John Koleszar1760c392012-11-27 15:54:54 -0800120$(BUILD_PFX)%.cc.o: %.cc
121 $(if $(quiet),@echo " [CXX] $@")
122 $(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -c -o $@ $<
James Berrya0769f72012-05-02 17:25:58 -0400123
John Koleszar1760c392012-11-27 15:54:54 -0800124$(BUILD_PFX)%.asm.d: %.asm
125 $(if $(quiet),@echo " [DEP] $@")
126 $(qexec)mkdir -p $(dir $@)
John Koleszar0ea50ce2010-05-18 11:58:33 -0400127 $(qexec)$(SRC_PATH_BARE)/build/make/gen_asm_deps.sh \
John Koleszar1760c392012-11-27 15:54:54 -0800128 --build-pfx=$(BUILD_PFX) --depfile=$@ $(ASFLAGS) $< > $@
John Koleszar0ea50ce2010-05-18 11:58:33 -0400129
John Koleszar1760c392012-11-27 15:54:54 -0800130$(BUILD_PFX)%.asm.o: %.asm
131 $(if $(quiet),@echo " [AS] $@")
132 $(qexec)$(AS) $(ASFLAGS) -o $@ $<
John Koleszar0ea50ce2010-05-18 11:58:33 -0400133
John Koleszar1760c392012-11-27 15:54:54 -0800134$(BUILD_PFX)%.s.d: %.s
135 $(if $(quiet),@echo " [DEP] $@")
136 $(qexec)mkdir -p $(dir $@)
John Koleszar0ea50ce2010-05-18 11:58:33 -0400137 $(qexec)$(SRC_PATH_BARE)/build/make/gen_asm_deps.sh \
John Koleszar1760c392012-11-27 15:54:54 -0800138 --build-pfx=$(BUILD_PFX) --depfile=$@ $(ASFLAGS) $< > $@
John Koleszar0ea50ce2010-05-18 11:58:33 -0400139
John Koleszar1760c392012-11-27 15:54:54 -0800140$(BUILD_PFX)%.s.o: %.s
141 $(if $(quiet),@echo " [AS] $@")
142 $(qexec)$(AS) $(ASFLAGS) -o $@ $<
John Koleszar0ea50ce2010-05-18 11:58:33 -0400143
Johann79327be2011-06-08 14:43:34 -0400144.PRECIOUS: %.c.S
145%.c.S: CFLAGS += -DINLINE_ASM
John Koleszar1760c392012-11-27 15:54:54 -0800146$(BUILD_PFX)%.c.S: %.c
147 $(if $(quiet),@echo " [GEN] $@")
148 $(qexec)$(CC) -S $(CFLAGS) -o $@ $<
Johann79327be2011-06-08 14:43:34 -0400149
John Koleszar0ea50ce2010-05-18 11:58:33 -0400150.PRECIOUS: %.asm.s
John Koleszar1760c392012-11-27 15:54:54 -0800151$(BUILD_PFX)%.asm.s: %.asm
152 $(if $(quiet),@echo " [ASM CONVERSION] $@")
153 $(qexec)mkdir -p $(dir $@)
154 $(qexec)$(ASM_CONVERSION) <$< >$@
John Koleszar0ea50ce2010-05-18 11:58:33 -0400155
156# If we're in debug mode, pretend we don't have GNU strip, to fall back to
157# the copy implementation
158HAVE_GNU_STRIP := $(if $(CONFIG_DEBUG),,$(HAVE_GNU_STRIP))
159ifeq ($(HAVE_GNU_STRIP),yes)
160# Older binutils strip global sybols not needed for relocation processing
161# when given --strip-unneeded. Use nm and awk to identify globals and
162# keep them.
163%.a: %_g.a
164 $(if $(quiet),@echo " [STRIP] $@ < $<")
165 $(qexec)$(STRIP) --strip-unneeded \
166 `$(NM) $< | grep ' [A-TV-Z] ' | awk '{print "-K"$$3'}`\
167 -o $@ $<
168else
169%.a: %_g.a
170 $(if $(quiet),@echo " [CP] $@ < $<")
171 $(qexec)cp $< $@
172endif
173
174#
175# Rule to extract assembly constants from C sources
176#
177obj_int_extract: build/make/obj_int_extract.c
Attila Nagy346b3e72011-03-16 12:56:52 +0200178 $(if $(quiet),@echo " [HOSTCC] $@")
Johannfb037ec2011-03-08 17:41:45 -0500179 $(qexec)$(HOSTCC) -I. -I$(SRC_PATH_BARE) -o $@ $<
John Koleszar0ea50ce2010-05-18 11:58:33 -0400180CLEAN-OBJS += obj_int_extract
181
182#
183# Utility functions
184#
185pairmap=$(if $(strip $(2)),\
186 $(call $(1),$(word 1,$(2)),$(word 2,$(2)))\
187 $(call pairmap,$(1),$(wordlist 3,$(words $(2)),$(2)))\
188)
189
190enabled=$(filter-out $($(1)-no),$($(1)-yes))
191cond_enabled=$(if $(filter yes,$($(1))), $(call enabled,$(2)))
192
193find_file1=$(word 1,$(wildcard $(subst //,/,$(addsuffix /$(1),$(2)))))
194find_file=$(foreach f,$(1),$(call find_file1,$(strip $(f)),$(strip $(2))) )
James Berrya0769f72012-05-02 17:25:58 -0400195obj_pats=.c=.c.o $(AS_SFX)=$(AS_SFX).o .cc=.cc.o
John Koleszar1760c392012-11-27 15:54:54 -0800196objs=$(addprefix $(BUILD_PFX),$(foreach p,$(obj_pats),$(filter %.o,$(1:$(p))) ))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400197
198install_map_templates=$(eval $(call install_map_template,$(1),$(2)))
199
200not=$(subst yes,no,$(1))
201
202ifeq ($(CONFIG_MSVS),yes)
203lib_file_name=$(1).lib
204else
205lib_file_name=lib$(1).a
206endif
207#
208# Rule Templates
209#
210define linker_template
211$(1): $(filter-out -%,$(2))
212$(1):
213 $(if $(quiet),@echo " [LD] $$@")
Ronald S. Bultjebbf890f2011-05-02 13:56:41 -0400214 $(qexec)$$(LD) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400215endef
James Berrya0769f72012-05-02 17:25:58 -0400216define linkerxx_template
217$(1): $(filter-out -%,$(2))
218$(1):
219 $(if $(quiet),@echo " [LD] $$@")
John Koleszar1d0dc7c2012-11-02 15:17:36 -0700220 $(qexec)$$(CXX) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
James Berrya0769f72012-05-02 17:25:58 -0400221endef
John Koleszar0ea50ce2010-05-18 11:58:33 -0400222# make-3.80 has a bug with expanding large input strings to the eval function,
223# which was triggered in some cases by the following component of
224# linker_template:
225# $(1): $$(call find_file, $(patsubst -l%,lib%.a,$(filter -l%,$(2))),\
226# $$(patsubst -L%,%,$$(filter -L%,$$(LDFLAGS) $(2))))
227# This may be useful to revisit in the future (it tries to locate libraries
228# in a search path and add them as prerequisites
229
230define install_map_template
231$(DIST_DIR)/$(1): $(2)
232 $(if $(quiet),@echo " [INSTALL] $$@")
233 $(qexec)mkdir -p $$(dir $$@)
234 $(qexec)cp -p $$< $$@
235endef
236
237define archive_template
238# Not using a pattern rule here because we don't want to generate empty
239# archives when they are listed as a dependency in files not responsible
240# for creating them.
241$(1):
242 $(if $(quiet),@echo " [AR] $$@")
243 $(qexec)$$(AR) $$(ARFLAGS) $$@ $$?
244endef
245
John Koleszar7aa97a32010-06-03 10:29:04 -0400246define so_template
247# Not using a pattern rule here because we don't want to generate empty
248# archives when they are listed as a dependency in files not responsible
249# for creating them.
250#
251# This needs further abstraction for dealing with non-GNU linkers.
252$(1):
253 $(if $(quiet),@echo " [LD] $$@")
254 $(qexec)$$(LD) -shared $$(LDFLAGS) \
Johannabb7c212011-06-08 11:36:04 -0700255 -Wl,--no-undefined -Wl,-soname,$$(SONAME) \
jimbankoski45e551b2012-07-25 19:39:33 -0700256 -Wl,--version-script,$$(EXPORTS_FILE) -o $$@ \
John Koleszardcb52c02012-07-24 16:18:38 -0700257 $$(filter %.o,$$^) $$(extralibs)
John Koleszar7aa97a32010-06-03 10:29:04 -0400258endef
259
jimbankoski45e551b2012-07-25 19:39:33 -0700260define dl_template
261# Not using a pattern rule here because we don't want to generate empty
262# archives when they are listed as a dependency in files not responsible
263# for creating them.
264$(1):
265 $(if $(quiet),@echo " [LD] $$@")
266 $(qexec)$$(LD) -dynamiclib $$(LDFLAGS) \
267 -exported_symbols_list $$(EXPORTS_FILE) \
268 -Wl,-headerpad_max_install_names,-compatibility_version,1.0,-current_version,$$(VERSION_MAJOR) \
269 -o $$@ \
270 $$(filter %.o,$$^) $$(extralibs)
271endef
272
273
274
John Koleszar0ea50ce2010-05-18 11:58:33 -0400275define lipo_lib_template
276$(1): $(addsuffix /$(1),$(FAT_ARCHS))
277 $(if $(quiet),@echo " [LIPO] $$@")
278 $(qexec)libtool -static -o $$@ $$?
279endef
280
281define lipo_bin_template
282$(1): $(addsuffix /$(1),$(FAT_ARCHS))
283 $(if $(quiet),@echo " [LIPO] $$@")
284 $(qexec)lipo -output $$@ -create $$?
285endef
286
287
288#
289# Get current configuration
290#
291ifneq ($(target),)
292include $(SRC_PATH_BARE)/$(target:-$(TOOLCHAIN)=).mk
293endif
294ifeq ($(filter clean,$(MAKECMDGOALS)),)
295 # Older versions of make don't like -include directives with no arguments
296 ifneq ($(filter %.d,$(OBJS-yes:.o=.d)),)
297 -include $(filter %.d,$(OBJS-yes:.o=.d))
298 endif
299endif
300
301#
Gaute Strokkenes6795e252011-03-15 12:20:54 +0000302# Configuration dependent rules
John Koleszar0ea50ce2010-05-18 11:58:33 -0400303#
304$(call pairmap,install_map_templates,$(INSTALL_MAPS))
305
306DOCS=$(call cond_enabled,CONFIG_INSTALL_DOCS,DOCS)
307.docs: $(DOCS)
308 @touch $@
309
310INSTALL-DOCS=$(call cond_enabled,CONFIG_INSTALL_DOCS,INSTALL-DOCS)
John Koleszaree8bcb12010-05-24 10:16:44 -0400311ifeq ($(MAKECMDGOALS),dist)
312INSTALL-DOCS+=$(call cond_enabled,CONFIG_INSTALL_DOCS,DIST-DOCS)
313endif
John Koleszar0ea50ce2010-05-18 11:58:33 -0400314.install-docs: .docs $(addprefix $(DIST_DIR)/,$(INSTALL-DOCS))
315 @touch $@
316
317clean::
318 rm -f .docs .install-docs $(DOCS)
319
320BINS=$(call enabled,BINS)
321.bins: $(BINS)
322 @touch $@
323
324INSTALL-BINS=$(call cond_enabled,CONFIG_INSTALL_BINS,INSTALL-BINS)
John Koleszaree8bcb12010-05-24 10:16:44 -0400325ifeq ($(MAKECMDGOALS),dist)
326INSTALL-BINS+=$(call cond_enabled,CONFIG_INSTALL_BINS,DIST-BINS)
327endif
John Koleszar0ea50ce2010-05-18 11:58:33 -0400328.install-bins: .bins $(addprefix $(DIST_DIR)/,$(INSTALL-BINS))
329 @touch $@
330
331clean::
332 rm -f .bins .install-bins $(BINS)
333
334LIBS=$(call enabled,LIBS)
335.libs: $(LIBS)
336 @touch $@
337$(foreach lib,$(filter %_g.a,$(LIBS)),$(eval $(call archive_template,$(lib))))
Johannabb7c212011-06-08 11:36:04 -0700338$(foreach lib,$(filter %so.$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH),$(LIBS)),$(eval $(call so_template,$(lib))))
jimbankoski45e551b2012-07-25 19:39:33 -0700339$(foreach lib,$(filter %$(VERSION_MAJOR).dylib,$(LIBS)),$(eval $(call dl_template,$(lib))))
John Koleszar0ea50ce2010-05-18 11:58:33 -0400340
341INSTALL-LIBS=$(call cond_enabled,CONFIG_INSTALL_LIBS,INSTALL-LIBS)
John Koleszaree8bcb12010-05-24 10:16:44 -0400342ifeq ($(MAKECMDGOALS),dist)
343INSTALL-LIBS+=$(call cond_enabled,CONFIG_INSTALL_LIBS,DIST-LIBS)
344endif
John Koleszar0ea50ce2010-05-18 11:58:33 -0400345.install-libs: .libs $(addprefix $(DIST_DIR)/,$(INSTALL-LIBS))
346 @touch $@
347
348clean::
349 rm -f .libs .install-libs $(LIBS)
350
351ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
352PROJECTS=$(call enabled,PROJECTS)
353.projects: $(PROJECTS)
354 @touch $@
355
356INSTALL-PROJECTS=$(call cond_enabled,CONFIG_INSTALL_PROJECTS,INSTALL-PROJECTS)
John Koleszaree8bcb12010-05-24 10:16:44 -0400357ifeq ($(MAKECMDGOALS),dist)
358INSTALL-PROJECTS+=$(call cond_enabled,CONFIG_INSTALL_PROJECTS,DIST-PROJECTS)
359endif
John Koleszar0ea50ce2010-05-18 11:58:33 -0400360.install-projects: .projects $(addprefix $(DIST_DIR)/,$(INSTALL-PROJECTS))
361 @touch $@
362
363clean::
364 rm -f .projects .install-projects $(PROJECTS)
365endif
366
John Koleszaree8bcb12010-05-24 10:16:44 -0400367# If there are any source files to be distributed, then include the build
John Koleszar0ea50ce2010-05-18 11:58:33 -0400368# system too.
John Koleszaree8bcb12010-05-24 10:16:44 -0400369ifneq ($(call enabled,DIST-SRCS),)
370 DIST-SRCS-yes += configure
371 DIST-SRCS-yes += build/make/configure.sh
372 DIST-SRCS-yes += build/make/gen_asm_deps.sh
373 DIST-SRCS-yes += build/make/Makefile
374 DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_def.sh
375 DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_proj.sh
376 DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_sln.sh
John Koleszar4d86ef32010-06-22 08:44:48 -0400377 DIST-SRCS-$(CONFIG_MSVS) += build/x86-msvs/yasm.rules
James Berry61046b82011-08-01 16:10:41 -0400378 DIST-SRCS-$(CONFIG_MSVS) += build/x86-msvs/obj_int_extract.bat
Martin Storsjoad484fc2013-05-18 23:32:49 +0300379 DIST-SRCS-$(CONFIG_MSVS) += build/arm-msvs/obj_int_extract.bat
John Koleszaree8bcb12010-05-24 10:16:44 -0400380 DIST-SRCS-$(CONFIG_RVCT) += build/make/armlink_adapter.sh
James Zern08348d92013-03-02 13:42:41 -0800381 # Include obj_int_extract if we use offsets from *_asm_*_offsets
Johann8edaf6e2011-02-10 14:57:43 -0500382 DIST-SRCS-$(ARCH_ARM)$(ARCH_X86)$(ARCH_X86_64) += build/make/obj_int_extract.c
John Koleszaree8bcb12010-05-24 10:16:44 -0400383 DIST-SRCS-$(ARCH_ARM) += build/make/ads2gas.pl
Johannf8af71a2013-01-25 12:11:19 -0800384 DIST-SRCS-$(ARCH_ARM) += build/make/ads2gas_apple.pl
Martin Storsjoa83db432012-11-20 16:05:40 +0200385 DIST-SRCS-$(ARCH_ARM) += build/make/ads2armasm_ms.pl
Martin Storsjo5f760802013-05-15 16:08:19 +0300386 DIST-SRCS-$(ARCH_ARM) += build/make/thumb.pm
John Koleszaree8bcb12010-05-24 10:16:44 -0400387 DIST-SRCS-yes += $(target:-$(TOOLCHAIN)=).mk
John Koleszar0ea50ce2010-05-18 11:58:33 -0400388endif
389INSTALL-SRCS := $(call cond_enabled,CONFIG_INSTALL_SRCS,INSTALL-SRCS)
John Koleszaree8bcb12010-05-24 10:16:44 -0400390ifeq ($(MAKECMDGOALS),dist)
391INSTALL-SRCS += $(call cond_enabled,CONFIG_INSTALL_SRCS,DIST-SRCS)
392endif
John Koleszar0ea50ce2010-05-18 11:58:33 -0400393.install-srcs: $(addprefix $(DIST_DIR)/src/,$(INSTALL-SRCS))
394 @touch $@
395
396clean::
397 rm -f .install-srcs
398
399ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
400 BUILD_TARGETS += .projects
401 INSTALL_TARGETS += .install-projects
402endif
403BUILD_TARGETS += .docs .libs .bins
404INSTALL_TARGETS += .install-docs .install-srcs .install-libs .install-bins
James Berrya0769f72012-05-02 17:25:58 -0400405all: $(BUILD_TARGETS)
John Koleszaree8bcb12010-05-24 10:16:44 -0400406install:: $(INSTALL_TARGETS)
407dist: $(INSTALL_TARGETS)
James Berrya0769f72012-05-02 17:25:58 -0400408test::