diff --git a/repos/base-hw/src/bootstrap/hw/target.mk b/repos/base-hw/src/bootstrap/hw/target.mk index 06c3d050c..66b680ad8 100644 --- a/repos/base-hw/src/bootstrap/hw/target.mk +++ b/repos/base-hw/src/bootstrap/hw/target.mk @@ -1,10 +1,22 @@ TARGET = bootstrap LIBS = bootstrap-hw -BOOTSTRAP_OBJ = bootstrap.o +BOOTSTRAP_OBJ = bootstrap-hw.o -$(TARGET): $(BOOTSTRAP_OBJ) +$(TARGET): $(VERBOSE)true +ifneq ($(INSTALL_DIR),) +ifneq ($(DEBUG_DIR),) +$(TARGET): $(INSTALL_DIR)/$(BOOTSTRAP_OBJ) + +$(INSTALL_DIR)/$(BOOTSTRAP_OBJ) : $(DEBUG_DIR)/$(BOOTSTRAP_OBJ) + $(VERBOSE)$(STRIP) --strip-debug -o $@ $< + +$(DEBUG_DIR)/$(BOOTSTRAP_OBJ) : $(BOOTSTRAP_OBJ) + $(VERBOSE)ln -sf $(CURDIR)/$(BOOTSTRAP_OBJ) $(DEBUG_DIR)/$(BOOTSTRAP_OBJ) +endif +endif + .PHONY: $(BOOTSTRAP_OBJ) $(BOOTSTRAP_OBJ): $(VERBOSE)$(LD) $(LD_MARCH) -u _start --whole-archive -r $(LINK_ITEMS) $(LIBCXX_GCC) -o $@