<div dir="ltr">Hi all,<div><br></div><div>Thanks for all the advice so far. </div><div><br></div><div>I spent quite a bit of time the other night working my way through all the RTEMS makefiles trying to understand how they all hang together.</div>
<div><br></div><div>I tried giving CPU_CFLAGS ago but that didn't work. So, after another look at the makefiles I tried CFLAGS_FOR_TARGET which was successful!</div><div><br></div><div>I'm guessing it's ok to abuse that variable like this?</div>
<div><br></div><div>Cheers,</div><div>James</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 31 January 2014 22:06, Ralf Kirchner <span dir="ltr"><<a href="mailto:ralf.kirchner@embedded-brains.de" target="_blank">ralf.kirchner@embedded-brains.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi James,<br>
For my current target CFLAGS get composed and passed to the compiler in<br>
<a href="http://bsp.mk" target="_blank">bsp.mk</a> which gets included over several stages from the application<br>
Makefile.<br>
I suppose for your BSP it will be similar.<br>
<br>
In my case the relevant part of the file looks like:<br>
...<br>
include $(RTEMS_ROOT)/make/custom/$(RTEMS_BSP).cfg<br>
<br>
DEPFLAGS = -MT $@ -MD -MP -MF $(basename $@).d<br>
SYSFLAGS = -B $(PROJECT_LIB) -specs bsp_specs -qrtems<br>
WARNFLAGS = -Wall -Wextra -Wformat=2 -Wcast-qual -Wconversion<br>
-Wno-unused-parameter<br>
OPTFLAGS = $(CFLAGS_OPTIMIZE_V)<br>
<br>
CFLAGS = $(DEPFLAGS) $(SYSFLAGS) $(WARNFLAGS) $(CPU_CFLAGS) $(OPTFLAGS)<br>
CXXFLAGS = $(DEPFLAGS) $(SYSFLAGS) $(WARNFLAGS) $(CPU_CFLAGS) $(OPTFLAGS)<br>
LINKFLAGS = $(SYSFLAGS) $(CPU_CFLAGS) $(LDFLAGS) $(OPTFLAGS)<br>
ASFLAGS = $(CPU_CFLAGS)<br>
<br>
CCLINK = $(CC) $(LINKFLAGS) -Wl,-Map,$(basename $@).map<br>
CXXLINK = $(CXX) $(LINKFLAGS) -Wl,-Map,$(basename $@).map<br>
<br>
$(BUILDDIR)/%.o: %.c<br>
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@<br>
..<br>
<br>
Thus apending your include files to CFLAGS won't work. I am not sure if<br>
that would work but you might give CPU_CFLAGS a try instead.<br>
<br>
<br>
Am 30.01.2014 11:19, schrieb James Fitzsimons:<br>
<div><div class="h5">> I tried CFLAGS as suggested and it seems to be completely ignored. My<br>
> application Makefile now looks like this:<br>
><br>
> PGM=${ARCH}/rtems-hello.exe<br>
><br>
> # optional managers required<br>
> MANAGERS=all<br>
><br>
> # C source names<br>
> CSRCS = rtems-hello.c<br>
> COBJS = $(CSRCS:%.c=${ARCH}/%.o)<br>
> CFLAGS += -I/home/james/Projects/development/motorobots/include<br>
><br>
> MOTOROBOTS_LIBS = /opt/motorobots/68332/lib<br>
> #LD_PATHS +=<br>
> LD_LIBS += $(MOTOROBOTS_LIBS)/liblcd.a $(MOTOROBOTS_LIBS)/libled.a<br>
><br>
> include $(RTEMS_MAKEFILE_PATH)/Makefile.inc<br>
> include $(RTEMS_CUSTOM)<br>
> include $(PROJECT_ROOT)/make/leaf.cfg<br>
><br>
> OBJS= $(COBJS) $(CXXOBJS) $(ASOBJS)<br>
><br>
> all: ${ARCH} $(PGM)<br>
><br>
> $(PGM): $(OBJS) ${LINK_FILES}<br>
> $(make-exe)<br>
><br>
> and running make looks like:<br>
><br>
> hello$ make<br>
> test -d o-optimize || mkdir o-optimize<br>
> m68k-rtems4.10-gcc --pipe<br>
> -B/home/james/Projects/development/rtems/rtems-mrm332/m68k-rtems4.10/mrm332/lib/<br>
> -specs bsp_specs -qrtems -g -Wall -O2 -g -fomit-frame-pointer -g<br>
> -mcpu=cpu32 -c -o o-optimize/rtems-hello.o rtems-hello.c<br>
> rtems-hello.c:6:27: error: 68332/mrm/led.h: No such file or directory<br>
> rtems-hello.c:7:27: error: 68332/mrm/lcd.h: No such file or directory<br>
> ....<br>
><br>
><br>
> As you can see the include path doesn't appear in the gcc command.<br>
><br>
> I've read the make/README and can't see anything relavant in there. Am I<br>
> missing something really obvious here?<br>
><br>
> Thanks for any help you can provide!<br>
> James<br>
><br>
><br>
> On 30 January 2014 13:38, James Fitzsimons <<a href="mailto:james.fitzsimons@gmail.com">james.fitzsimons@gmail.com</a><br>
</div></div><div class="im">> <mailto:<a href="mailto:james.fitzsimons@gmail.com">james.fitzsimons@gmail.com</a>>> wrote:<br>
><br>
> Thanks very much guys,<br>
><br>
> I'm thought I'd tried CFLAGS, but I obviously didn't have something<br>
> quite right so I'll give it another shot.<br>
><br>
> I'll definitely look into Eclipse - I've used it before for C/C++<br>
> stuff and found it excellent. I'm trying to start out pretty vanilla<br>
> with RTEMS just so I get a really good handle on how the whole build<br>
> process works (there are a LOT of makefiles to understand) as I've<br>
> found with other tools that an IDE can often make things nice and<br>
> easy until it goes wrong, and if you don't understand what it's<br>
> doing under the hood you are all of a sudden in very deep water.<br>
><br>
> Cheers!<br>
> James<br>
><br>
><br>
> On 30 January 2014 12:53, Simon Williams <<a href="mailto:williamssimonp@gmail.com">williamssimonp@gmail.com</a><br>
</div><div class="im">> <mailto:<a href="mailto:williamssimonp@gmail.com">williamssimonp@gmail.com</a>>> wrote:<br>
><br>
> Ah, -I and CFLAGS it is then. That'll teach me to read posts<br>
> properly and not just skim them! :-)<br>
><br>
> I started using Eclipse for Java, but I moved to using Netbeans<br>
> as I prefer it, but Eclipse with CDT is a grest C/C++ IDE and<br>
> the RTEMS plug in makes RTEMS development more productive than<br>
> vi. I don't really know of an alternative iif you want an IDE<br>
> for RTEMS, but that may be just because I've not looked.<br>
><br>
> Regards<br>
><br>
> Simon<br>
><br>
> On 29 Jan 2014 23:36, "Nick Withers" <<a href="mailto:nick.withers@anu.edu.au">nick.withers@anu.edu.au</a><br>
</div><div class="im">> <mailto:<a href="mailto:nick.withers@anu.edu.au">nick.withers@anu.edu.au</a>>> wrote:<br>
><br>
> On Wed, 2014-01-29 at 23:31 +0000, Simon Williams wrote:<br>
> > Wouldn't thst be -L for the lbrary path? The -l option is<br>
> usef to<br>
> > specify a library.<br>
> ><br>
> > Also, linker flags are usually in LDFLAGS, CFLAGS is for<br>
> compiler<br>
> > flags. It does of course depend on your Makefile.<br>
><br>
> It's include paths he's after, which are for the compiler.<br>
><br>
> > I would recommend Eclipse. It won't do everything for you,<br>
> but it can<br>
> > help by pointing the way!<br>
><br>
> I've heard a lot of good things about Eclipse. I've got a<br>
> personal peeve<br>
> against Java and that's really all that's kept me from<br>
> trying it!<br>
><br>
> > Regards<br>
> ><br>
> > Simon<br>
> ><br>
> > On 29 Jan 2014 22:18, "Nick Withers"<br>
</div>> <<a href="mailto:nick.withers@anu.edu.au">nick.withers@anu.edu.au</a> <mailto:<a href="mailto:nick.withers@anu.edu.au">nick.withers@anu.edu.au</a>>><br>
<div><div class="h5">> wrote:<br>
> > On Wed, 2014-01-29 at 22:29 +1300, James<br>
> Fitzsimons wrote:<br>
> > > Thanks Andrei,<br>
> > ><br>
> > ><br>
> > > I'm using a very plain vanilla environment at<br>
> the moment.<br>
> > Ubuntu 13.10<br>
> > > with tool chain built using rtems source builder.<br>
> > ><br>
> > ><br>
> > > I'm using the template makefile for my test<br>
> application, and<br>
> > am just<br>
> > > running make directly from bash.<br>
> > ><br>
> > ><br>
> > > No IDE or fancy build environment yet!<br>
> ><br>
> > I'd've said the RTEMS'provided Makefiles (there<br>
> are a number<br>
> > of them,<br>
> > chained together) are pretty fancy... But then, I<br>
> have trouble<br>
> > with just<br>
> > one Makefile :-P<br>
> ><br>
> > Anyway, try:<br>
> > CFLAGS+=-I/bam/headers<br>
> ><br>
> > > Cheers,<br>
> > > James<br>
> > ><br>
> > ><br>
> > > On 29 January 2014 17:01, Andrei Chichak<br>
</div></div>> <<a href="mailto:groups@chichak.ca">groups@chichak.ca</a> <mailto:<a href="mailto:groups@chichak.ca">groups@chichak.ca</a>>><br>
<div class="im">> > wrote:<br>
> > > I believe what Sebastian is referring to<br>
> is the<br>
> > environment<br>
> > > that you are using for your compiles. In<br>
> my case, I<br>
> > am using a<br>
> > > Mac and Eclipse, I set <C/C++<br>
> Build><Settings><Tool<br>
> > > Settings><RTEMS C<br>
> Compiler><Preprocessor><Include<br>
> > Paths (-I)>.<br>
> > ><br>
> > > Your milage will vary, but if you tell<br>
> us what you<br>
> > are<br>
> > > driving, there may be someone here that<br>
> can help.<br>
> > ><br>
> > > Andrei<br>
> > ><br>
> > ><br>
> > > On 2014-January-28, at 2:11 PM, James<br>
> Fitzsimons<br>
> > > <<a href="mailto:james.fitzsimons@gmail.com">james.fitzsimons@gmail.com</a><br>
</div><div><div class="h5">> <mailto:<a href="mailto:james.fitzsimons@gmail.com">james.fitzsimons@gmail.com</a>>> wrote:<br>
> > ><br>
> > > > Hi Sebastian,<br>
> > > ><br>
> > > > Thanks for your reply.<br>
> > > ><br>
> > > > Ideally I was hoping to us the -I<br>
> option to<br>
> > specify the<br>
> > > header file location, I just can't quite<br>
> figure out<br>
> > where to<br>
> > > add that into the RTEMS makefile<br>
> structure. Looking<br>
> > at the<br>
> > > make/README I can see a good example of<br>
> how to link<br>
> > in other<br>
> > > libraries using LD_LIBS, but there's<br>
> nothing about<br>
> > including<br>
> > > other header files.<br>
> > > ><br>
> > > > Apologies if I am missing something<br>
> obvious!<br>
><br>
> --<br>
> Nick Withers<br>
><br>
> Embedded Systems Programmer<br>
> Department of Nuclear Physics, Research School of Physics<br>
> and Engineering<br>
> The Australian National University (CRICOS: 00120C)<br>
><br>
><br>
><br>
><br>
><br>
</div></div><div class="im">> _______________________________________________<br>
> rtems-users mailing list<br>
> <a href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a><br>
> <a href="http://www.rtems.org/mailman/listinfo/rtems-users" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-users</a><br>
><br>
<br>
<br>
--<br>
</div>--------------------------------------------<br>
Embedded Brains GmbH<br>
Ralf Kirchner Dornierstr. 4<br>
D-82178 Puchheim Germany<br>
email: <a href="mailto:ralf.kirchner@embedded-brains.de">ralf.kirchner@embedded-brains.de</a><br>
Phone: <a href="tel:%2B49-89-18%2094%20741-17" value="+4989189474117">+49-89-18 94 741-17</a><br>
Fax: <a href="tel:%2B49-89-18%2094%20741-08" value="+4989189474108">+49-89-18 94 741-08</a><br>
<div class="im HOEnZb"><br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
rtems-users mailing list<br>
<a href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a><br>
<a href="http://www.rtems.org/mailman/listinfo/rtems-users" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-users</a><br>
</div></div></blockquote></div><br></div>