Skip to contentSkip to conversation

Target rebuilding

Buildroot New Jérôme Pouiller 5 participants 14 messages Jan 17, 2013 – May 15, 2013 Kbuild

lore
Share & tools
lore
#0 lore raw

Hello all,

It is handy to do tests directly in target/. But after some time, it is necessary to make a new fresh target/ directory. The current procedure to do this is:

* remove build/.root (or remove target/ if you want to throw all your work)
* remove build/*/.stamp_target_installed
* depending of you toolchain:

  # remove stamps/ext-toolchain-installed (external)
  # remove stamps/ct-ng-toolchain-installed (ctng)
  # remove target/lib/libc.so.0 (buildroot)
* launch make

I think this process lacks of consistency. Idealy, this process should be:
rm -r target (depending if want to throw all your work)
rm build/*/.stamp_target_installed
make

I suggest following changes:

1. Move build/.root to stamps/. Since it is hidden, many user forget this
file exist.

2. All stamps files are in subdirectories of build/. I suggest to move
stamps/ to build/stamps/

3. Buildroot toolchain should create a stamp files to be uniform with other
toolchains. In add, target/lib/libc.so.0 never exists when PREFER_STATIC_LIB is enable.

4. To be consistent stamps/*-toolchain-installed may be renamed
stamps/.stamp_target_installed or stamps/.stamp_toolchain_target_installed or toolchain/.stamp_target_installed. We may add a README file to explain what is purpose of this apparently empty directory.

5. stamps/ext-toolchain-installed currently copy libc in staging/ and in
target/. It may be splited in two rules: stamps/ext-toolchain-target-installed and stamps/ext-toolchain-staging-installed.

What do you think about it?

Regards,

Signature · 1 line
J?r?me Pouiller
#1 lore raw

Hello J?r?me!

Am 17.01.2013 12:04, schrieb J?r?me Pouiller:

Quoted 4 lines

Hello all,

It is handy to do tests directly in target/. But after some time, it is necessary to make a new fresh target/ directory.

This topic comes up from time to time. Once upon a time I sent a patch to introduce a "make target-clean" (
http://lists.busybox.net/pipermail/buildroot/2012-October/060484.html ) , but it does not seem that this feature can be implemented in a reliable way, especially when libraries are removed from .config.

So for now I fear we have to stick to "make clean && make" if we want to clean up our file system.

Quoted 4 lines

The current procedure to do
this is:

* remove build/.root (or remove target/ if you want to throw all your work)

What's the use in removing the stamp file and keeping the target directory? I think the whole proccedure is meant to chean up the target file system, isn't it?

Regards

Stephan

Quoted 39 lines

* remove build/*/.stamp_target_installed
* depending of you toolchain:

  # remove stamps/ext-toolchain-installed (external)
  # remove stamps/ct-ng-toolchain-installed (ctng)
  # remove target/lib/libc.so.0 (buildroot)
* launch make

