From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4e7df01d3b597a03 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.129.169 with SMTP id nx9mr2407119pbb.2.1334753350282; Wed, 18 Apr 2012 05:49:10 -0700 (PDT) Path: r9ni70429pbh.0!nntp.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Converting a simple makefile in a GPS project. References: <428617.3.1334627550218.JavaMail.geo-discussion-forums@ynnn9> Date: Wed, 18 Apr 2012 08:49:23 -0400 Message-ID: <82bompjjcc.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (windows-nt) Cancel-Lock: sha1:1f1XIl181rBjIKJBziWfLmtqyAk= MIME-Version: 1.0 X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 1a1314f8eb846e029e66106121 X-Received-Bytes: 2745 Content-Type: text/plain; charset=us-ascii Date: 2012-04-18T08:49:23-04:00 List-Id: "Rego, P." 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 -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