29 messages in com.perforce.perforce-user[p4] newbie: how do I create empty di...
FromSent OnAttachments
Shackelford, John-Mason04 Mar 2004 09:04 
Noel Yap04 Mar 2004 09:11 
Ivey, William04 Mar 2004 09:16 
Matt Stave04 Mar 2004 09:46 
Ivey, William04 Mar 2004 09:46 
Noel Yap04 Mar 2004 10:15 
Ivey, William04 Mar 2004 10:52 
Gary Sanders04 Mar 2004 11:52 
Noel Yap04 Mar 2004 12:00 
Ivey, William04 Mar 2004 12:13 
Noel Yap04 Mar 2004 12:15 
Noel Yap04 Mar 2004 12:27 
Gary Sanders04 Mar 2004 12:54 
Ivey, William04 Mar 2004 13:00 
Noel Yap04 Mar 2004 13:04 
Gary Sanders04 Mar 2004 13:49 
Williams, Ken04 Mar 2004 13:57.bin
Noel Yap04 Mar 2004 14:04 
Hamish Macdonald04 Mar 2004 14:13 
Ivey, William04 Mar 2004 14:28 
Noel Yap04 Mar 2004 14:28 
Ivey, William04 Mar 2004 14:49 
Doug Palmer04 Mar 2004 15:17 
Ivey, William04 Mar 2004 15:21 
Matt Stave04 Mar 2004 15:28 
Doug Palmer04 Mar 2004 15:39 
jab04 Mar 2004 16:46 
Hamish Macdonald04 Mar 2004 17:21 
Noel Yap05 Mar 2004 04:12 
Subject:[p4] newbie: how do I create empty directories in the depot
From:Ivey, William (will@bmc.com)
Date:03/04/2004 02:49:20 PM
List:com.perforce.perforce-user

-----Original Message----- From: Hamish Macdonald [mailto:hamish at tropicnetworks.com]

Aside: If you're using gmake, you'll probably find that:

mkdir -p ${@D} > /dev/null 2>&1

(or even: mkdir -p $O > /dev/null 2>&1 for your particular example)

is somewhat more efficient.

Missed this part earlier.

It won't work for us.

$O/%.o : %.c mkdir -p `dirname $O/$*` > /dev/null 2>&1 ; \ cc ... (the usual options and argumens)

The $O is often an incomplete path - some path info is part of $*. It's necessary to concatinate them then remove the filename in order to get a valid directory. (I inherited these Makefiles and can only do so much - in fact, this particular one can't even take advantage of gnumake's extensions since some developers refuse to "upgrade" to it.)

Anyway, since make is already creating a subshell for the compiler line, prepending it with the mkdir and dirname stuff is a trivial increase in overhead. -Wm