2004-03-31 22:45:28

by Brian Jackson

[permalink] [raw]
Subject: [PATCH] Makefile patch to create KBUILD_OUPUT if it doesn't exist

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It was probably intentional to not have the Makefile automagically create
KBUILD_OUPUT if it doesn't exist, but just in case, here's a patch which
makes it do just that. I'd appreciate feedback either way just so I know if
it's actually getting looked at or if it got lost somewhere along the way.

- --Brian Jackson

- --- Makefile.orig 2004-03-31 16:21:48.254691909 -0600
+++ Makefile 2004-03-31 16:34:27.507098249 -0600
@@ -88,10 +88,10 @@
ifneq ($(KBUILD_OUTPUT),)
# Invoke a second make in the output directory, passing relevant variables
# check that the output directory actually exists
+$(if $(wildcard $(KBUILD_OUTPUT)),, \
+ $(shell mkdir -p ${KBUILD_OUTPUT}))
saved-output := $(KBUILD_OUTPUT)
KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
- -$(if $(wildcard $(KBUILD_OUTPUT)),, \
- - $(error output directory "$(saved-output)" does not exist))

.PHONY: $(MAKECMDGOALS)


- --
http://www.brianandsara.net
For Sale : http://www.brianandsara.net/temp/forsale.php
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAa0qH+cPN+Z7qK9cRAiB9AJ0dtkq92cgYTailSvEPBS2Z/iez9wCg0CA2
GBdCdX7RPUhe9EXdXn7Y6Yg=
=+vf2
-----END PGP SIGNATURE-----


2004-04-01 04:57:20

by Sam Ravnborg

[permalink] [raw]
Subject: Re: [PATCH] Makefile patch to create KBUILD_OUPUT if it doesn't exist

On Wed, Mar 31, 2004 at 04:47:35PM -0600, Brian Jackson wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> It was probably intentional to not have the Makefile automagically create
> KBUILD_OUPUT if it doesn't exist, but just in case, here's a patch which
> makes it do just that.

It was not done so typing errors do not start creating a lot of directories.
but it is also tiresome to type:
mkdir ~/b
make O=~/b ...

Could you make kbuild print out the created directory in kbuild format:
CRDIR dir/which/is/created

Sam