Sponsored Content
Top Forums Programming Detecting host OS in Gnu make Post 302253919 by spirtle on Monday 3rd of November 2008 05:20:13 AM
Old 11-03-2008
Perhaps use uname(1) to find out OS, e.g.
Code:
OS := $(shell uname -o)
ifeq $(OS) GNU/Linux
# set variables for Linux 
else
# check for other OSs and set variables appropriately
endif

You would need to check what uname gives you on each of your build platforms.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Problems with gnu make

I am running a make file through the gnu make tool and i am getting the following error jsh1035c:/users/egate453/admegate/kapil/samples $ make -f GNUmakefile queue_c make -f ./GNUmakefile queue_c in_objdir=1 build_root=/users/egate453/admegate/kapil/samples make: Entering directory... (2 Replies)
Discussion started by: handak9
2 Replies

2. UNIX for Dummies Questions & Answers

What's the difference between PMake and GNU Make?

My system is ubuntu, can I use PMake ? (0 Replies)
Discussion started by: meili100
0 Replies

3. SCO

GNU cpp and make on SCO

Installed GNU make and the GNU C/C++ compiler on SCO Openserver 5.0.7 recently. Only a normal user is able to run make and compile programs - root is not able to. Under root, make do run, but root can't access the compiler at all, even tho I set root's path to point to the compiler.... (0 Replies)
Discussion started by: The_Librarian
0 Replies

4. AIX

gnu make fir AIX 5.3 and gcc 3.3.2

Hi all i had installed gcc version 3.3.2 on my AIX 5.3 machine. which make utility i have to instal so it will fit the gcc version tnx skfn (2 Replies)
Discussion started by: skfn1203
2 Replies

5. AIX

Not picking up the GNU version of make

Hi team, I am new to unix,and need your advice on the below. I am using aix5.3 and have installed make-3.82 on the server. I need to use gmake for configuring and installing a package ,but it is giving error at the below root@sapsrp:/usr/tmp/xymon-4.3.2 # ./configure.server ... (7 Replies)
Discussion started by: sonal kumar
7 Replies

6. Shell Programming and Scripting

GNU make doesn't pick up changes

It's been a while since I had to write a Makefile, but I've managed to clobber this together: SRC=module1.c module2.c OBJS=$(SRC:%.c=%.o) HDR=include1.h include2.h CC=gcc CFLAGS=-Wall -ggdb -D_XOPEN_SOURCE -I. -ansi all: program program: $(OBJS) $(CC) $(CFLAGS) -o $@ $(OBJS) ... (3 Replies)
Discussion started by: pludi
3 Replies

7. Shell Programming and Scripting

extension building make GNU Linux

Hi, I do "touch poub.mlc" Download my Makefile, But when I try : make -f Makefile.txt(.txt in order my file to be accepted for upload), it says:"no rule for poub.mlo target" What is wrong in my Makefile(test yourself please before posting)? (1 Reply)
Discussion started by: synhedionn
1 Replies

8. OS X (Apple)

Alternatives to GNU Make for users of newer OS X

As you may already know, Apple has integrated all the GNU developer tools into their own graphical development environment so you can no longer use them from the command line. This means that open source software that is distributed as source is inaccessible to users of newer versions of Mac OS X,... (4 Replies)
Discussion started by: Ultrix
4 Replies

9. Programming

Gnu make: default values and conditionals

I need some help. I use variables and conditionals to build with or without specic libraries. I set USEAL ?= 1 # get value from cmd, defaults to 1 (see comment) the conditional is: ifeq ($(USEAL),1) LIBS = <any libs> else LIBS = endif Its amazing that this works when invoked... (4 Replies)
Discussion started by: dodona
4 Replies

10. UNIX for Advanced & Expert Users

I received a WARN when was configuring GNU make,

When I tried to configure GNU make, I received:... WARNING: Your system has neither waitpid() nor wait3(). Without one of these, signal handling is unreliable You should be aware that running GNU make with -j could result in erratic behavior. ... What is that supposed to mean ? my spec: ... (1 Reply)
Discussion started by: abdulbadii
1 Replies
uname(1)						      General Commands Manual							  uname(1)

NAME
uname - Displays information about the operating system SYNOPSIS
uname [-amnrsvp] uname [-S system-name] The uname command displays system information or sets the system name. STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: uname: XCU5.0, SVID 4 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
Displays all information specified with the -m, -n, -r, -s, and -v options. Displays the type of hardware running the system. Displays the name of the node (this may be a name that the system is known by to a communications network). [Tru64 UNIX] Displays the processor type of the current host. Displays the release number of the operating system. Displays the name of the implementation of the operating system. (This option is on by default.) [Tru64 UNIX] Changes the name of the system to system_name. The system_name argument is restricted to SYS_NMLN-1 characters. The value of SYS_NMLN is implementation specific and is defined in /usr/include/sys/utsname.h. Only users with appropriate privileges can use this option. Displays the operating system version. OPERANDS
None DESCRIPTION
The uname command writes system information to standard output. This command is used primarily to determine which system you are using. The options cause selected information returned by the uname() call to be displayed. NOTES
When the -a option is used, output is displayed in the order: <system> <node> <release> <version> <hardware> When you request information by specifying the individual options, the appropriate information is displayed in the order indicated. [Tru64 UNIX] If the -p option is used, processor information is appended to the output line. The output of uname may include embedded blank spaces, so you should use caution when passing the output to parsing algorithms. EXIT STATUS
The following exit values are returned: The requested information has been successfully written. An error occurred. EXAMPLES
To display the complete system name and version banner, enter: uname -a ENVIRONMENT VARIABLES
The following environment variables affect the execution of uname: Provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari- ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale for the for- mat and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MESSAGES. FILES
System name information header file. Node specific configuration file. SEE ALSO
Functions: uname(2) Standards: standards(5) uname(1)
All times are GMT -4. The time now is 01:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy