# SDCC makefile problem

**URL:** <https://forums.freertos.org/t/sdcc-makefile-problem/4589>\
**Category:** Kernel\
**Created:** [February 23, 2006, 5:17pm UTC](https://forums.freertos.org/t/sdcc-makefile-problem/4589 "2006-02-23T17:17:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [February 23, 2006, 5:17pm UTC](https://forums.freertos.org/t/sdcc-makefile-problem/4589/1 "2006-02-23T17:17:51Z")

</div>

**nobody** wrote on [Thursday, February 23, 2006](https://sourceforge.net/p/freertos/discussion/382005/thread/ca6aa720/#d096):

I am trying to use the "FREERTOS" of yours in my project. I am want to use it on the Analog Devices ADUC845 microcontroller which has 2k of RAM built in and 62k of flash memory. I am using SDCC as my compiler.  
The problem that I am facing right now is that SDCC compiles the code written by me but the linker shows warnings of Undefined GLobal variables. now these variables are the functions used in the RTOS.  
Say for example: we use TaskCreate(…) and the ASLINK shows warning as \_TaskCreate as undefined Global Variable.  
and another thing to be noticed is that code and the DEMO files given by you compile with no error or any warning as such.Whenever I try to modify the makefile for my application these warnings are displayed.  
MY Makefile looks as follows:

CC=sdcc  
NO\_OPT=–nogcse --noinvariant --noinduction --nojtbound --noloopreverse --nolabelopt --nooverlay --peep-asm  
DEBUG=–debug

CFLAGS=–model-large -I. -I…/Common/include -I…/include -I…/…/Source/include   
-DSDCC\_CYGNAL $(DEBUG) --less-pedantic --xram-size 2303 --stack-auto   
–no-peep --int-long-reent --float-reent

#DEMO\_DIR = …/Common  
SOURCE\_DIR = …/…/Source  
PORT\_DIR = …/…/Source/portable/SDCC/Cygnal

SRC =   
keby/keyb.c   
#ParTest/ParTest.c   
#serial/serial.c   
#$(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

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

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) $\<

//===================================================================  
here keyb.c is my own code and Main.c is also written by me in same folders as shown in makefile.My code does compile without any warnings if i compile it with your DEMO files when uncommented in the Makefile.So what do you think is the solution to this?

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [February 23, 2006, 5:20pm UTC](https://forums.freertos.org/t/sdcc-makefile-problem/4589/2 "2006-02-23T17:20:41Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Thursday, February 23, 2006](https://sourceforge.net/p/freertos/discussion/382005/thread/ca6aa720/#d096/765b):

Can you see the tasks.c file being compiled?&nbsp; Are the intermediate files generated for tasks.c?&nbsp; If tasks.c is not being compiled try rearranging the list of files in the makefile so that the commented out files are at the end of the list.

SRC =   
keby/keyb.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   
#$(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 \

2K of RAM is very little.

Regards.
