aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Thiago Macieira <thiago@macieira.org>2013-04-13 23:36:46 -0700
committerGravatar Thiago Macieira <thiago@macieira.org>2013-04-23 00:06:32 -0700
commitd312b7d6fd40c961c1922f670388cdd8a4b92e77 (patch)
tree162683aa00658baa2958e73c4396fcd5768e94f3
parentc5d244eeea0583eaef3a30e01e7efb2e8a060af8 (diff)
downloadsubsurface-d312b7d6fd40c961c1922f670388cdd8a4b92e77.tar.gz
Don't hardcode the paths for mkdir: just get them from the target
The $(@D) (equivalent to $(dir $@)) tells us what the directory the target is in. We could also have used the one for the source. They're equivalent there. Signed-off-by: Thiago Macieira <thiago@macieira.org>
-rw-r--r--Rules.mk6
1 files changed, 3 insertions, 3 deletions
diff --git a/Rules.mk b/Rules.mk
index ee99773ba..d3c8c79a8 100644
--- a/Rules.mk
+++ b/Rules.mk
@@ -143,12 +143,12 @@ MOCFLAGS = $(filter -I%, $(CXXFLAGS) $(EXTRA_FLAGS)) $(filter -D%, $(CXXFLAGS) $
%.o: %.c
@$(PRETTYECHO) ' CC' $<
- @mkdir -p .dep .dep/qt-ui
+ @mkdir -p .dep/$(@D)
$(COMPILE_PREFIX)$(CC) $(CFLAGS) $(EXTRA_FLAGS) -MD -MF .dep/$@.dep -c -o $@ $<
%.o: %.cpp
@$(PRETTYECHO) ' CXX' $<
- @mkdir -p .dep .dep/qt-ui
+ @mkdir -p .dep/$(@D)
$(COMPILE_PREFIX)$(CXX) $(CXXFLAGS) $(EXTRA_FLAGS) -MD -MF .dep/$@.dep -c -o $@ $<
# This rule is for running the moc on QObject subclasses defined in the .h
@@ -220,7 +220,7 @@ confclean: clean
ifneq ($(CONFIGURED)$(CONFIGURING),)
.dep/%.o.dep: %.cpp
- @mkdir -p .dep .dep/qt-ui
+ @mkdir -p $(@D)
@$(CXX) $(CXXFLAGS) $(EXTRA_FLAGS) -MM -MG -MF $@ -MT $(<:.cpp=.o) -c $<
endif