Skip to contentSkip to conversation

Makefile patch to create KBUILD_OUPUT if it doesn't exist

PATCH In review Brian Jackson 2 participants 2 messages Mar 31, 2004 – Apr 1, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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-----

#1 lore raw
Quoted 6 lines · Brian Jackson

-----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