From 6ca383f41682e3037cf9843e9e1605e94321f1f5 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 18 Sep 2012 14:06:57 +0000 Subject: Refactor common make definitions to tools/Config.mk; Add verbosity option to build (Richard Cochran) git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5160 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/tools/Config.mk | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'nuttx/tools') diff --git a/nuttx/tools/Config.mk b/nuttx/tools/Config.mk index 07d88392e..3a82a1937 100644 --- a/nuttx/tools/Config.mk +++ b/nuttx/tools/Config.mk @@ -1,6 +1,6 @@ ############################################################################ # Config.mk -# Strip quotes from Kconfig strings. +# Global build rules and macros. # # Author: Richard Cochran # @@ -39,3 +39,34 @@ CONFIG_ARCH := $(patsubst "%",%,$(strip $(CONFIG_ARCH))) CONFIG_ARCH_CHIP := $(patsubst "%",%,$(strip $(CONFIG_ARCH_CHIP))) CONFIG_ARCH_BOARD := $(patsubst "%",%,$(strip $(CONFIG_ARCH_BOARD))) + +# Default build rules. + +define PREPROCESS + @echo "CPP: $1->$2" + $(Q) $(CPP) $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + @echo "CC: $1" + $(Q) $(CC) -c $(CFLAGS) $1 -o $2 +endef + +define COMPILEXX + @echo "CXX: $1" + $(Q) $(CXX) -c $(CXXFLAGS) $1 -o $2 +endef + +define ASSEMBLE + @echo "AS: $1" + $(Q) $(CC) -c $(AFLAGS) $1 -o $2 +endef + +define ARCHIVE + echo "AR: $2"; \ + $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; } +endef + +define CLEAN + $(Q) rm -f *.o *.a +endef -- cgit v1.2.3