For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > August 2007 > Problem using 'make'









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Problem using 'make'
chr.ott@gmx.li

2007-08-30, 8:07 am

Hello,

I have a weird problem using 'make'. When I try to compile using an
(automatically generated) makefile, I get some error messages like the
following:

----------------------------------------------------------------------------------------[color=darkred]
cc -c <-- skipped --> rtw_test.c
/tmp/ccrai8yi.s: Assembler messages:
/tmp/ccrai8yi.s:120: Error: suffix or operands invalid for `push'
/tmp/ccrai8yi.s:122: Error: suffix or operands invalid for `push'
/tmp/ccrai8yi.s:123: Error: suffix or operands invalid for `push'
-----------------------------------------------------------------------------------------

However, when I copy the command "cc -c <-- skipped --> rtw_test.c"
manually into a shell it works without errors!

Any ideas what's going on? I would be happy about any suggestions.
PS: I already tried to specify a different shell within the makefile
(using SHELL=/bin/bash, etc ...), but this did not solve the
problem.

regards,
christian

Gianni Mariani

2007-08-30, 8:07 am

chr.ott@gmx.li wrote:
> Hello,
>
> I have a weird problem using 'make'. When I try to compile using an
> (automatically generated) makefile, I get some error messages like the
> following:
>
> ----------------------------------------------------------------------------------------
> cc -c <-- skipped --> rtw_test.c
> /tmp/ccrai8yi.s: Assembler messages:
> /tmp/ccrai8yi.s:120: Error: suffix or operands invalid for `push'
> /tmp/ccrai8yi.s:122: Error: suffix or operands invalid for `push'
> /tmp/ccrai8yi.s:123: Error: suffix or operands invalid for `push'
> -----------------------------------------------------------------------------------------
>
> However, when I copy the command "cc -c <-- skipped --> rtw_test.c"
> manually into a shell it works without errors!
>
> Any ideas what's going on? I would be happy about any suggestions.
> PS: I already tried to specify a different shell within the makefile
> (using SHELL=/bin/bash, etc ...), but this did not solve the
> problem.
>


This is probably due to misconfiguration. Environment variables (like
PATH) can be changed in a Makefile.

Henry Townsend

2007-08-30, 8:07 am

chr.ott@gmx.li wrote:
> Hello,
>
> I have a weird problem using 'make'. When I try to compile using an
> (automatically generated) makefile, I get some error messages like the
> following:
>
> ----------------------------------------------------------------------------------------
> cc -c <-- skipped --> rtw_test.c
> /tmp/ccrai8yi.s: Assembler messages:
> /tmp/ccrai8yi.s:120: Error: suffix or operands invalid for `push'
> /tmp/ccrai8yi.s:122: Error: suffix or operands invalid for `push'
> /tmp/ccrai8yi.s:123: Error: suffix or operands invalid for `push'
> -----------------------------------------------------------------------------------------
>
> However, when I copy the command "cc -c <-- skipped --> rtw_test.c"
> manually into a shell it works without errors!
>
> Any ideas what's going on? I would be happy about any suggestions.
> PS: I already tried to specify a different shell within the makefile
> (using SHELL=/bin/bash, etc ...), but this did not solve the
> problem.


General makefile-debugging technique: take the part that says something like

bar.o: bar.c
cc -c bar.c

and change it to

bar.o: bar.c
@echo cc -c bar.c
@$(SHELL)

Now when you run make you will find yourself in an interactive shell
with the same environment the compiler runs in. Cut and paste the
compile line into this shell; it will fail. Debug it within the new
shell env.

Most likely it's confusion between two different versions of 'as'.
chr.ott@gmx.li

2007-08-31, 5:19 am

Dear Henry and Gianni,

Thank you very much! The difference was indeed the use of two
different versions of 'as'.

PS: The 'makefile-debugging technique' helped a lot!

christian

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com