Facing problem with "make"

brishak wrote on Friday, September 28, 2007:

Hi

I am using the FreeRTOS 8051 port with SDCC and make utility from http://unxutils.sourceforge.net/.

When I type make in the …\Demo\Cygnal directory I get the following error. Could anyone please clarrify how to build the project.

Error

sdcc -c --model-large -I. -I…/Common/include -I…/include -I…/…/Source/includ
e -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --stack-auto --no-peep
–int-long-reent --float-reent ParTest/ParTest.c
process_begin: CreateProcess((null), sdcc -c --model-large -I. -I…/Common/inclu
de -I…/include -I…/…/Source/include -DSDCC_CYGNAL --debug --less-pedantic --x
ram-size 8448 --stack-auto --no-peep --int-long-reent --float-reent ParTest/ParT
est.c, …) failed.
make (e=2): The system cannot find the file specified.
make: *** [ParTest/ParTest.rel] Error 2

Thanks

rtel wrote on Friday, September 28, 2007:

I have just tired doing the same with UnxTools make and here is my output:

C:\Temp\452_again\FreeRTOS\Demo\Cygnal>make
sdcc -c --model-large -I. -I…/Common/include -I…/include -I…/…/Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent ParTest/ParTest.c
sdcc -c --model-large -I. -I…/Common/include -I…/include -I…/…/Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent serial/serial.c
sdcc -c --model-large -I. -I…/Common/include -I…/include -I…/…/Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent …/Common/Full/flash.c
sdcc -c --model-large -I. -I…/Common/include -I…/include -I…/…/Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent …/Common/Full/print.c
sdcc -c --model-large -I. -I…/Common/include -I…/include -I…/…/Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent …/Common/Minimal/integer.c
sdcc -c --model-large -I. -I…/Common/include -I…/include -I…/…/Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent …/Common/Minimal/PollQ.c
sdcc -c --model-large -I. -I…/Common/include -I…/include -I…/…/Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent …/Common/Minimal/comtest.c
sdcc -c --model-large -I. -I…/Common/include -I…/include -I…/…/Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent …/Common/Full/semtest.c
sdcc -c --model-large -I. -I…/Common/include -I…/include -I…/…/Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent …/…/Source/tasks.c
sdcc -c --model-large -I. -I…/Common/include -I…/include -I…/…/Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent …/…/Source/queue.c
sdcc -c --model-large -I. -I…/Common/include -I…/include -I…/…/Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent …/…/Source/list.c
sdcc -c --model-large -I. -I…/Common/include -I…/include -I…/…/Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent …/…/Source/portable/MemMang/heap_1.c
sdcc -c --model-large -I. -I…/Common/include -I…/include -I…/…/Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --s
tack-auto --no-peep --int-long-reent --float-reent …/…/Source/portable/SDCC/Cygnal/port.c
sdcc --model-large -I. -I…/Common/include -I…/include -I…/…/Source/include -DSDCC_CYGNAL --debug --less-pedantic --xram-size 8448 --stac
k-auto --no-peep --int-long-reent --float-reent main.c ParTest/ParTest.rel serial/serial.rel …/Common/Full/flash.rel …/Common/Full/print.r
el …/Common/Minimal/integer.rel …/Common/Minimal/PollQ.rel …/Common/Minimal/comtest.rel …/Common/Full/semtest.rel …/…/Source/tasks.rel
…/…/Source/queue.rel …/…/Source/list.rel …/…/Source/portable/MemMang/heap_1.rel …/…/Source/portable/SDCC/Cygnal/port.rel

