Timeline for Get top-level directory from makefile variable
Current License: CC BY-SA 3.0
        3 events
    
    | when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 9, 2011 at 16:59 | comment | added | Tim Kennedy | One thing you can do in a Makefile is run commands.  So you create a shell script, in your path, called rootdir, and in your makefile, run "rm -rf $(rootdir $BUILD_DIR)", or something like that.  Or you'll have to do something like pre-define the build root, so that you can rm -rfit later.  I would definitely doublecheck the response that therootdirscript can pass back, so you don't end up with a syntax error giving your scriptrm -rf /. | |
| Nov 9, 2011 at 16:14 | comment | added | l0b0 | This is for a makefile, not Bash. This is a trivial problem in Bash, but I'm interested in a simple makefile solution. | |
| Nov 9, 2011 at 15:42 | history | answered | Tim Kennedy | CC BY-SA 3.0 |