Skip to content

Commit

Permalink
better dependency generation
Browse files Browse the repository at this point in the history
  • Loading branch information
andralex committed Dec 17, 2013
1 parent a3f28dc commit b6b66ec
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,10 @@ depend: $(addprefix $(ROOT)/unittest/,$(addsuffix .deps,$(D_MODULES)))

$(ROOT)/unittest/%.deps:
@mkdir -p $(dir $@)
echo $(ROOT)/unittest/$*.o: \
`$(DMD) $(DFLAGS) -v -c -o- -unittest $*.d | grep '^import ' | \
sed 's/.*(\(.*\))/\1/'` >$@
$(DMD) $(DFLAGS) -unittest -c -o- -deps=$@.tmp1 $*
echo '$@: ' `sed 's|.*(\(.*\)).*|\1|' $@.tmp1 | sort | uniq` >$@.tmp
mv $@.tmp $@
rm $@.tmp1

$(ROOT)/%$(DOTOBJ) : %.c
@[ -d $(dir $@) ] || mkdir -p $(dir $@) || [ -d $(dir $@) ]
Expand Down

0 comments on commit b6b66ec

Please sign in to comment.