Make: conditional expressions

Make: conditional expressions

Post by Diego Gnesott » Wed, 25 Jul 2001 17:41:18



Hi,

I've written the following lines in a Makefile:

MAKE = make
CC = cc

# UNIX
ifeq "$OSTYPE" "hpux_9"
    LIBS = -ll -lc......
# LINUX
else
.....
endif
..

Obviously the OSTYPE variable is set.
I've tried to run the command 'make' on a HP-UX 10.20 platform but I got an
error message like this:
Make: Must be a separator on rules line nn.  Stop    (where nn line is LIBS
= -ll -lc ...)

Could anyone suggest me how can I write a conditional expression in a
Makefile?

Thank's for any help

Diego

 
 
 

Make: conditional expressions

Post by Jens.Toerr.. » Wed, 25 Jul 2001 18:53:44



> Hi,
> I've written the following lines in a Makefile:
> MAKE = make
> CC = cc
> # UNIX
> ifeq "$OSTYPE" "hpux_9"
>     LIBS = -ll -lc......
> # LINUX
> else
> .....
> endif
> ..
> Obviously the OSTYPE variable is set.
> I've tried to run the command 'make' on a HP-UX 10.20 platform but I got an
> error message like this:
> Make: Must be a separator on rules line nn.  Stop    (where nn line is LIBS
> = -ll -lc ...)
> Could anyone suggest me how can I write a conditional expression in a
> Makefile?

You better try something like

ifeq ($(shell echo $$OSTYPE),hpux_9)
    ....
endif
                                         Regards, Jens
--
      _  _____  _____

  _  | |  | |    | |          AG Moebius, Institut fuer Molekuelphysik
 | |_| |  | |    | |          Fachbereich Physik, Freie Universitaet Berlin
  \___/ens|_|homs|_|oerring   Tel: ++49 (0)30 838 - 53394 / FAX: - 56046

 
 
 

Make: conditional expressions

Post by Edmund Baco » Thu, 26 Jul 2001 10:41:00



> Hi,

> I've written the following lines in a Makefile:

> MAKE = make
> CC = cc

> # UNIX
> ifeq "$OSTYPE" "hpux_9"
>     LIBS = -ll -lc......
> # LINUX
> else
> .....
> endif
> ..

> Obviously the OSTYPE variable is set.
> I've tried to run the command 'make' on a HP-UX 10.20 platform but I got
> an error message like this:
> Make: Must be a separator on rules line nn.  Stop    (where nn line is
> LIBS = -ll -lc ...)

> Could anyone suggest me how can I write a conditional expression in a
> Makefile?

conditional expressions in a makefile are a gnu-ism.  To do this I am
fairly sure you will need to get a copy of gnu-make.  Wee www.gnu.org.
 
 
 

1. Conditional logging in Apache and regular expressions

Hi there,
I've been trying to set a custom log that will contain entries:
1. belonging ONLY to logged in users, when the REMOTE_USER environment
variable is set,
and
2. while omitting all jpg, gif, css files.
The second part is easy:

SetEnvIfNoCase Request_URI \.(gif|jpg|js|css)$ dontlog=1
CustomLog "|rotatelogs logs/my_log 86400" combined env=!dontlog

but the first part, well, I couldn't make it work.
In essence, I was not able to find the correct regexp indicating an
existing remote user.

Can anyone help me, please?

2. Trying to disable Keyboard Layouts Icon in the tray

3. How to use find with conditional expressions?

4. Overview of features and benchmarks?

5. Conditional expression errors

6. Iomega ZIP Plus on Kernel 2.4

7. conditional expression bafflingly doesn't work (sh-compatible shells)

8. Looking for linux drivers for MSI KT3 Ultra Promise Fast Track 133 Raid Controller

9. Regular expression in conditional question

10. conditional expressions [[ ]] vs. [ ]

11. Conditional expressions

12. Need to know correct syntax for conditional expression

13. Conditional expressions in KSH