Path: utzoo!utgpu!watmath!watcgl!idallen From: idallen@watcgl.waterloo.edu (Ian! D. Allen [CGL]) Newsgroups: uw.mfcf.people Subject: Re: how do I make sure a directory exists from a Makefile? Message-ID: <11724@watcgl.waterloo.edu> Date: 1 Oct 89 21:17:39 GMT References: <29642@watmath.waterloo.edu> Reply-To: idallen@watcgl.waterloo.edu (Ian! D. Allen [CGL]) Distribution: uw Organization: U. of Waterloo, Ontario Lines: 23 You can't have anything fail directly in Makefile scripts. Method 1: set - /software/foo/ba[r]/. && \ case "$1" in \ /software/foo/bar/.) echo is a directory ;; \ *) mkdir /software/foo/bar ;; \ esac Method 2: case `sh -c "test -d /software/foo/bar/. && echo OKAY ; :"` in \ OKAY) echo is a directory ;; \ *) mkdir /software/foo/bar ;; \ esac Method 3: sh -c "test -d /software/foo/bar/. || mkdir /software/foo/bar" -- -IAN! (Ian! D. Allen) idallen@watcgl.uwaterloo.ca idallen@watcgl.waterloo.edu 129.97.128.64 Computer Graphics Lab/University of Waterloo/Ontario/Canada