I think this process lacks of consistency. Idealy, this process should be:
rm -r target (depending if want to throw all your work)
rm build/*/.stamp_target_installed
make

I suggest following changes:

1. Move build/.root to stamps/. Since it is hidden, many user forget this
file exist.

2. All stamps files are in subdirectories of build/. I suggest to move
stamps/ to build/stamps/

3. Buildroot toolchain should create a stamp files to be uniform with other
toolchains. In add, target/lib/libc.so.0 never exists when PREFER_STATIC_LIB is enable.

4. To be consistent stamps/*-toolchain-installed may be renamed
stamps/.stamp_target_installed or stamps/.stamp_toolchain_target_installed or toolchain/.stamp_target_installed. We may add a README file to explain what is purpose of this apparently empty directory.

5. stamps/ext-toolchain-installed currently copy libc in staging/ and in
target/. It may be splited in two rules: stamps/ext-toolchain-target-installed and stamps/ext-toolchain-staging-installed.

What do you think about it?

Regards,

Signature · 4 lines
reLinux     -    Stephan Hoffmann
Am Schmidtgrund 124    50765 K?ln
Tel. +49.221.95595-19    Fax: -64
www.reLinux.de     sho at reLinux.de
#2 lore raw

Hello Stephan,

Quoted 9 lines · On Thursday 17 January 2013 14:27:46 Stephan Hoffmann wrote:

Am 17.01.2013 12:04, schrieb J?r?me Pouiller:

Quoted 2 lines

It is handy to do tests directly in target/. But after some time, it is necessary to make a new fresh target/ directory.

This topic comes up from time to time. Once upon a time I sent a patch to introduce a "make target-clean" (
http://lists.busybox.net/pipermail/buildroot/2012-October/060484.html ) , but it does not seem that this feature can be implemented in a reliable way, especially when libraries are removed from .config.

I am agreee with this thread. Since we cannot prove correctness it is not a good idea to give a target to this.

Nevertheless, in 90% of cases, I know I can rebuild target/ without recompile everything and this "hack" allow to divide by 500 time to rebuild target/. I would like to make this procedure easier to learn for users.

I asked myself if it was not possible to make this procedure more intuitive without breaking everything. That why I suggest these small changes. Each of them can be done independently.

IMHO these changes would make process more coherent and would bring a better usage of Buildroot. But I understand it is subjective.

Quoted 2 lines

So for now I fear we have to stick to "make clean && make" if we want to clean up our file system.

Sure. But, if it is the only answer I give, my interlocutor will reply me that Buildroot is painful (which make me angry for all rest of the day).

Quoted 10 lines
Quoted 6 lines

The current procedure to do

this is:

* remove build/.root (or remove target/ if you want to throw all your work)

What's the use in removing the stamp file and keeping the target directory? I think the whole proccedure is meant to chean up the target file system, isn't it?

Right. It was mainly to point out "build/.root" is not an intuitive path.

[...]

Quoted 11 lines
Quoted 11 lines

I suggest following changes:
1. Move build/.root to stamps/. Since it is hidden, many user forget this
file exist.

2. All stamps files are in subdirectories of build/. I suggest to move
stamps/ to build/stamps/

3. Buildroot toolchain should create a stamp files to be uniform with other toolchains. In add, target/lib/libc.so.0 never exists when PREFER_STATIC_LIB is enable.

Quoted 8 lines
Quoted 8 lines

4. To be consistent stamps/*-toolchain-installed may be renamed
stamps/.stamp_target_installed or stamps/.stamp_toolchain_target_installed or toolchain/.stamp_target_installed. We may add a README file to explain what is purpose of this apparently empty directory.

5. stamps/ext-toolchain-installed currently copy libc in staging/ and in
target/. It may be splited in two rules: stamps/ext-toolchain-target- installed and stamps/ext-toolchain-staging-installed.

[...]

Regards,

Signature · 1 line
J?r?me Pouiller
#3 lore raw
In reply to Jérôme Pouiller
Quoted 14 lines · J?r?me Pouiller

Hello all,

It is handy to do tests directly in target/. But after some time, it is necessary to make a new fresh target/ directory. The current procedure to do this is:

* remove build/.root (or remove target/ if you want to throw all your work)
* remove build/*/.stamp_target_installed
* depending of you toolchain:

   # remove stamps/ext-toolchain-installed (external)
   # remove stamps/ct-ng-toolchain-installed (ctng)
   # remove target/lib/libc.so.0 (buildroot)
* launch make
Quoted 4 lines

I think this process lacks of consistency. Idealy, this process should be:
rm -r target (depending if want to throw all your work)
rm build/*/.stamp_target_installed
make

I agree that it lacks consistency, and I'm in favour of improving the
consistency of stamp files.

Quoted 5 lines

I suggest following changes:

1. Move build/.root to stamps/. Since it is hidden, many user forget this
file exist.

ACK.

Quoted 3 lines

2. All stamps files are in subdirectories of build/. I suggest to move
stamps/ to build/stamps/

I'm not convinced that that improves the consistency. If build/.root
moves to stamps, than all directories in build/ are build directories. That sounds like a good idea to me.

Quoted 3 lines

3. Buildroot toolchain should create a stamp files to be uniform with other
toolchains. In add, target/lib/libc.so.0 never exists when PREFER_STATIC_LIB is enable.

ACK

Note that the buildroot toolchain is on the way out (though it will
probably take 3 more years before it's really gone), so don't put too much effort into improving it.

Quoted 4 lines

4. To be consistent stamps/*-toolchain-installed may be renamed
stamps/.stamp_target_installed or stamps/.stamp_toolchain_target_installed or toolchain/.stamp_target_installed. We may add a README file to explain what is purpose of this apparently empty directory.

I don't agree with this one. build/*/.stamp_* is stuff that is created
by the package infrastructure. The toolchain stuff is not in the package infrastructure. So I wouldn't let it use the same pattern for stamp files.

Quoted 3 lines

5. stamps/ext-toolchain-installed currently copy libc in staging/ and in
target/. It may be splited in two rules: stamps/ext-toolchain-target-installed and stamps/ext-toolchain-staging-installed.

It could be split, but what is the advantage of that?

Quoted 1 line

