Operating System - HP-UX
1829924 Members
2643 Online
109997 Solutions
New Discussion

Too many command lines for 'Target'

 
SOLVED
Go to solution
Karl_BAG
Occasional Advisor

Too many command lines for 'Target'

We are porting from PA-RISC -> Itanium / HPUX11.11 -> HPUX11.31. When running our makefiles I get the message "Too many command lines for 'Target'. Compilation works fine (make -f makefile.mk binname.exe / clear / clean) but I'd really like to get rid of this warnings. My guess is, that it only occurs if the makefile executes some shell command lines (either to link *.h / *.c files to the working directory or to clean up the working directory after compiling -> see attached file). To be sure the problem is independent from the existing makefiles I also wrote a very short test makefile, where I still get the warning. Is there some syntax error and if, how can I fix it? (I don't get the message by using option1:: instead of option1: but then hello is printed twice).

 

Thanks Karl

 

 

 

test makefile: (make -f makefile.mk option1/option2)

option1:
    @echo "hello"

option2:
    @echo "how are you"

10 REPLIES 10
Dennis Handly
Acclaimed Contributor

Re: Too many command lines for 'Target'

I can't get any errors when I use your option1 option2 makefile.  What is the exact command you are using?

Karl_BAG
Occasional Advisor

Re: Too many command lines for 'Target'

I use "make -f makefile.mk option1", which leads to the following:


Neu-hpws1001(lka):VRZ=v3-28-0a_lka$ make -f makefile.mk option1
Too many command lines for `option1'
hello
Neu-hpws1001(lka):VRZ=v3-28-0a_lka$

 

 

 

 

Neu-hpws1001(lka):VRZ=v3-28-0a_lka$ uname -a
HP-UX hpws1001 B.11.31 U ia64 3480881845 unlimited-user license

Dennis Handly
Acclaimed Contributor

Re: Too many command lines for 'Target'

>I use "make -f makefile.mk option1", which leads to the following:

 

Please attach your small makefile.mk.

Also, what does this show: whence make

Karl_BAG
Occasional Advisor

Re: Too many command lines for 'Target'

Neu-hpws1001(lka):VRZ=v3-28-0a_lka$ whence make
make
Neu-hpws1001(lka):VRZ=v3-28-0a_lka$

Dennis Handly
Acclaimed Contributor

Re: Too many command lines for 'Target'

$ whence make
make

 

It appears you have your own version of make?  What does "whence -v make" show?

I have no problems with your makefile with HP-UX make or gmake.

Karl_BAG
Occasional Advisor

Re: Too many command lines for 'Target'

"It appears you have your own version of make?"
-> I'll check this with the guy who set up the system. And then I also gonna try "gmake" to check if there will be any problems with this.

 

for

$whence -v make

i get

make is a funcion

Dennis Handly
Acclaimed Contributor

Re: Too many command lines for 'Target'

>make is a function

 

Then you need to find that function in your .profile or in some other file sourced from there or from $ENV,

You could use /usr/bin/make.

Karl_BAG
Occasional Advisor

Re: Too many command lines for 'Target'

If I use "/usr/bin/make" no warning message is printed. I also tried to find a make-function, or some alias but couldn't find anything. But there must be some kind of configuration file where I can change/set some default options because I additional tried some different cases, where I get even more curios results:

 

 

$ whereis make
make: /usr/bin/make /usr/ccs/bin/make /usr/share/man/man1.Z/make.1
$

$ which make
/bin/make
$

$ ll /bin/make
lr-xr-xr-x   1 bin        bin             17 Jan 24  2011 /bin/make -> /usr/ccs/bin/make
$
$ ll /usr/bin/make
lr-xr-xr-x   1 bin        bin             17 Jan 24  2011 /usr/bin/make -> /usr/ccs/bin/make
$
$ ll /usr/ccs/bin/make
-r-xr-xr-x   1 bin        bin         303268 Feb 15  2007 /usr/ccs/bin/make


---------------------------------------------------------------------


$ ll
total 16
drwxr-xr-x   2 lka        users           96 Oct 12 15:16 .
drwxr-xr-x   5 lka        users           96 Oct 12 15:14 ..
-rwxr-xr-x   1 lka        users           95 Oct 12 15:24 makefile.mk
$
$ make optmake1
makefile.mk: Option - make1
$
$ /usr/bin/make optmake1
Make: Don't know how to make optmake1.  Stop.
$
$ make -f makefile.mk optmake1
Too many command lines for `optmake1'
makefile.mk: Option - make1
$
$ /usr/bin/make -f makefile.mk optmake1
makefile.mk: Option - make1
$


---------------------------------------------------------------------


$ ll
total 16
drwxr-xr-x   2 lka        users           96 Oct 12 15:29 .
drwxr-xr-x   5 lka        users           96 Oct 12 15:14 ..
-rwxr-xr-x   1 lka        users           83 Oct 12 15:29 xyz.mk
$
$ make optxyz1
Make: Cannot open makefile.mk.  Stop.
$
$ /usr/bin/make optxyz1
Make: Don't know how to make optxyz1.  Stop.
$
$ make -f xyz.mk optxyz1
Make: Cannot open makefile.mk.  Stop.
$
$ /usr/bin/make -f xyz.mk optxyz1
xyz.mk: Option - xyz1
$


---------------------------------------------------------------------


$ ll
total 32
drwxr-xr-x   2 lka        users           96 Oct 12 15:16 .
drwxr-xr-x   5 lka        users           96 Oct 12 15:14 ..
-rwxr-xr-x   1 lka        users           95 Oct 12 15:36 makefile.mk
-rwxr-xr-x   1 lka        users           83 Oct 12 15:36 xyz.mk
$
$ make optmake1
makefile.mk: Option - make1
$
$ make optxyz1
Make: Don't know how to make optxyz1.  Stop.
$
$ make -f makefile.mk optmake1
Too many command lines for `optmake1'
makefile.mk: Option - make1
$
$ make -f xyz.mk optxyz1
xyz.mk: Option - xyz1
$
$ make -f xyz.mk optmake1
makefile.mk: Option - make1
$
$ /usr/bin/make -f xyz.mk optxyz1
xyz.mk: Option - xyz1
$
$ /usr/bin/make -f xyz.mk optmake1
Make: Don't know how to make optmake1.  Stop.
$


---------------------------------------------------------------------


$ cat makefile.mk
optmake1:
        @echo "makefile.mk: Option - make1"
optmake2:
        @echo "makefile.mk: Option - make2"

$
$
$ cat xyz.mk
optxyz1:
        @echo "xyz.mk: Option - xyz1"
optxyz2:
        @echo "xyz.mk: Option - xyz2"

$

Dennis Handly
Acclaimed Contributor

Re: Too many command lines for 'Target'

>I also tried to find a make function, or some alias but couldn't find anything.

 

You need to look harder.  ;-)

If you want to give up, just do: unset -f make

 

>where I get even more curious results:

 

Nothing curious here.  It all points to your bad function make.

It looks like your make automatically adds: -f makefile.mk

So you have two -f options, which would explain your "Too many command lines"?

Karl_BAG
Occasional Advisor
Solution

Re: Too many command lines for 'Target'

We had to dig quite deep in the system this morning and finally got the bug caused by copying 15 year old config files / scripts into the new system. It turned to be an "alias", not shown if calling "$ alias" - and we guess it is because the "alias definition" of make is defined in a function in a script setting up the shell environment:

 

make()

{

  if [ -f "env.x" ]

  then

    . env.x

  fi

  /usr/bin/make -f makefile.mk ${*:-}

} # make

 

 

Thanks a lot for your help

Karl