diff --git a/Application.mk b/Application.mk index b6a30db14..6c13f1ee9 100644 --- a/Application.mk +++ b/Application.mk @@ -74,18 +74,10 @@ ifneq ($(BUILD_MODULE),y) OBJS += $(MAINOBJ) endif -# Module install directory +# Library file BIN ?= $(APPDIR)$(DELIM)libapps$(LIBEXT) -ifeq ($(WINTOOL),y) - TOOLBIN = "${shell cygpath -w $(BIN)}" - INSTALLDIR = "${shell cygpath -w $(BINDIR)}" -else - TOOLBIN = $(BIN) - INSTALLDIR = $(BINDIR) -endif - ROOTDEPPATH += --dep-path . VPATH += :. @@ -131,7 +123,11 @@ $(CXXOBJS): %$(OBJEXT): %$(CXXEXT) $(call ELFCOMPILEXX, $<, $@), $(call COMPILEXX, $<, $@)) .built: $(OBJS) - $(call ARCHIVE, $(TOOLBIN), $(OBJS)) +ifeq ($(WINTOOL),y) + $(call ARCHIVE, "${shell cygpath -w $(BIN)}", $(OBJS)) +else + $(call ARCHIVE, $(BIN), $(OBJS)) +endif $(Q) touch $@ ifeq ($(BUILD_MODULE),y) @@ -147,11 +143,15 @@ $(MAINOBJ): %$(OBJEXT): %.c endif PROGLIST := $(wordlist 1,$(words $(MAINOBJ)),$(PROGNAME)) -PROGLIST := $(addprefix $(INSTALLDIR)$(DELIM),$(PROGLIST)) +PROGLIST := $(addprefix $(BINDIR)$(DELIM),$(PROGLIST)) PROGOBJ := $(MAINOBJ) $(PROGLIST): $(MAINOBJ) +ifeq ($(WINTOOL),y) + $(call ELFLD,$(firstword $(PROGOBJ)),"${shell cygpath -w $(firstword $(PROGLIST))}") +else $(call ELFLD,$(firstword $(PROGOBJ)),$(firstword $(PROGLIST))) +endif $(eval PROGLIST=$(filter-out $(firstword $(PROGLIST)),$(PROGLIST))) $(eval PROGOBJ=$(filter-out $(firstword $(PROGOBJ)),$(PROGOBJ))) diff --git a/Makefile b/Makefile index afc97da25..1652ea1fe 100644 --- a/Makefile +++ b/Makefile @@ -135,19 +135,12 @@ $(SYMTABSRC): $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_all) $(Q) $(APPDIR)$(DELIM)tools$(DELIM)mksymtab.sh $(BINDIR) $(SYMTABSRC) $(SYMTABOBJ): %$(OBJEXT): %.c -ifeq ($(WINTOOL),y) - $(call COMPILE, -fno-lto "${shell cygpath -w $<}", "${shell cygpath -w $@}") -else $(call COMPILE, -fno-lto $<, $@) -endif $(BIN): $(SYMTABOBJ) -ifeq ($(WINTOOL),y) - $(call ARCHIVE, $(BIN), "${shell cygpath -w $^}") -else $(call ARCHIVE, $(BIN), $^) -endif -endif # !CONFIG_BUILD_KERNEL && CONFIG_BUILD_LOADABLE + +endif # !CONFIG_BUILD_LOADABLE .install: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_install)