I have seen the CreateProcess((null) problem in the GCC MSP430 port where the Cygwin.dll file was an incorrect version and not compatible with the GCC build version.

Does SDCC make use of Cygwin?  If so, how many copies of Cygwin.dll are on your machine?  Is the correct one being used?

Regards.

brishak wrote on Saturday, September 29, 2007:

Hi Richard

There are no Cygwin.dll in my machine and i dont know if Cygwin is required by SDCC.
I am able to compile individual c files with SDCC.

jwestmoreland wrote on Sunday, September 30, 2007:

Brishak,

SDCC and the unxtools do not need Cygwin.dll to work.

I had the same problem as you did in trying to rebuild the 8051 port.  That error message means the *.rel files are not
being found by the linker.

A way to get around this is to use the commented part of the makefile:

######################################
# THIS VERSION WILL ONLY BUILD FILES THAT HAVE CHANGED, BUT MAY HAVE A DANGEROUS
# COMMAND LINE.  IT WORKS FINE UNDER WINDOWS, BUT I HAVE COMMENTED IT OUT IN
# CASE IT CAUSES PROBLEMS ON OTHER SYSTEMS.

main : main.c Makefile …/…/Source/portable/SDCC/Cygnal/portmacro.h $(OBJ)
        $(CC) $(CFLAGS) main.c $(OBJ)

%.rel : %.c Makefile …/…/Source/portable/SDCC/Cygnal/portmacro.h
        $(CC) -c $(CFLAGS) -o$< $<

######################################
# INSTEAD OF THE FOUR LINES ABOVE, THIS VERSION CAN BE USED BUT WILL CAUSE ALL
# FILES TO BUILD EVERY TIME.

# main : main.c Makefile …/…/Source/portable/SDCC/Cygnal/portmacro.h $(OBJ)
#       $(CC) $(CFLAGS) main.c $(OBJ)

# %.rel : %.c Makefile …/…/Source/portable/SDCC/Cygnal/portmacro.h
#       $(CC) -c $(CFLAGS) $<

The latter version causes (at least on my machine) to have all of the *.rel files to be in the directory in which make was invoked - but the linker looks for the *.rel files in the respective directories.  You can either use the ‘first’ version above - or you can compile all of your *.rel files and then manually copy them into the respective directories - e.g. - copy serial.rel to .\serial (provided you’re in the …\demo\cygnal directory when you compile.

Don’t forget to look in the main.mem file to see where to adjust configSTACK_START - on my build - I had to fix this to 0x22.
Also - make sure all of the tools are in your path.  I also had to add this to my makefile:

–lib-path c:/sdcc/lib/large to CFLAGS in the makefile so it would find the correct libs.

HTH,

John W.

brishak wrote on Sunday, September 30, 2007:

Hi John

I used the commented part of the make file. The problem still remains the same.

First of all .rel files are not generated when i type "make" in Demo\Cygnal directory

Regards,
Brishak

jwestmoreland wrote on Sunday, September 30, 2007:

Brishak,

Where are your *.rel files being placed then?

Or - are you saying the *.rel files are never being made?

Regards,
John

brishak wrote on Monday, October 01, 2007:

Hi John,
Yes, *.rel files are not made.
I just get the above error (as in my first post) and no files are generated.

Regards,
Brishak

jwestmoreland wrote on Monday, October 01, 2007:

Brishak,

Try the following - it builds the files for me.  If it doesn’t work for you - then I have to conclude you are not following the instructions on http://www.freertos.org/portcygn.html

#       FreeRTOS.org V4.5.0 - Copyright (C) 2003-2007 Richard Barry.
#
#       This file is part of the FreeRTOS.org distribution.
#
#       FreeRTOS.org is free software; you can redistribute it and/or modify
#       it under the terms of the GNU General Public License as published by
#       the Free Software Foundation; either version 2 of the License, or
#       (at your option) any later version.
#
#       FreeRTOS.org is distributed in the hope that it will be useful,
#       but WITHOUT ANY WARRANTY; without even the implied warranty of
#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#       GNU General Public License for more details.
#
#       You should have received a copy of the GNU General Public License
#       along with FreeRTOS.org; if not, write to the Free Software
#       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  US
A
#
#       A special exception to the GPL can be applied should you wish to distrib
ute
#       a combined work that includes FreeRTOS.org, without being obliged to pro
vide
#       the source code for any proprietary components.  See the licensing secti
on
#       of http://www.FreeRTOS.org for full details of how and when the exceptio
n
#       can be applied.
#
#       ************************************************************************
***
#       See http://www.FreeRTOS.org for documentation, latest information, licen
se
#       and contact details.  Please ensure to read the configuration and releva
nt
#       port sections of the online documentation.
#       ************************************************************************
***

CC=sdcc
NO_OPT=–nogcse --noinvariant --noinduction --nojtbound --noloopreverse --nolabe
lopt --nooverlay --peep-asm
DEBUG=–debug

CFLAGS=–model-large -I. -I…/Common/include -I…/include -I…/…/Source/include

                -DSDCC_CYGNAL $(DEBUG) --less-pedantic --xram-size 8448 --stack-
auto
                --no-peep --int-long-reent --float-reent --lib-path c:/sdcc/lib/
large
LFLAGS= --lib-path c:/sdcc/lib/large

DEMO_DIR = …/Common
SOURCE_DIR = …/…/Source
PORT_DIR = …/…/Source/portable/SDCC/Cygnal

SRC     =
$(DEMO_DIR)/Full/flash.c
$(DEMO_DIR)/Full/print.c
$(DEMO_DIR)/Minimal/integer.c
$(DEMO_DIR)/Minimal/PollQ.c
$(DEMO_DIR)/Minimal/comtest.c
$(DEMO_DIR)/Full/semtest.c
$(SOURCE_DIR)/tasks.c
$(SOURCE_DIR)/queue.c
$(SOURCE_DIR)/list.c
$(SOURCE_DIR)/portable/MemMang/heap_1.c
$(PORT_DIR)/port.c
ParTest/ParTest.c
serial/serial.c

# Define all object files.
OBJ = $(SRC:.c=.rel)

######################################
# THIS VERSION WILL ONLY BUILD FILES THAT HAVE CHANGED, BUT MAY HAVE A DANGEROUS

# COMMAND LINE.  IT WORKS FINE UNDER WINDOWS, BUT I HAVE COMMENTED IT OUT IN
# CASE IT CAUSES PROBLEMS ON OTHER SYSTEMS.

main : main.c Makefile …/…/Source/portable/SDCC/Cygnal/portmacro.h $(OBJ)
        $(CC) $(CFLAGS) main.c $(OBJ)

%.rel : %.c Makefile …/…/Source/portable/SDCC/Cygnal/portmacro.h
        $(CC) -c $(CFLAGS) -o$< $<

######################################
# INSTEAD OF THE FOUR LINES ABOVE, THIS VERSION CAN BE USED BUT WILL CAUSE ALL
# FILES TO BUILD EVERY TIME.

# main : main.c Makefile …/…/Source/portable/SDCC/Cygnal/portmacro.h $(OBJ)
#       $(CC) $(CFLAGS) main.c $(OBJ)

# %.rel : %.c Makefile …/…/Source/portable/SDCC/Cygnal/portmacro.h
#       $(CC) -c $(CFLAGS) $<

# end of makefile

You may have to fix-up the formatting - I didn’t see any way to make an attachment to this post.

Regards,
John

brishak wrote on Tuesday, October 02, 2007:

Hi John

I used the makefile posted by you. I get "missing separator" error in many lines.
Can you forward that file to my email id.

My email id is
xxxx@xxxx.com

Regards,
Brishak

jwestmoreland wrote on Tuesday, October 02, 2007:

Brishak,

Just sent it.

Regards,
John W.

brishak wrote on Tuesday, October 02, 2007:

Hi John,

I’m sorry… Again i get the same error.

First i tell you what all i did…

1. I downloaded sdcc-2.7.0-setup and intalled it. (I compiled many C files using this SDCC before)

2. Then i downloaded UnxUtils and saved it in C: (I set the path using the following command
D:&gt;path %path%;C:\UnxUtils\usr\local\wbin
Is that ok)

3.Then I downloaded FreeRTOS4.5.0 and unzipped it in D:

4.Then i go to D:\FreeRTOS\Demo\Cygnal and type make, I get the same error. Then i used your make file, the error is same but the file name is different.

After this i could now move forward…

Now can you guess what should be done…

Regards,
Brishak

sotd wrote on Tuesday, October 02, 2007:

How many versions of make.exe do you have on your computer?  I suspect you are using the wrong one.  If you have which installed try typing "which make" to see which one you are actually invoking.  Otherwise, try renaming your copy of make.exe within the unxtools directory so it will not get invoked, then try typing "make" to see if there is still a make executable within your path.

brishak wrote on Thursday, October 04, 2007:

Hi,

There is only one make file in my system. When i type "which make" it displays the message shown below…

D:\FreeRTOS\Demo\Cygnal>which make
which: no make in (C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\Pr
ogram Files\ATI Technologies\ATI.ACE;C:\Program Files\QuickTime\QTSystem;c:\al
tera\71\quartus\bin;C:\altera\71\modelsim_ae\win32aloem;C:\WINDOWS\system32;C:\W
INDOWS;C:\WINDOWS\System32\Wbem;c:\Program Files\ATI Technologies\ATI.ACE;C:\Pr
ogram Files\QuickTime\QTSystem;c:\altera\71\quartus\bin;C:\Program Files\SDCC\b
in;C:\UnxUtils\usr\local\wbin)

If i rename that make file, no make is invoked

Regards,
Brishak

jwestmoreland wrote on Thursday, October 04, 2007:

Brishak,

Move your tools to a dir that doesn’t have any spaces - your SDCC dir is in c:\Program <space> Files\SDCC…

I’ve seen strange behaviour in the past with GNU based tools and spaces in the paths.  This may not be the issue 100% but
it’s worth doing.

It probably would be a good idea to place the tools at the beginning of your path instead of the end also -
set path=c:\SDCC\bin;c:\UnxUtils\usr\local\bin;%path%

HTH,
John W.

brishak wrote on Thursday, October 04, 2007:

Hi John

I did… but no use…
The status is same…

Regards
Brishak

jwestmoreland wrote on Thursday, October 04, 2007:

Brishak,

At this point - I’d say try the following - keeping in mind all that has been discussed to this point -

uninstall all of the tools - everything that is related to the build - and do a complete reinstall.  If it doesn’t work
then - then the only choice you have is to try this all again on another machine.  If that still doesn’t help - ask someone
that is familiar with this type of work to sit down with you and get the build working.

HTH,
John W.

brishak wrote on Thursday, October 04, 2007:

OK

i’ll try to do and get back sometime later

Regards
Brishak