Quantcast
Channel: OS detecting makefile - Stack Overflow
Viewing all articles
Browse latest Browse all 15

Answer by Sean for OS detecting makefile

$
0
0

Another way to do this is by using a "configure" script. If you are already using one with your makefile, you can use a combination of uname and sed to get things to work out. First, in your script, do:

UNAME=uname

Then, in order to put this in your Makefile, start out with Makefile.in which should have something like

UNAME=@@UNAME@@

in it.

Use the following sed command in your configure script after the UNAME=uname bit.

sed -e "s|@@UNAME@@|$UNAME|"< Makefile.in > Makefile

Now your makefile should have UNAME defined as desired. If/elif/else statements are all that's left!


Viewing all articles
Browse latest Browse all 15

Trending Articles