What do you think about it?

Let's see some patches! :-)

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#4 lore raw

PATCH 1/1 Standardisation of $(BUILD)/.root name

To be coherent with stamps used by toolchains, file $(BUILD)/.root is now named $(STAMPS)/target-skeleton-installed.

---
 Makefile |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Makefile +3 -2
index a57975e..73a7c01 100644
@@ -429,16 +429,17 @@ ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y)
 TARGET_SKELETON=$(BR2_ROOTFS_SKELETON_CUSTOM_PATH)
 endif
 
-$(BUILD_DIR)/.root:
+$(STAMP_DIR)/skeleton-target-installed:
 	mkdir -p $(TARGET_DIR)
 	rsync -a \
 		--exclude .empty --exclude .svn --exclude .git \
 		--exclude .hg --exclude=CVS --exclude '*~' \
 		$(TARGET_SKELETON)/ $(TARGET_DIR)/
 	cp support/misc/target-dir-warning.txt $(TARGET_DIR_WARNING_FILE)
+	mkdir -p $(STAMP_DIR)
 	touch $@
 
-$(TARGET_DIR): $(BUILD_DIR)/.root
+$(TARGET_DIR): $(STAMP_DIR)/skeleton-target-installed
 
 STRIP_FIND_CMD = find $(TARGET_DIR)
 ifneq (,$(call qstrip,$(BR2_STRIP_EXCLUDE_DIRS)))
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH 1/1 Standardisation of $(BUILD)/.root name

Dear J?r?me Pouiller,

Makefile ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y) · line 440

Quoted 10 lines · J?r?me Pouiller

-$(BUILD_DIR)/.root:
+$(STAMP_DIR)/skeleton-target-installed:

Makefile +1 -0
 	mkdir -p $(TARGET_DIR)
 	rsync -a \
 		--exclude .empty --exclude .svn --exclude .git \
 		--exclude .hg --exclude=CVS --exclude '*~' \
 		$(TARGET_SKELETON)/ $(TARGET_DIR)/
 	cp support/misc/target-dir-warning.txt $(TARGET_DIR_WARNING_FILE)
+	mkdir -p $(STAMP_DIR)
 	touch $@

I'm generally ok with the idea, but I don't like this mkdir. There is already a mkdir that creates the stamp file directory, in the main Makefile.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#6 lore raw

PATCH 1/1 Standardisation of $(BUILD)/.root name

Quoted 15 lines · On Tuesday 14 May 2013 17:07:21 Thomas Petazzoni wrote:

Dear J?r?me Pouiller,

Quoted 12 lines · J?r?me Pouiller

-$(BUILD_DIR)/.root:

+$(STAMP_DIR)/skeleton-target-installed:

Makefile +0 -0
 	mkdir -p $(TARGET_DIR)
 	rsync -a \
 
 		--exclude .empty --exclude .svn --exclude .git \
 		--exclude .hg --exclude=CVS --exclude '*~' \
 		$(TARGET_SKELETON)/ $(TARGET_DIR)/
 
 	cp support/misc/target-dir-warning.txt $(TARGET_DIR_WARNING_FILE)
Quoted 7 lines

Makefile ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y)

Quoted 3 lines
Makefile +1 -0
+	mkdir -p $(STAMP_DIR)
 
 	touch $@

I'm generally ok with the idea, but I don't like this mkdir. There is already a mkdir that creates the stamp file directory, in the main Makefile.

I also dislike this mkdir. My problem is to be sure $(STAMP_DIR) is created before $(STAMP_DIR)/skeleton-target-installed.

I can change order of dependencies in dirs target but this solution is too fragile.

I cannot just add a dependency between $(STAMP_DIR)/skeleton-target-installed and $(STAMP_DIR).

I can add a stampfile for $(STAMP_DIR) but it looks a little complicated.

I can also use an intermediate phony target (like dirs target) but it also looks complicated.

Any better idea?

Signature · 3 lines
J?r?me Pouiller, Sysmic
Embedded Linux specialist
http://www.sysmic.fr
#7 lore raw

PATCH 1/1 Standardisation of $(BUILD)/.root name

J?r?me, All,

On 2013-05-14 17:27 +0200, J?r?me Pouiller spake thusly:

Quoted 23 lines · On Tuesday 14 May 2013 17:07:21 Thomas Petazzoni wrote:
Quoted 15 lines

Dear J?r?me Pouiller,

Quoted 12 lines · J?r?me Pouiller

-$(BUILD_DIR)/.root:

+$(STAMP_DIR)/skeleton-target-installed:

