Version: 4.0.0 (using KDE 4.4.2) OS: Linux When working on a custom makefile project, I notice that when invoking make, the working directory is set to ${HOME} instead of the Makefile's own location. This brings up all sorts of headaches on projects that rely on other directories which would be referenced as relative paths. This is a minor issue, but if the working directory was set to the Makefile's location or if the user had a chance to define the directory himself, kdevelop's usability would be much greater. Thanks. Reproducible: Always Steps to Reproduce: Have a Makefile with: WDIR:=$(shell pwd) all: echo ${WDIR} Actual Results: Invoking this makefile from kdevelop 4 from anywhere yelds the user home directory. Expected Results: Should print the same directory where make is located OS: Linux (x86_64) release 2.6.32-22-generic Compiler: cc
Actually that is not the case. The custom makefile manager returns the folder of the project or the parent folder of the current item (if the item is not a folder itself). The item it gets as input is whatever is to be built (usually whats in the project selection). So what is in your project selection? Where is your project directory?
Using KDE 4.3.0: 1. Create a project with the following Makefile. == Makefile =========== build : echo $(PWD) ======================= 2. Right click "build" target and add to build set. 3. Build (F8 by default). 4. I receive the following wrong output. == Output ============= /home/john/projects/pwd_test_project/> make echo /home/john /home/john *** Finished *** ======================= 5 Run the same from the command line and get the following correct output: == Commandline ======== [john@ALAP pwd_test_project]$ make echo /home/john/projects/pwd_test_project /home/john/projects/pwd_test_project =======================
(In reply to comment #2) > Using KDE 4.3.0: I of course meant KDevelop 4.3.0 :-s
test case provided
still valid in 5.0, looking into it now
Git commit d28d5179632b42238fc0ac9a2d667082756f39e4 by Milian Wolff. Committed on 07/09/2016 at 21:40. Pushed by mwolff into branch '5.0'. Update PWD env var when setting working directory on execute jobs. We actually properly set the working directory, but when scripts rely on the PWD env var, and we don't update that, things can break. This patch simply updates the PWD env var if set before to the new working directory before running the job. M +8 -3 outputview/outputexecutejob.cpp http://commits.kde.org/kdevplatform/d28d5179632b42238fc0ac9a2d667082756f39e4