Skip to content

Commit

Permalink
Refactor common make definitions to tools/Config.mk; Add verbosity op…
Browse files Browse the repository at this point in the history
…tion to build (Richard Cochran)

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5160 42af7a65-404d-4744-a932-0658087f49c3
  • Loading branch information
patacongo committed Sep 18, 2012
1 parent 8f3559b commit 7f9ed0d
Show file tree
Hide file tree
Showing 185 changed files with 78 additions and 4,945 deletions.
6 changes: 5 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3370,4 +3370,8 @@
* arch/arm/src/stm32/stm32_i2c.c: I2C improvements from Mike Smith.
Unified configuration logic; dynamic timeout calculations;
I2C reset logic to recover from locked devices on the bus.

* configs/*/*/Make.defs, tools/Config.mk, Makefile: Refactor all
common make definitions from the various Make.defs files into
the common tools/Make.mk. Add support for a verbosity options:
Specify V=1 on the make command line in order to see the exact
commands used in the build (Contributed by Richard Cochran).
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ TOPDIR := ${shell pwd | sed -e 's/ /\\ /g'}
-include ${TOPDIR}/tools/Config.mk
-include ${TOPDIR}/Make.defs

# Control build verbosity.
ifeq ($(V),1)
export Q :=
else
export Q := @
endif

# Default tools

ifeq ($(DIRLINK),)
Expand Down
55 changes: 34 additions & 21 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ README
o Building NuttX
- Building
- Re-building
- Build Targets
- Build Targets and Options
o Cygwin Build Problems
- Strange Path Problems
- Window Native Toolchain Issues
Expand Down Expand Up @@ -380,9 +380,10 @@ Re-building
This 'make' command will remove of the copied directories, re-copy them,
then make NuttX.

Build Targets
-------------
Build Targets and Options
-------------------------

Build Targets:
Below is a summary of the build targets available in the top-level
NuttX Makefile:

Expand Down Expand Up @@ -450,38 +451,50 @@ Build Targets
the config.h and version.h header files in the include/nuttx directory and
the establishment of symbolic links to configured directories.

clean_context
clean_context

This is part of the distclean target. It removes all of the header files
and symbolic links created by the context target.

Build Options:
Of course, the value any make variable an be overriden from the make command
line. However, there is one particular variable assignment option that may
be useful to you:

V=1

This is part of the distclean target. It removes all of the header files
and symbolic links created by the context target.
This is the build "verbosity flag." If you specify V=1 on the make command
line, you will see the exact commands used in the build. This can be very
useful when adding new boards or tracking down compile time errors and
warnings.

CYGWIN BUILD PROBLEMS
^^^^^^^^^^^^^^^^^^^^^

Strange Path Problems
---------------------

If you see strange behavior when building under Cygwin then you may have
a problem with your PATH variable. For example, if you see failures to
locate files that are clearly present, that may mean that you are using
the wrong version of a tool. For example, you may not be using Cygwin's
'make' program at /usr/bin/make. Try:
If you see strange behavior when building under Cygwin then you may have
a problem with your PATH variable. For example, if you see failures to
locate files that are clearly present, that may mean that you are using
the wrong version of a tool. For example, you may not be using Cygwin's
'make' program at /usr/bin/make. Try:

$ which make
/usr/bin/make

When you install some toolchains (such as Yargarto or CodeSourcery tools),
they may modify your PATH variable to include a path to their binaries.
At that location, they make have GNUWin32 versions of the tools. So you
might actually be using a version of make that does not understand Cygwin
paths.
When you install some toolchains (such as Yargarto or CodeSourcery tools),
they may modify your PATH variable to include a path to their binaries.
At that location, they make have GNUWin32 versions of the tools. So you
might actually be using a version of make that does not understand Cygwin
paths.

The solution is either:
The solution is either:

1. Edit your PATH to remove the path to the GNUWin32 tools, or
2. Put /usr/local/bin, /usr/bin, and /bin at the front of your path:
1. Edit your PATH to remove the path to the GNUWin32 tools, or
2. Put /usr/local/bin, /usr/bin, and /bin at the front of your path:

$ export PATH=/usr/local/bin:/usr/bin:/bin:$PATH
$ export PATH=/usr/local/bin:/usr/bin:/bin:$PATH

Window Native Toolchain Issues
------------------------------
Expand Down Expand Up @@ -568,7 +581,7 @@ General Pre-built Toolchain Issues
And finally you may not be able to use NXFLAT.

7. NXFLAT. If you use a pre-built toolchain, you will lose all support
for NXFLAT. NXFLAT is a binary format described in
for NXFLAT. NXFLAT is a binary format described in
Documentation/NuttXNxFlat.html. It may be possible to build
standalone versions of the NXFLAT tools; there are a few examples
of this in the misc/buildroot/configs directory. However, it
Expand Down
28 changes: 0 additions & 28 deletions configs/amber/hello/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -114,34 +114,6 @@ OBJEXT = .o
LIBEXT = .a
EXEEXT =