Makefile +0 -0
 	mkdir -p $(TARGET_DIR)
 	rsync -a \
 
 		--exclude .empty --exclude .svn --exclude .git \
 		--exclude .hg --exclude=CVS --exclude '*~' \
 		$(TARGET_SKELETON)/ $(TARGET_DIR)/
 
 	cp support/misc/target-dir-warning.txt $(TARGET_DIR_WARNING_FILE)
Quoted 7 lines

Makefile ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y)

Quoted 3 lines
Makefile +1 -0
+	mkdir -p $(STAMP_DIR)
 
 	touch $@

I'm generally ok with the idea, but I don't like this mkdir. There is already a mkdir that creates the stamp file directory, in the main Makefile.

Quoted 5 lines

I also dislike this mkdir. My problem is to be sure $(STAMP_DIR) is created before $(STAMP_DIR)/skeleton-target-installed.

I can change order of dependencies in dirs target but this solution is too fragile.

Agreed, this is not-so-nice.

Quoted 2 lines

I cannot just add a dependency between $(STAMP_DIR)/skeleton-target-installed and $(STAMP_DIR).

Why not? Like:

    $(STAMP_DIR)/skeleton-target-installed: $(STAMP_DIR)

which to me looks like the sane solution (and not what I previosuly answered Arnout about $(TARGET_DIR))

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#8 lore raw

PATCH 1/1 Standardisation of $(BUILD)/.root name

On Wednesday 15 May 2013 00:23:24 Yann E. MORIN wrote:
[...]

Quoted 8 lines
Quoted 2 lines

I cannot just add a dependency between $(STAMP_DIR)/skeleton-target-installed and $(STAMP_DIR).

Why not? Like:

    $(STAMP_DIR)/skeleton-target-installed: $(STAMP_DIR)

which to me looks like the sane solution (and not what I previosuly answered Arnout about $(TARGET_DIR))

Because, $(STAMP_DIR)/skeleton-target-installed will be rebuilt each time a file is added or removed from $(STAMP_DIR).

Signature · 3 lines
J?r?me Pouiller, Sysmic
Embedded Linux specialist
http://www.sysmic.fr
#9 lore raw

PATCH 1/1 Standardisation of $(BUILD)/.root name

Quoted 6 lines · On Wednesday 15 May 2013 08:19:10 J?r?me Pouiller wrote:

On Wednesday 15 May 2013 00:23:24 Yann E. MORIN wrote:
[...]

Quoted 3 lines
Quoted 2 lines

I cannot just add a dependency between $(STAMP_DIR)/skeleton-target-installed and $(STAMP_DIR).

Quoted 8 lines
Quoted 5 lines

Why not? Like:

    $(STAMP_DIR)/skeleton-target-installed: $(STAMP_DIR)

which to me looks like the sane solution (and not what I previosuly answered Arnout about $(TARGET_DIR))

Because, $(STAMP_DIR)/skeleton-target-installed will be rebuilt each time a file is added or removed from $(STAMP_DIR).

But, we may use an intermediate phony target:
$(STAMP_DIR)_phony: $(STAMP_DIR)
.PHONY: $(STAMP_DIR)_phony $(STAMP_DIR)/skeleton-target-installed: $(STAMP_DIR)_phony

(not tested, but should work)

Signature · 3 lines
J?r?me Pouiller, Sysmic
Embedded Linux specialist
http://www.sysmic.fr
#10 lore raw

PATCH 1/1 Standardisation of $(BUILD)/.root name

J?r?me, All,

On 2013-05-15 08:27 +0200, J?r?me Pouiller spake thusly:

Quoted 13 lines · On Wednesday 15 May 2013 08:19:10 J?r?me Pouiller wrote:
Quoted 12 lines · On Wednesday 15 May 2013 00:23:24 Yann E. MORIN wrote:

[...]

Quoted 8 lines
Quoted 2 lines

I cannot just add a dependency between $(STAMP_DIR)/skeleton-target-installed and $(STAMP_DIR).

Why not? Like:

    $(STAMP_DIR)/skeleton-target-installed: $(STAMP_DIR)

which to me looks like the sane solution (and not what I previosuly answered Arnout about $(TARGET_DIR))

Quoted 6 lines
Quoted 2 lines

Because, $(STAMP_DIR)/skeleton-target-installed will be rebuilt each time a file is added or removed from $(STAMP_DIR).

But, we may use an intermediate phony target:
$(STAMP_DIR)_phony: $(STAMP_DIR)
.PHONY: $(STAMP_DIR)_phony $(STAMP_DIR)/skeleton-target-installed: $(STAMP_DIR)_phony

