Symlink to tool bins without the .bin extension

This commit is contained in:
Jeff Donahue 2014-07-27 12:50:13 -07:00
Родитель 4bd9489673
Коммит 6d71c516bc
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -117,6 +117,8 @@ EXAMPLE_BUILD_DIRS += $(foreach obj,$(EXAMPLE_OBJS),$(dir $(obj)))
# tool, example, and test bins # tool, example, and test bins
TOOL_BINS := ${TOOL_OBJS:.o=.bin} TOOL_BINS := ${TOOL_OBJS:.o=.bin}
EXAMPLE_BINS := ${EXAMPLE_OBJS:.o=.bin} EXAMPLE_BINS := ${EXAMPLE_OBJS:.o=.bin}
# symlinks to tool bins without the ".bin" extension
TOOL_BIN_LINKS := ${TOOL_BINS:.bin=}
# Put the test binaries in build/test for convenience. # Put the test binaries in build/test for convenience.
TEST_BIN_DIR := $(BUILD_DIR)/test TEST_BIN_DIR := $(BUILD_DIR)/test
TEST_CU_BINS := $(addsuffix .testbin,$(addprefix $(TEST_BIN_DIR)/, \ TEST_CU_BINS := $(addsuffix .testbin,$(addprefix $(TEST_BIN_DIR)/, \
@ -327,7 +329,7 @@ $(LINT_OUTPUTS): $(LINT_OUTPUT_DIR)/%.lint.txt : % | $(LINT_OUTPUT_DIR)
test: $(TEST_ALL_BIN) $(TEST_BINS) test: $(TEST_ALL_BIN) $(TEST_BINS)
tools: $(TOOL_BINS) tools: $(TOOL_BINS) $(TOOL_BIN_LINKS)
examples: $(EXAMPLE_BINS) examples: $(EXAMPLE_BINS)
@ -431,6 +433,11 @@ $(TEST_CXX_BINS): $(TEST_BIN_DIR)/%.testbin: $(TEST_BUILD_DIR)/%.o $(GTEST_OBJ)
-o $@ $(LINKFLAGS) $(LDFLAGS) -o $@ $(LINKFLAGS) $(LDFLAGS)
@ echo @ echo
# 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 $<) $@
$(TOOL_BINS): %.bin : %.o $(STATIC_NAME) $(TOOL_BINS): %.bin : %.o $(STATIC_NAME)
$(CXX) $< $(STATIC_NAME) -o $@ $(LINKFLAGS) $(LDFLAGS) $(CXX) $< $(STATIC_NAME) -o $@ $(LINKFLAGS) $(LDFLAGS)
@ echo @ echo