]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - Makefile
Yeah, it is working (the Makefile), now at least...
[xonotic/netradiant.git] / Makefile
index b4d35281f5b3b9b8229fa45d110315368519b1d8..c8c0578362ec2d6a3e53ebe5b5074ed6b266e0be 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -13,6 +13,7 @@ LDD ?= ldd
 FIND ?= find
 RANLIB ?= ranlib
 AR ?= ar
+MKDIR ?= mkdir -p
 
 TEE_STDERR ?= | tee /dev/stderr
 
@@ -65,6 +66,7 @@ clean:
        $(FIND) . \( -name \*.o -o -name \*.$(SO) -o -name \*.$(A) -o -name \*.$(EXE) \) -exec $(RM) {} \;
 
 %.$(EXE):
+       dir=$@; $(MKDIR) $${dir%/*}
        $(CXX) -o $@ $^ $(LDFLAGS) $(LIBS)
        [ -z "$(LDD)" ] || [ -z "`$(LDD) -r $@ 2>&1 >/dev/null $(TEE_STDERR)`" ] || { $(RM) $@; exit 1; }
 
@@ -73,6 +75,7 @@ clean:
        $(RANLIB) $@
 
 %.$(DLL):
+       dir=$@; $(MKDIR) $${dir%/*}
        $(CXX) -shared -o $@ $^ $(LDFLAGS) $(LDFLAGS_DLL) $(LIBS)
        [ -z "$(LDD)" ] || [ -z "`$(LDD) -r $@ 2>&1 >/dev/null $(TEE_STDERR)`" ] || { $(RM) $@; exit 1; }