Makefiles in eclipse and their path - eclipse

I'm trying to build a project with a specific compiler in Eclipse, and I'm using a Makefile to do the dirty work -- only problem is that it seems as if Eclipse doesn't share the same paths as my bash sessions. I've set .bash_profile and .profile (apparently Mac likes .profile just as much as .bash_profile), but neither of the exports that I've included are getting picked up. Do I need to manually set some symlinks in my /usr/bin or something like that? Or is there a way to manually set paths in eclipse?

This is because .bash_profile and .profile are read by bash when session is started. So you need to change the build command to bash -l -c "make".

Edited the Makefile and just added the absolute path:
PATH = /Users/me/yagarto/yagarto-4.6.2/bin/
TRGT = $(PATH)arm-none-eabi-

Related

Mac OS: How do you fix a PATH to reach an executable file (in this case postgresql & netlify-cli) without messing up other paths?

In the mac terminal:
Does anyone know how to set the path variables for a Mac OS, without messing up other paths?
Current folder structure:
/
/Applications
/[a lot of applications]
/Postgres.app
/Contents
/Versions
/12
/bin
/psql
/Users
/userName
/Applications
/[nothing, except a couple hidden files]
Right now, if I run the command psql, I am getting:
command not found
If I type the full path:
/Applications/Postgres.app/Contents/Versions/12/bin/psql
it works, but typing this every time is not practical.
If I run git that command is available, or code .
Also, I installed netlify-cli globally with npm install -g netlify-cli, but when I run netlify-cli, I get:
command not found
and I don’t know where to find it in my system
… So, something is working correctly with my paths, and something is not. I don’t know how to fix the problem, without messing up other paths.
Does anyone know how I could find out where netlify-cli got installed and fix my paths to netlify-cli and psql without messing up any other paths?
For Mac OS to be able to find the psql executable, it has to be part of the PATH environment variable, you can check the value of that variable on your terminal with this command
echo $PATH
what you should do is add the psql executable to it, like this:
export PATH=/Applications/Postgres.app/Contents/Versions/12/bin/:$PATH
if that solves your problem, you can put that on your .zshrc or .bashrc to make it persistent

Using a sort of portable JDK on centOs

This is the first time that I use linux in my life, I'm a little bit strugling.
Permissions, user, folder structure, it's a lot to take in.
Everything I did, I did with the ATH user which is a regular non sudoer user.
I got Centos minimal and put it in a VM
then I extracted the linux tar.gz jdk in /home/ath/monitoring/jdk1.8.0_70_linux64
And I added this to a sh script, this sh script call other sh script
I want them to only use this jdk
below #!/bin/sh I added
export JAVA_HOME=/home/ath/monitoring/jdk1.8.0_70_linux64
However when I launch the script I get :
Which : no java in (/usr/local/bin:/usr/bin:usr/local/sbin:/usr/sbin:/home/ath.local/bin:/home/ath/bin)
Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME
What am I doing wrong?
Thanks
ps : I used (logged as root) chmod +x /home/ath/monitoring/elasticsearch/bin/elasticsearch/bin/elasticsearch.sh
on the sh script otherwhise it would not run
So I also had to add this line because the script was looking into PATH :
export JAVA_HOME PATH=$JAVA_HOME/bin:$PATH
And I had to render all the file in jdk/bin executable running this inside
chmod a+x *
I don't get it tho, each time I'm getting a software I have to manually go and chmod every file that need it? quite bothersome.

Can't get eclipse to run terminal command on mac

I have installed swig on my mac and it works in the console just fine. If I type swig -verison in terminal it spits out the version. Eclipse keeps telling me that it can't find swig. I am using the liquidfun library http://google.github.io/liquidfun/SWIG/html/index.html and it told me to put this export SWIG_BIN=$("which" swig) in .bashrc, which I did. This enviroment variable registers through terminal as well. Eclipse STILL won't grab swig properly. What the hell?
Bash reads .bash_profile, .bash_login or .profile. I don't expect the Eclipse process to load such a file (although I could be wrong) nor the SWIG_BIN variable to augment its search path for executables, but if you launch Eclipse from the shell, it should inherit the shell's environment variables.
Try running swig from eclipse using a full absolute path (the one that "which" returns).
The eclipse.ini file can set some startup parameters but perhaps not the path. There might be other eclipse startup files.
Another possibility is to add swig's directory to the path in a login script. (To test that, log out and back in, then start eclipse.)

Textmate doesn't recognize wget

Maybe stackoverflow is not for posting this kind of questions, and if it's that way, i apology..
I got a problem when using Textmate, it doesn't recognize wget, when i try to run wget from it, it says:
wget: command not found
The sh bundle is using the last version of ssh (the homebrew one, i set the TM_SHELL & SHELL manually) and everything so far seems to work (all other commands) but not wget, any clue?
Thanks in advance!
EDIT: I forgot to say, running wget from console works fine.
I guess wget is installed at /usr/local/bin via brew or something... By default, that directory is not in TextMates PATH environment variable.
You can extend the environment either by setting PATH to $PATH:/usr/local/bin under Preferences -> Variables or by setting
PATH = "$PATH:/usr/local/bin"
in your ~/.tm_properties file (That would /User/yourusername/.tm_properties, just in case you are not familiar with the "~" alias to your home directory).

Eclipse CDT created makefile cannot "clean" on Windows

I have a makefile project with makefiles generated by Eclipse CDT (Helios, MinGW). The "clean" command does not work because the "del" command is executed with arguments like ./src/myfile.o, but on Windows this doesn't work (should be .\src\myfile.o).
How can I either tell Eclipse to use the Windows Path Separator or otherwise maybe replace the command "del" by something different (I could easily write a batch script which replaces the forward-slashes by backslashes)?
Thanks for any hints!
There is simple solution, create a makefile.defs file in your project's main directory with the following content:
RM := rm -rf
Basically this file lets you override variables from auto-generated makefile and RM is wrapper for remove command.
The best option is to download and install GnuUtils http://sourceforge.net/projects/gnuwin32/files/coreutils/5.3.0/coreutils-5.3.0.exe/download
and add the installed directory (C:\ProgramFile???\GnuWin32\bin)to your windows path and restart eclipse.Eclipse should execute rm-rf now...if it still doesnt ...restart windows and check your path again to see if it has \GnuWin32\bin ...then restart eclipse...
in your msys bin directory (C:\msys\1.0\bin on my machine) create a copy of rm.exe and rename it del.exe.
this is a hack. i am not familiar with the differences between the rm and del arguments. the base functionality is there. (delete file1 file2 filen)
in windows there is no del.exe, the delete functionality is built into CMD.exe. eclipse runs the commands in the msys shell which does not have the del functionality. this prevents you from adding a path to eclipse in which to search for del.exe.
i tried many different things to get the managed make to put "RM := rm" in the makefile but failed.
Edit the makefiles to use the mingw rm command instead?
Before you rename rm.exe to del.exe, check the path in Eclipse. The path has to have Unix path separators (forward slash, /) and not the Windows path separator (backslash, \).
This has fixed the problem on my side.