Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!sri-spam!wohler
From: wohler@spam.istc.sri.com (Bill Wohler)
Newsgroups: comp.sys.hp
Subject: Re: problems with make
Message-ID: <12543@sri-spam.istc.sri.com>
Date: 11 May 88 19:56:50 GMT
References: <12407@sri-spam.istc.sri.com> <1250004@hpsemc.HP.COM>
Sender: nobody@sri-spam.istc.sri.com
Reply-To: wohler@spam.istc.sri.com (Bill Wohler)
Organization: SRI International
Lines: 49

In article <1250004@hpsemc.HP.COM> bd@hpsemc.HP.COM (bob desinger) writes:
>>   the hp9000s350 running 6.01 chokes on the following makefile fragment:

  [deleted]

>> the hp spits out:
>> 	Missing ].
>> 	*** Error code 1
>> 	Stop.

  turned out that the hp (system v?) make actually uses any shell to
  run your commands.  adding SHELL=/bin/sh to the makefile makes it
  work for both our systems.  thanks bob.

>As a workaround, can you use a `test' construct to replace the `if'
>with a one-liner?  Something to the effect of:
>
>	test "$(SYS)" != hp && ranlib $(LIBRARY)

  much cleaner.

>I doubt if the Sun has these System-V files, but you can create them
>with the commands:

  our makefiles also have to run on suns and hps all over the country
  and in europe.  no, i don't want to make this file everywhere.
  
>	  # Do conditional compilation from make's shell
>	  IFHP	= test ! -f /hp-ux ||
>	  IFSUN	= test ! -f /vmunix ||

  i like this a lot.  you can also get more refined by not looking at
  the kernel, but rather:

	IFHP300 = test ! -f /bin/hp9000s300
	IFSUN3 = test ! -f /bin/sun3
	IFBSD = test ! -f /vmunix
	IFHPUX = test ! -f /hp-ux

  and so on.

>By the way, your original makefile fragment works correctly on my
>hp9000s800 (running 2.0).

  because i bet you use ksh which knows about "]".  

  since you're thinking about makefiles now, how would you accomplish
  something like

							--bw