Keil 8051 Tools
  Settings include-Paths with subfolders?

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   Settings include-Paths with subfolders?
Scotty
Member
posted August 23, 2010 05:26 PM     Click Here to See the Profile for Scotty     Edit/Delete Message
Hi,

anyone knows if it's possible to set a include-Path which also uses subfolders?
It's a pain if you want to have structured folders and must assign a include path for each subfolder

Regards,

Scotty

IP: Logged

worknhard9062
Member
posted August 24, 2010 11:17 AM     Click Here to See the Profile for worknhard9062   Click Here to Email worknhard9062     Edit/Delete Message
Scotty,
In PC development environments (I'm familiar with Borland Builder but maybe also applies to VC++, etc) there seems to be some dialog box whereby include paths can be specified. One or more paths can be specified, separated by semi colons. My Zilog IDE supports this but I don't think the Silabs IDE does. Not directly anyway.

That seems to leave you with whatever mechanisms are available with the tools themselves. I know Keil supports some form of command line include file specification but what you're talking about could be cumbersome to do that way.

Erik M may recommend batch (BAT) files, which are perfectly acceptable but still requiring command line specification. I think there is also a way to set "environment variables" that the tools can query at assemble/ compile time and I've used this method succesfully within batch files before, for the Keil tools though.

I can't speak for SDCC et al. Hope that helps a little.

------------------
Regards,
Steve C.

IP: Logged

erikm
Member
posted August 24, 2010 12:24 PM     Click Here to See the Profile for erikm   Click Here to Email erikm     Edit/Delete Message
Erik M may recommend batch (BAT) files, which are perfectly acceptable but still requiring command line specification
I only recommend .bat for things the IDE can not do, if you are happy living with the limitations of the IDE, stay happy.

With a .bat file you can do any selection to a build directory with or without wildcards.

I have projects that grab files from here, files from there and a specific file only from somewhere else, try that with the IDE. My 'conversion' to .bat happened when I were to build 47 different builds from the same group of files and the "IDE answer" was "make 47 project fies". That would be acceptable in a static environment, but making the same change n 47 projects (and rememebering to do it in them all) is not acceptable.

Erik

[This message has been edited by erikm (edited August 24, 2010).]

IP: Logged

Scotty
Member
posted August 24, 2010 03:49 PM     Click Here to See the Profile for Scotty     Edit/Delete Message
Hi,

@Steve:
I know Keil supports some form of command line include file specification but what you're talking about could be cumbersome to do that way.
Yes, it is I've rearranged five projects and collected the common source files, trying to put them in one directory instead of having a copy of each file in each project. The problem I run into was that the projects are not always in the same relative path to the 'common' directories, therefore each project has to use another INCDIR path specification, but...

I think there is also a way to set "environment variables" that the tools can query at assemble/ compile time and I've used this method succesfully within batch files before, for the Keil tools though.
...going deeper into the environment variables might be the solution. I'll give it a try. I remember I've done something similar in my industrial education. Good old text editor programming under DOS with batch files. Shame on me that I've forgotten it, thanks for pointing me to it.

@Erik:
From your description I cannot retrieve how your batch files are working, can you provide a example, please?

Regards,

Scotty

IP: Logged

erikm
Member
posted August 25, 2010 08:09 AM     Click Here to See the Profile for erikm   Click Here to Email erikm     Edit/Delete Message
here is a fairly simple example:

@echo off
cd ..\bw

del *.lst
del *.c
del *.h
del *.a51
copy c:\aglobal\Schips\cyf200.h >trash
copy c:\aglobal\sdcc.h >trash
copy ..\sw\_WD*.* >trash

REM copy ..\sw\*.h >trash
REM copy ..\sw\*.c >trash
REM copy ..\sw\*.a51 >trash

if "%1" == "L" goto l1
if "%1" == "G" goto g1
rem ***** no type specified assuming L type ******
goto l1
:l1
rem *** LAN VERSION ***
copy ..\sw\LWD*.* _WD*.* >trash
rem >trash
goto common

:g1
rem g
REM copy ..\sw\wdg*.* *.*
dir
goto common

:notyp
type of build (WDver) not specified
goto exit

:common

call Scmp _WDinit
call Scmp _WDuart
call Scmp _WDrecd
call Sasm _WDxdata
call Scmp _WDisr
call Scmp _WDerr
call Scmp _WDmain
c:\tools\SDCC\bin\SDCC --debug _WDmain.rel _WDinit.rel _WDxdata.rel _WDisr.rel _WDuart.rel _WDrecd.rel _WDerr.rel
del *.sym
del *.adb
del *.asm
del *.rel
del *.cdb

:exit

cd ..\mk
@ echo on


here are the called .bats
@echo off
c:\tools\SDCC\bin\SDCC -c --debug %1.c >trash
if ERRORLEVEL 1 goto e1
rem zero
goto exit

:e1
@echo on
rem nonzero
@echo off
:exit

Erik

IP: Logged

Scotty
Member
posted August 26, 2010 02:37 AM     Click Here to See the Profile for Scotty     Edit/Delete Message
Hi Erik,

thank you for the bat example. I will go through it.

Regards,

Scotty

IP: Logged

foleypm
New Member
posted September 02, 2010 07:19 AM     Click Here to See the Profile for foleypm   Click Here to Email foleypm     Edit/Delete Message
if you use the incdir(..\subfoldername) compiler directive you can have the compiler search through subfolders within your project directory structure.

IP: Logged

Scotty
Member
posted September 02, 2010 09:02 AM     Click Here to See the Profile for Scotty     Edit/Delete Message
Hi foleypm,

if you use the incdir(..\subfoldername) compiler directive you can have the compiler search through subfolders within your project directory structure.
Thank you for this hint. If I'm correct, INCDIR is always project dependent. I search for a way to specify the paths only once. I haven't tried to override the TOOLS.INI settings and specify multiple paths yet.

Regards,

Scotty

IP: Logged

erikm
Member
posted September 02, 2010 09:51 AM     Click Here to See the Profile for erikm   Click Here to Email erikm     Edit/Delete Message
always project dependent
one of my reasons to not use the IDE. with a well built .bat file, you can have everyting controlled by ONE file
e.g. if %1 == '1' goto project 1 etc can maintain the commonality while allowing the project dependent stuff to be so.

Erik

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | MCU User Forum

Have you seen our MCU Knowledge Base?


Ultimate Bulletin Board 5.47b