Or an order-only rule:

$(STAMP_DIR)/skeleton-target-installed: | $(STAMP_DIR)

(not tested, but it's used in the crosstool-NG backend)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#11 lore raw

PATCH 1/1 Standardisation of $(BUILD)/.root name

In reply to Jérôme Pouiller

On 2013-05-15 08:19 +0200, J?r?me Pouiller spake thusly:

Quoted 5 lines · On Wednesday 15 May 2013 00:23:24 Yann E. MORIN wrote:

[...]

Quoted 3 lines
Quoted 2 lines

I cannot just add a dependency between $(STAMP_DIR)/skeleton-target-installed and $(STAMP_DIR).

Quoted 7 lines
Quoted 5 lines

Why not? Like:

    $(STAMP_DIR)/skeleton-target-installed: $(STAMP_DIR)

which to me looks like the sane solution (and not what I previosuly answered Arnout about $(TARGET_DIR))

Because, $(STAMP_DIR)/skeleton-target-installed will be rebuilt each time a file is added or removed from $(STAMP_DIR).

Indeed. Sigh. Too short-sighted I was...

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#12 lore raw

PATCH 1/1 Standardisation of $(BUILD)/.root name

In reply to Thomas Petazzoni
Quoted 4 lines · Thomas Petazzoni

Dear J?r?me Pouiller,

On Tue, 14 May 2013 16:30:50 +0200, J?r?me Pouiller wrote:

Quoted 14 lines

Makefile ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y) · line 440

Quoted 10 lines

-$(BUILD_DIR)/.root:
+$(STAMP_DIR)/skeleton-target-installed:
mkdir -p $(TARGET_DIR)
rsync -a \
--exclude .empty --exclude .svn --exclude .git \
--exclude .hg --exclude=CVS --exclude '*~' \
$(TARGET_SKELETON)/ $(TARGET_DIR)/
cp support/misc/target-dir-warning.txt $(TARGET_DIR_WARNING_FILE)

Makefile +1 -0
+	mkdir -p $(STAMP_DIR)
  	touch $@

I'm generally ok with the idea, but I don't like this mkdir. There is already a mkdir that creates the stamp file directory, in the main Makefile.

I don't have an issue with a few redundant mkdir -p calls.

I would like to see a $(Q) in front of it though - but then it should
be in front of the rest as well, and with a $(MESSAGE) call.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#13 lore raw

PATCH 1/1 Standardisation of $(BUILD)/.root name

Arnout, All,

On 2013-05-14 23:52 +0200, Arnout Vandecappelle spake thusly:

Quoted 20 lines · Thomas Petazzoni
Quoted 4 lines

Dear J?r?me Pouiller,

On Tue, 14 May 2013 16:30:50 +0200, J?r?me Pouiller wrote:

Quoted 14 lines

Makefile ifeq ($(BR2_ROOTFS_SKELETON_CUSTOM),y) · line 440

Quoted 10 lines

-$(BUILD_DIR)/.root:
+$(STAMP_DIR)/skeleton-target-installed:

Makefile +1 -0
 	mkdir -p $(TARGET_DIR)
 	rsync -a \
 		--exclude .empty --exclude .svn --exclude .git \
 		--exclude .hg --exclude=CVS --exclude '*~' \
 		$(TARGET_SKELETON)/ $(TARGET_DIR)/
 	cp support/misc/target-dir-warning.txt $(TARGET_DIR_WARNING_FILE)
+	mkdir -p $(STAMP_DIR)
 	touch $@

I'm generally ok with the idea, but I don't like this mkdir. There is already a mkdir that creates the stamp file directory, in the main Makefile.

Quoted 1 line

I don't have an issue with a few redundant mkdir -p calls.

I concur with Thomas: we should ensure the stamp-dir is already created in a generic way, it's kind of an internal stuff, which should not be visible to users (I mean: packages, and stuff like that, not actual persons).

That we need to sprinkle the code with a few 'mkdir' here and ther "just in case" is an indication we do not fully masterise the chain of events, and is really not nice.

The fact that the 'mkdir' is needed in the first place is because of this rulle in the top-level Makefile:

    dirs: [...] $(TARGET_DIR) [...] $(STAMP_DIR)

which will have 'make' run the $(TARGET_DIR) goal before the $(STAMP_DIR) goal.

This can be solved in two ways: the nice one, and the not-so-nice one:
- have an additional rule:

        $(TARGET_DIR): $(STAMP_DIR)                 <- the nice way

- invert the order of goals in the 'dirs' rule <- the not-so-nice way

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'