- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Make File Conditiona Compilation in HP UNIX
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-13-2008 11:59 PM
тАО03-13-2008 11:59 PM
Make File Conditiona Compilation in HP UNIX
I am trying to put a if condition in a Makefile.
The Makefile is as follows
HOSTNAME = `uname`
HP = HP-UX
all:TARGET
ifeq ($(HOSTNAME),$(HP))
echo $(HOSTNAME)
else
echo "NOT HP"
endif
If i try to make I get the following error message
Make: Must be a separator on rules line 7. Stop.
Can Someone correct me where i am going wrong.
thanks and regards
Vikram
- Tags:
- gmake
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2008 12:10 AM
тАО03-14-2008 12:10 AM
Re: Make File Conditiona Compilation in HP UNIX
You aren't using gmake:
http://hpux.cs.utah.edu/hppd/hpux/Gnu/make-3.81/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2008 01:14 AM
тАО03-15-2008 01:14 AM
Re: Make File Conditiona Compilation in HP UNIX
even with gmake, the character before your 'echo's must be a TAB, no spaces, because that's part of a makerule.
The result of 'make' after this correction will be the output
Don't know how to make 'TARGET'
when the above lines are your complete Makefile.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2008 03:43 AM
тАО03-15-2008 03:43 AM
Re: Make File Conditiona Compilation in HP UNIX
There was an error in my copy paste
The Makefile looks as below
HOSTNAME = `uname`
HP = HP-UX
all:TARGET
TARGET :
ifeq ($(HOSTNAME),$(HP))
echo $(HOSTNAME)
#uname
else
endif
and there is a tab fo rthe echo statement not spaces.
I am not using gmake i am using make. IS this not possible to achieve this through make.
thanks and regards
Vikram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2008 06:27 AM
тАО03-15-2008 06:27 AM
Re: Make File Conditiona Compilation in HP UNIX
Why not? What were you using (where) when
you created this "make" file? (For that
matter, it's just possible that knowing which
HP-UX you're using (hardware, version) might
be interesting, too.)
> IS this not possible to achieve this
> through make.
If "man make" doesn't mention conditionals
like "ifeq", then I'd assume that this "make"
program doesn't support them.
Depending on exactly what you wish to do
conditionally, it may be possible (if not
convenient) to devise more complex rules
which do (a lot of) "uname -s" testing to
decide what to do differently on different
host systems. If you need more complex
OS-dependency in the "make" file structure,
then you may need to use a "make" program
which allows it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-15-2008 12:49 PM
тАО03-15-2008 12:49 PM
Re: Make File Conditiona Compilation in HP UNIX
That's what I said. HP-UX's make doesn't support this.
>Steven: it's just possible that knowing which HP-UX you're using (hardware, version) might be interesting, too.)
Not in this case with make. :-(
>it may be possible (if not convenient) to devise more complex rules which do (a lot of) "uname -s" testing
Right but simpler to use a real make.