use relative paths on making build/tools/ links
authorgdh1995 <gdh1995@qq.com>
Wed, 13 Jan 2016 10:20:41 +0000 (18:20 +0800)
committergdh1995 <gdh1995@qq.com>
Fri, 29 Jan 2016 08:10:16 +0000 (16:10 +0800)
The old uses `abspath`, which I think is so harmful:
* If I `cp -a` the whole project, `build/tools/caffe` still refer to
    the old file, until `make clean`, making debugging very hard
* For `tar` and `scp`, the soft links can not work
    unless the target project folder has the same path

Makefile

index 787b0e8..76d51ad 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -601,7 +601,7 @@ $(TEST_CXX_BINS): $(TEST_BIN_DIR)/%.testbin: $(TEST_CXX_BUILD_DIR)/%.o \
 # Target for extension-less symlinks to tool binaries with extension '*.bin'.
 $(TOOL_BUILD_DIR)/%: $(TOOL_BUILD_DIR)/%.bin | $(TOOL_BUILD_DIR)
        @ $(RM) $@
-       @ ln -s $(abspath $<) $@
+       @ ln -s $(notdir $<) $@
 
 $(TOOL_BINS): %.bin : %.o | $(DYNAMIC_NAME)
        @ echo CXX/LD -o $@