Commit Graph

50 Commits (362077d3d53b1ffb32e7151367940d411d04df64)

Author SHA1 Message Date
Kaspar Schleiser 560a509036 make: remove trailing slash from BINDIR variable 7 years ago
Kaspar Schleiser 1f9a87972b make: allow per-file conditional LTO compile 7 years ago
Joakim Nohlgård 77a15e7886 make: Place most configuration macros in a separate file instead of on the command line 7 years ago
Joakim Nohlgård 275b366825 Makefile.base: Add separate CXXINCLUDES for C++ specific header directories 7 years ago
Kaspar Schleiser 3c56b49df6 make: use ccache if environment variable is set 8 years ago
Kaspar Schleiser aed4be332e make: introduce RIOT_FILE_NOPATH and RIOT_FILE_RELATIVE 8 years ago
Joakim Gebart 8d68afa6e6 Makefile: Add ARFLAGS for overriding command line options to `ar`
- Makefile.base: Respect ARFLAGS when building static archives.
 - Makefile.cflags: Add default ARFLAGS.
 - Makefile.vars: Add description for ARFLAGS.
8 years ago
René Kijewski 9a15a6def5 make: easify {sys,drivers}/Makefile
Currently you need to add every new sys and driver module into the
respective Makefile. This requires rebasing if another module was merged
in the meantime.

This PR allows you to omit the entry to {sys,drivers}/Makefile, if the
subfolder has the same name as the module name, which should be sensible
in most cases.
8 years ago
Ludwig Ortmann 7e123c797d make: optimize archive creation/modification
Only add/replace changed members to the archive.
9 years ago
Ludwig Ortmann 182b603a01 make: 1571 fixup: dont create existing directories
This fixes an error which was introduced by commit

The timestamp of directories is updated when a file inside a directory
is changed.
Therefore, make decides a target needs to be rebuilt, whenever that
target depends on its parent directory, because the directory is
always newer than the file inside.

    Occasionally, however, you have a situation where you want to
    impose a specific ordering on the rules to be invoked without
    forcing the target to be updated if one of those rules is
    executed. In that case, you want to define order-only
    prerequisites. Order-only prerequisites can be specified by
    placing a pipe symbol (|) in the prerequisites list: any
    prerequisites to the left of the pipe symbol are normal; any
    prerequisites to the right are order-only:

         targets : normal-prerequisites | order-only-prerequisites
9 years ago
René Kijewski 2d336ed8c8 make: easier to read object targets 9 years ago
René Kijewski 9b408fda9c make: don't invoke wildcard repeatedly 9 years ago
René Kijewski 01f6bdf789 make: call ranlib 9 years ago
René Kijewski aa2ee4084d make: use $@ and $< 9 years ago
René Kijewski 346313bf07 make: don't call mkdir -p a lot 9 years ago
Pham Huu Dang Nhat f7398f61ff Changed RIOT/Makefile.include, Makefile.base, Makefile.cflags, and native/Makefile.include to compile C and C++ files. 9 years ago
René Kijewski 2ae0c1b149 make: use abspath for better error messages 9 years ago
René Kijewski a9a76cb2c2 make: create dependencies as side effect 9 years ago
René Kijewski d19fc447ed make: make DIRS usable for applications 9 years ago
René Kijewski 35e74ad725 make: refactor make system (parallelism, deduplication)
Almost everything was build sequentially in RIOT, because we employed
explicit for-loops to build directories (DIRS). This PR makes our make
system use normal dependencies to build directories.

All our compiling rules were duplicated, once for the application, once
for modules. This PR makes the application a normal module, removing
this duplication.
9 years ago
René Kijewski 1d34522703 make: evaluate the Git SHA only once 9 years ago
René Kijewski 467b41ad49 make: easifier usage of module subdirectories
Many modules have subdirectories. Often these subdirectories should only
be included under certain circumstances. Modules that use submodules
currently need to use this pattern:

DIRS = …

all: $(BINDIR)$(MODULE).a
   @for i in $(DIRS) ; do $(MAKE) -C $$i ; done ;

include $(RIOTBASE)/Makefile.base

   @for i in $(DIRS) ; do $(MAKE) -C $$i clean ; done ;

