[<<] [<] Page 1 of 1 [>] [>>] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Specifying processor header file in Makefile/commandline with gpasm
in --mpasm-compatible mode
From: Kustaa Nyholm ####@####.#### Date: 20 Dec 2014 06:53:09 -0000 Message-Id: <54951CC8.5030000@sparetimelabs.com> In working with this code: http://www.diolan.com/pic/bootloader_dwn.html all the .asm files include the processor specific header with: #include "P18F4455.INC" now I would to specify the header in my Makefile so that I don't need to edit all those files when I use a different processor. So what is the recommended way to handle this? I can of course specify the header as a symbol defined on the command line that invokes the assembler but since I already (need to) specify the processor on the command line this seems redundant and thus wrong. br Kusti | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: Specifying processor header file in Makefile/commandline with
gpasm in --mpasm-compatible mode
From: Vikas N Kumar ####@####.#### Date: 20 Dec 2014 15:25:10 -0000 Message-Id: <549594D2.6030709@vikaskumar.org> On 12/20/2014 01:52 AM, Kustaa Nyholm wrote: > In working with this code: > > http://www.diolan.com/pic/bootloader_dwn.html > > all the .asm files include the processor specific header with: > > #include "P18F4455.INC" > > now I would to specify the header in my Makefile so that > I don't need to edit all those files when I use a different > processor. you create a new header file called something like "processor.inc" which has the text "#include <P18f455.inc>" automatically using a makefile target. Generate this file every time using the forced make target concept of your Make program. Include the "processor.inc" in all your assembly files instead. So when you change a processor, your makefile will generate a new processor.inc and will re-compile all the code. I can of course specify the header as a symbol defined > on the command line that invokes the assembler but > since I already (need to) specify the processor on > the command line this seems redundant and thus wrong. > If you're using a Makefile you do not need to specify it twice. The makefile can track all variables and you can just pass the variable again as a define option for the gpasm commandline. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: Specifying processor header file in Makefile/commandline with
gpasm in --mpasm-compatible mode
From: Kustaa Nyholm ####@####.#### Date: 20 Dec 2014 20:27:29 -0000 Message-Id: <5495DBAC.5010803@sparetimelabs.com> On 20/12/2014 18:19, Joe Pfeiffer wrote: > I use a processor directive in my source file instead of the -p > option. This would let you define a symbol on the command line, and > then reference the symbol both in the processor directive and in the > include statement. > Right, I thought about this, for some reason MPLAB manual says that this is not usually done. Why not I wonder because to me it looks totally acceptable. Thanks for the confirmation that this is ok. br Kusti | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: Specifying processor header file in Makefile/commandline with
gpasm in --mpasm-compatible mode
From: Kustaa Nyholm ####@####.#### Date: 20 Dec 2014 20:28:47 -0000 Message-Id: <5495DBFA.7060400@sparetimelabs.com> On 20/12/2014 17:25, Vikas N Kumar wrote: > On 12/20/2014 01:52 AM, Kustaa Nyholm wrote: >> In working with this code: >> >> http://www.diolan.com/pic/bootloader_dwn.html >> >> all the .asm files include the processor specific header with: >> >> #include "P18F4455.INC" >> >> now I would to specify the header in my Makefile so that >> I don't need to edit all those files when I use a different >> processor. > > you create a new header file called something like "processor.inc" which > has the text "#include<P18f455.inc>" automatically using a makefile > target. Generate this file every time using the forced make target > concept of your Make program. Include the "processor.inc" in all your > assembly files instead. > > So when you change a processor, your makefile will generate a new > processor.inc and will re-compile all the code. > I can of course specify the header as a symbol defined Thanks, that is a new one for me, I will have to look at how to implement that. br Kusti | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[<<] [<] Page 1 of 1 [>] [>>] |