digitalmars.D - Intrusive Makefile for d-programming-language.org
- Peter Alexander (16/16) Jan 15 2012 I'm not particularly well versed in Makefile ethics, but this caught me
- mta`chrono (18/24) Jan 15 2012 You're right! Makefiles shouldn't do anything outside their own
- Jacob Carlborg (5/29) Jan 15 2012 Or create a super repository and use git submodules to include all
- Andrei Alexandrescu (3/19) Jan 15 2012 I'll fix that.
- Andrei Alexandrescu (4/31) Jan 22 2012 Fixed:
I'm not particularly well versed in Makefile ethics, but this caught me by surprise. Suppose I clone d-programming-language.org into my home directory (as I did), do some work, then later on run make clean. git clone https://.../d-programming-language.org.git cd d-programming-language.org ... do stuff ... make -fposix.mak clean Here's what clean does: rm -rf ../web ../dmd.2.056 2.056.ddoc rm -rf ../druntime.2.056 ../phobos.2.056 If I had a web dir in my home directory (not exactly uncommon), it would have been deleted without warning. Luckily, I didn't. I now have it cloned into a separate dir where it can do no harm. Is it normal for Makefiles to be so intrusive? IMO, Makefiles shouldn't be deleting anything outside their own directory.
Jan 15 2012
If I had a web dir in my home directory (not exactly uncommon), it would have been deleted without warning. Luckily, I didn't. I now have it cloned into a separate dir where it can do no harm. Is it normal for Makefiles to be so intrusive? IMO, Makefiles shouldn't be deleting anything outside their own directory.You're right! Makefiles shouldn't do anything outside their own directory, but building the website is a little bit complicated as d-progamming-language.org relys on the sources of druntime and phobos to generate the documentation. I think it can not be avoided in this particular case. The Makefile has to do some work in the parent folder. BUT, it's probably best to add a "README.md" and give a short explanation of how to build the website. ---- mkdir -p /tmp/workdir cd /tmp/workdir git checkout ... git checkout ... git checkout ... make -f .... move BLA to your /var/www/public_html folder rm -rf /var/workdir ----
Jan 15 2012
On 2012-01-15 14:28, mta`chrono wrote:Or create a super repository and use git submodules to include all repositories currently at: https://github.com/D-Programming-Language -- /Jacob CarlborgIf I had a web dir in my home directory (not exactly uncommon), it would have been deleted without warning. Luckily, I didn't. I now have it cloned into a separate dir where it can do no harm. Is it normal for Makefiles to be so intrusive? IMO, Makefiles shouldn't be deleting anything outside their own directory.You're right! Makefiles shouldn't do anything outside their own directory, but building the website is a little bit complicated as d-progamming-language.org relys on the sources of druntime and phobos to generate the documentation. I think it can not be avoided in this particular case. The Makefile has to do some work in the parent folder. BUT, it's probably best to add a "README.md" and give a short explanation of how to build the website. ---- mkdir -p /tmp/workdir cd /tmp/workdir git checkout ... git checkout ... git checkout ... make -f .... move BLA to your /var/www/public_html folder rm -rf /var/workdir ----
Jan 15 2012
On 1/15/12 7:09 AM, Peter Alexander wrote:I'm not particularly well versed in Makefile ethics, but this caught me by surprise. Suppose I clone d-programming-language.org into my home directory (as I did), do some work, then later on run make clean. git clone https://.../d-programming-language.org.git cd d-programming-language.org .... do stuff ... make -fposix.mak clean Here's what clean does: rm -rf ../web ../dmd.2.056 2.056.ddoc rm -rf ../druntime.2.056 ../phobos.2.056 If I had a web dir in my home directory (not exactly uncommon), it would have been deleted without warning. Luckily, I didn't. I now have it cloned into a separate dir where it can do no harm. Is it normal for Makefiles to be so intrusive? IMO, Makefiles shouldn't be deleting anything outside their own directory.I'll fix that. Andrei
Jan 15 2012
On 1/15/12 9:19 AM, Andrei Alexandrescu wrote:On 1/15/12 7:09 AM, Peter Alexander wrote:Fixed: https://github.com/D-Programming-Language/d-programming-language.org/commit/30545e3ada4bafbed6e246c0b82b0442912955d1 AndreiI'm not particularly well versed in Makefile ethics, but this caught me by surprise. Suppose I clone d-programming-language.org into my home directory (as I did), do some work, then later on run make clean. git clone https://.../d-programming-language.org.git cd d-programming-language.org .... do stuff ... make -fposix.mak clean Here's what clean does: rm -rf ../web ../dmd.2.056 2.056.ddoc rm -rf ../druntime.2.056 ../phobos.2.056 If I had a web dir in my home directory (not exactly uncommon), it would have been deleted without warning. Luckily, I didn't. I now have it cloned into a separate dir where it can do no harm. Is it normal for Makefiles to be so intrusive? IMO, Makefiles shouldn't be deleting anything outside their own directory.I'll fix that. Andrei
Jan 22 2012