2009-06-27 00:47:03 +08:00
|
|
|
SubDirs := lib
|
|
|
|
|
|
|
|
# Set default rule before anything else.
|
|
|
|
all::
|
|
|
|
|
|
|
|
include make/config.mk
|
|
|
|
include make/util.mk
|
2010-01-14 00:13:01 +08:00
|
|
|
# If SRCROOT is defined, assume we are doing an Apple style build. We should be
|
|
|
|
# able to use RC_XBS for this but that is unused during "make installsrc".
|
2009-06-27 00:47:03 +08:00
|
|
|
ifdef SRCROOT
|
|
|
|
include make/AppleBI.mk
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Make sure we don't build with a missing ProjObjRoot.
|
|
|
|
ifeq ($(ProjObjRoot),)
|
|
|
|
$(error Refusing to build with empty ProjObjRoot variable)
|
|
|
|
endif
|
|
|
|
|
|
|
|
##############
|
|
|
|
|
|
|
|
###
|
|
|
|
# Rules
|
|
|
|
|
|
|
|
###
|
|
|
|
# Top level targets
|
|
|
|
|
2010-01-18 14:48:19 +08:00
|
|
|
# FIXME: Document the available subtargets.
|
|
|
|
help:
|
|
|
|
@echo "usage: make [{VARIABLE=VALUE}*] target"
|
|
|
|
@echo
|
|
|
|
@echo "User variables:"
|
|
|
|
@echo " VERBOSE=1: Use to show all commands [default=0]"
|
|
|
|
@echo
|
|
|
|
@echo "Available targets:"
|
|
|
|
@echo " clean: clean all configurations"
|
|
|
|
@echo " test: run unit tests"
|
|
|
|
@echo " all: build all configurations"
|
|
|
|
@echo
|
|
|
|
|
2010-01-18 14:48:40 +08:00
|
|
|
help-devel: help
|
|
|
|
@echo "Development targets:"
|
|
|
|
@echo " info-functions: list available compiler-rt functions"
|
|
|
|
@echo
|
|
|
|
|
|
|
|
help-hidden: help-devel
|
2010-01-18 14:48:19 +08:00
|
|
|
@echo "Debugging variables:"
|
2010-01-18 14:48:33 +08:00
|
|
|
@echo " DEBUGMAKE=1: enable some Makefile logging [default=]"
|
|
|
|
@echo " =2: enable more Makefile logging"
|
2010-01-18 14:48:19 +08:00
|
|
|
@echo
|
|
|
|
@echo "Debugging targets:"
|
|
|
|
@echo " make-print-FOO: print information on the variable 'FOO'"
|
|
|
|
@echo
|
|
|
|
|
2010-01-18 14:48:40 +08:00
|
|
|
info-functions:
|
|
|
|
@echo "compiler-rt Available Functions"
|
|
|
|
@echo
|
|
|
|
@echo "All Functions: $(AvailableFunctions)"
|
|
|
|
@$(foreach fn,$(AvailableFunctions),\
|
|
|
|
printf " %-20s - available in (%s)\n" $(fn)\
|
|
|
|
"$(foreach key,$(AvailableIn.$(fn)),$($(key).Dir))";)
|
|
|
|
|
2009-06-27 00:47:03 +08:00
|
|
|
# Provide default clean target which is extended by other templates.
|
|
|
|
.PHONY: clean
|
|
|
|
clean::
|
|
|
|
|
|
|
|
# Test
|
|
|
|
.PHONY: test
|
|
|
|
test:
|
|
|
|
cd test/Unit && ./test
|
|
|
|
|
|
|
|
###
|
|
|
|
# Directory handling magic.
|
|
|
|
|
|
|
|
# Create directories as needed, and timestamp their creation.
|
|
|
|
%/.dir:
|
|
|
|
$(Summary) " MKDIR: $*"
|
|
|
|
$(Verb) $(MKDIR) $* > /dev/null
|
|
|
|
$(Verb) $(DATE) > $@
|
|
|
|
|
|
|
|
# Remove directories
|
|
|
|
%/.remove:
|
|
|
|
$(Verb) $(RM) -r $*
|
|
|
|
|
|
|
|
###
|
|
|
|
# Include child makefile fragments
|
|
|
|
|
2010-01-18 14:48:33 +08:00
|
|
|
Dir := .
|
|
|
|
include make/subdir.mk
|
2010-01-18 14:48:56 +08:00
|
|
|
include make/lib_info.mk
|
|
|
|
include make/lib_util.mk
|
|
|
|
|
2010-01-18 14:48:33 +08:00
|
|
|
ifneq ($(DEBUGMAKE),)
|
|
|
|
$(info MAKE: Done processing Makefile)
|
|
|
|
$(info )
|
|
|
|
endif
|