This PR moves the `all:` and `clean::` boilerplate into `Makefile.base`.
9 years ago
René Kijewski 840c0f0a57 make: detect their module name automatically
For many modules the `Makefile` contains a line like
MODULE:=$(shell basename $(CURDIR))
This conclusively shows that we do not have to set the module name

This PR removes the need to set the module name manually, if it is the
same as the basename. E.g. for `…/sys/vtimer/Makefile` the variable
make `MODULE` will still be `vtimer`, because it is the basename of the
9 years ago
René Kijewski e189064171 make: print error if make was executed in the root
Fixes #1104, alternative to #1178.
9 years ago
René Kijewski 542a2e5d9d Merge pull request #995 from Kijewski/issue-993
Make: exterminate 'clean' buildtarget clutter
9 years ago
René Kijewski 300d6b3e35 Make: exterminate 'clean' buildtarget
Closes #993.

We do not need to descend into the modules to know what to do on
`make clean BOARD=blub`. We can just invoke `rm -rf bin/blub`.

This PR only keeps the descending into the USEPKGs, since they might
want to delete cached/downloaded/extracted data.
9 years ago
René Kijewski 21af9f11f9 Make: do not spam error messages on shallow clones
> `--always`: Show uniquely abbreviated commit object as fallback.
9 years ago
René Kijewski 3f59eefbaf Use subfolders in bin dir
Creating all object files in one directory is bound to produce name
clashes. RIOT developers may take care to use unique file names, but
external packages surely don't.

With this change all the objects of a module (e.g. `shell`) will be
created in `bin/$(BOARD)/$(MODULE)`.

I compared the final linker command before and after the change. The
`.o` files (e.g. `startup.o`, `syscall.o` ...) are included in the same
order. Neglecting the changed path name where the `.o` files reside, the
linker command stays exactly the same.

A major problem could be third party boards, because the location of the
`startup.o` needs to the specified now in
`boards/$(BOARD)/Makefile.include`, e.g.
export UNDEF += $(BINDIR)msp430_common/startup.o
9 years ago
Ludwig Ortmann 1bd3f7bb86 pipe through sed instead
9 years ago
Ludwig Ortmann 7229287e47 Prepend path to dependency info files with sed
The old way was error prone due to it's use of a fixed path file and

closes #775
9 years ago
Ludwig Ortmann 2525920426 remove trailing whitespace and newlines 9 years ago
Oleg Hahm 9df07f9238 muting compiler and binutils optionally
Instead of muting all compiler and other binutils output by default,
introduce a variable to make this behaviour configurable.
9 years ago
Oleg Hahm c7d985d371 removed redundant include pathes from Makefiles 9 years ago
Oleg Hahm 26c50522d5 simplified and unified cpu build structure 9 years ago
Oleg Hahm 55f31a4829 simplify include structure for boards
* do not overwrite CFLAGS in boards Makefile
9 years ago
Ludwig Ortmann 4c612f6d08 use $(CC) for *.S files 9 years ago
Oleg Hahm e9b04cc380 only add branch to version string if not in master 9 years ago
Oleg Hahm 529f3fb278 include version string 9 years ago
Oleg Hahm 739cd03234 do not overwrite SRC in Makefile.base 10 years ago
authmillenon 4f363ce0fe Define phony make targets 10 years ago
Christian Mehlis 57e70a659c Remove undefined variables from Makefiles
The following variables are included in various Makefiles but never

10 years ago
Oliver Hahm d31bad6c9e * cleaned up output from Makefiles 10 years ago
Ludwig Ortmann a900065fb0 remove cruft in Makefile.base 10 years ago
Ludwig Ortmann 2c744bc1e8 generalize .S compilation target flags 10 years ago
Ludwig Ortmann c6553f6492 interrupt handling rewrite
(including uart0 integration, rt-extension removal)
10 years ago
Oliver Hahm e6177e811a * moved cpu and board specific parts to corresponding Makefiles
* introduced variable for cpu folder
10 years ago
Ludwig Ortmann 2883ca121e migrate to current Makefile structure 10 years ago
Ludwig Ortmann f8973bb007 Merge remote-tracking branch 'upstream/master' 10 years ago
Oliver Hahm 7a4dec1830 * replaced new Makefile name in Makefiles 10 years ago
Oliver Hahm 5ffe5a9c27 * renamed makefiles to Makefile 10 years ago