define PREPROCESS
@echo "CPP: $1->$2"
@$(CPP) $(CPPFLAGS) $1 -o $2
endef

define COMPILE
@echo "CC: $1"
@$(CC) -c $(CFLAGS) $1 -o $2
endef

define COMPILEXX
@echo "CXX: $1"
@$(CXX) -c $(CXXFLAGS) $1 -o $2
endef

define ASSEMBLE
@echo "AS: $1"
@$(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
@rm -f *.o *.a
endef

HOSTCC = gcc
HOSTINCLUDES = -I.
Expand Down
28 changes: 0 additions & 28 deletions configs/avr32dev1/nsh/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -110,34 +110,6 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
endif

define PREPROCESS
@echo "CPP: $1->$2"
@$(CPP) $(CPPFLAGS) $1 -o $2
endef

define COMPILE
@echo "CC: $1"
@$(CC) -c $(CFLAGS) $1 -o $2
endef

define COMPILEXX
@echo "CXX: $1"
@$(CXX) -c $(CXXFLAGS) $1 -o $2
endef

define ASSEMBLE
@echo "AS: $1"
@$(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
@rm -f *.o *.a
endef

HOSTCC = gcc
HOSTINCLUDES = -I.
Expand Down
28 changes: 0 additions & 28 deletions configs/avr32dev1/ostest/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -110,34 +110,6 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g
endif

define PREPROCESS
@echo "CPP: $1->$2"
@$(CPP) $(CPPFLAGS) $1 -o $2
endef

define COMPILE
@echo "CC: $1"
@$(CC) -c $(CFLAGS) $1 -o $2
endef

define COMPILEXX
@echo "CXX: $1"
@$(CXX) -c $(CXXFLAGS) $1 -o $2
endef

define ASSEMBLE
@echo "AS: $1"
@$(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
@rm -f *.o *.a
endef

HOSTCC = gcc
HOSTINCLUDES = -I.
Expand Down
23 changes: 0 additions & 23 deletions configs/c5471evm/httpd/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -86,29 +86,6 @@ ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
LDFLAGS += -g
endif

define PREPROCESS
@echo "CPP: $1->$2"
@$(CPP) $(CPPFLAGS) $1 -o $2
endef

define COMPILE
@echo "CC: $1"
@$(CC) -c $(CFLAGS) $1 -o $2
endef

define ASSEMBLE
@echo "AS: $1"
@$(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
@rm -f *.o *.a
endef

MKDEP = $(TOPDIR)/tools/mkdeps.sh

Expand Down
23 changes: 0 additions & 23 deletions configs/c5471evm/nettest/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -86,29 +86,6 @@ ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
LDFLAGS += -g
endif

define PREPROCESS
@echo "CPP: $1->$2"
@$(CPP) $(CPPFLAGS) $1 -o $2
endef

define COMPILE
@echo "CC: $1"
@$(CC) -c $(CFLAGS) $1 -o $2
endef

define ASSEMBLE
@echo "AS: $1"
@$(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
@rm -f *.o *.a
endef

MKDEP = $(TOPDIR)/tools/mkdeps.sh

Expand Down
23 changes: 0 additions & 23 deletions configs/c5471evm/nsh/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -86,29 +86,6 @@ ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
LDFLAGS += -g
endif

define PREPROCESS
@echo "CPP: $1->$2"
@$(CPP) $(CPPFLAGS) $1 -o $2
endef

define COMPILE
@echo "CC: $1"
@$(CC) -c $(CFLAGS) $1 -o $2
endef

define ASSEMBLE
@echo "AS: $1"
@$(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
@rm -f *.o *.a
endef

MKDEP = $(TOPDIR)/tools/mkdeps.sh

Expand Down
23 changes: 0 additions & 23 deletions configs/c5471evm/ostest/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -86,29 +86,6 @@ ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
LDFLAGS += -g
endif

define PREPROCESS
@echo "CPP: $1->$2"
@$(CPP) $(CPPFLAGS) $1 -o $2
endef

define COMPILE
@echo "CC: $1"
@$(CC) -c $(CFLAGS) $1 -o $2
endef

define ASSEMBLE
@echo "AS: $1"
@$(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
@rm -f *.o *.a
endef

MKDEP = $(TOPDIR)/tools/mkdeps.sh

Expand Down
23 changes: 0 additions & 23 deletions configs/compal_e88/nsh_highram/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -95,29 +95,6 @@ ifeq ("${CONFIG_DEBUG_SYMBOLS}","y")
LDFLAGS += -g
endif

define PREPROCESS
@echo "CPP: $1->$2"
@$(CPP) $(CPPFLAGS) $1 -o $2
endef

define COMPILE
@echo "CC: $1"
@$(CC) -c $(CFLAGS) $1 -o $2
endef

define ASSEMBLE
@echo "AS: $1"
@$(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
@rm -f *.o *.a
endef

MKDEP = $(TOPDIR)/tools/mkdeps.sh

Expand Down
Loading

0 comments on commit 7f9ed0d

Please sign in to comment.