From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Converting a simple makefile in a GPS project.
Date: Wed, 18 Apr 2012 08:49:23 -0400
Date: 2012-04-18T08:49:23-04:00 [thread overview]
Message-ID: <82bompjjcc.fsf@stephe-leake.org> (raw)
In-Reply-To: 428617.3.1334627550218.JavaMail.geo-discussion-forums@ynnn9
"Rego, P." <pvrego@gmail.com> writes:
> I'm getting a bit difficult in converting this makefile in a .gpr project file.
>
> -- makefile
> all: main.hex main.lss sizedummy
>
> program:
> avrdude -pm8 <PROGRAMMER SPECIFIC> -Uflash:w:"main.hex"
You can't teach gprbuild to do this, since it has no result file
(although I could be wrong).
> main.elf: force
> avr-gnatmake main -o $@ -Os -mmcu=avr4 --RTS=zfp -largs crtm8._o
> -nostdlib -lgcc -mavr4 -Tdata=0x00800200
Apparently you are using '.elf' as the 'executable extension'. That is
specified in 'package Builder', via 'Executable_Suffix' (see
gprbuild_ug.info, section 6.3 Package Builder).
The other options go in 'package Compiler' or 'package Linker'. It is
difficult to tell which; things following -largs probably go in Linker,
but you may have to experiment. The manual is no help here; I have
complained about this to AdaCore, to no avail.
> main.lss: main.elf
> -avr-objdump -h -S main.elf >"main.lss"
This just dumps the section headers into the .lss file. You might be
able to build a gprconfig file to teach gpr about this.
(gprbuild_ug.info section 5).
> main.hex: main.elf
> avr-objcopy -O ihex $< $@
Similarly, this converts a file from one format to another; you can
probably build a gprconfig file to do this.
> sizedummy: main.elf
> -avr-size --format=avr --mcu=atmega8 main.elf
I don't know what this does; possibly print a message to the output
stream giving the size? I don't think you can get gprbuild to do this.
> clean:
> $(RM) *.o leds *.ihex *.ali *.elf *.hex *.lss *.map
no way.
gprbuild is _not_ a complete replacement for make.
For the makefile you show (assuming it is complete), there is no
advantage to using a gpr file.
A gpr file is useful when you have several source directories, when you
need to specify different compilation options for different files, or
when you have a high-level project composed of lower-level projects.
--
-- Stephe
next prev parent reply other threads:[~2012-04-18 12:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-17 1:52 Converting a simple makefile in a GPS project Rego, P.
2012-04-18 12:45 ` Rolf
2012-04-21 19:56 ` Rego, P.
2012-04-18 12:49 ` Stephen Leake [this message]
2012-04-21 19:54 ` Rego, P.
2012-04-22 4:09 ` Configuring --RTS=? on GPS Rego, P.
2012-04-22 14:18 ` Converting a simple makefile in a GPS project Stephen Leake
2012-04-22 15:30 ` Simon Wright
2012-04-23 2:09 ` Rego, P.
2012-04-23 2:04 ` Rego, P.
2012-04-21 19:57 ` Rego, P.
2012-04-23 2:34 ` Rego, P.
2012-04-24 12:17 ` Stephen Leake
2012-04-27 4:07 ` Rego, P.
[not found] ` <30582310.1752.1335499373911.JavaMail.geo-discussion-forums@ynjj16>
2012-04-28 7:05 ` Stephen Leake
2012-04-30 2:41 ` Rego, P.
2012-04-30 2:43 ` Rego, P.
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox