run.mk: Clean up shortcut target

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2017-04-25 10:44:59 +00:00
commit 38ded5c4b1
2 changed files with 10 additions and 14 deletions

View file

@ -16,14 +16,15 @@ endif
ifneq ($(EXE_BASENAME),)
ifneq ($(TARGET),mingw)
EXE ?= $(EXE_BASENAME)
SHORTCUT_SCRIPT ?= ./run.sh
else
EXE ?= $(EXE_BASENAME).exe
SHORTCUT_SCRIPT ?= run.bat
endif
endif
EXE_PATH ?= ./$(EXE)
CHECK_CONF_EXE ?= $(firstword $(wildcard $(CVS_PROJ_DIR)/valdi/bin/checkconf) checkconf)
SHORTCUT_SCRIPT ?= ./run.sh
LOCAL_CFLAGS += -DEXE_NAME=\"$(EXE)\"
LOCAL_CPPFLAGS += -DEXE_NAME=\"$(EXE)\"
@ -58,11 +59,6 @@ start: run-prereq
@echo -e "set PATH=%PATH;$(DLL_PATH)\n" \
"$(EXE_PATH) $(EXE_ARGS)" | wine cmd &
clean: winrunclean
winrunclean:
rm -f start.bat
else
run test: run-prereq
rm -f core.*
@ -71,11 +67,16 @@ start: run-prereq
rm -f core.*
$(EXE_PATH) $(EXE_ARGS) &
shortcut: $(SHORTCUT_SCRIPT)
$(SHORTCUT_SCRIPT):
echo -e "#!/bin/bash\n\nexport LD_LIBRARY_PATH=$(LD_LIBRARY_PATH)\nexport PATH=$(PATH)\n$(EXE_PATH) $(EXE_ARGS)" > $@.tmp
ifeq ($(TARGET),mingw)
echo "set PATH=%PATH;$(DLL_PATH)" > $@.tmp
echo "$(EXE_PATH) $(EXE_ARGS)" >> $@.tmp
else
echo -e "#!/bin/bash\n\nrm -f core.*\nexport LD_LIBRARY_PATH=$(LD_LIBRARY_PATH)\nexport PATH=$(PATH)\n$(EXE_PATH) $(EXE_ARGS)" > $@.tmp
chmod 755 $@.tmp
endif
mv $@.tmp $@
shortcut: $(SHORTCUT_SCRIPT)
distclean.shortcut:
rm -f $(SHORTCUT_SCRIPT)
distclean: distclean.shortcut
@ -167,8 +168,3 @@ kcg:
clean: runclean localclean
start.bat:
echo "set PATH=%PATH;$(DLL_PATH)" > $@.tmp
echo "$(EXE_PATH) $(EXE_ARGS)" >> $@.tmp
mv $@.tmp $@