Re: Get "Bad subdirectory" build error when specifying a non-subdirectory in DIRS
- From: "Zhou Yu" <nap_yu@xxxxxxxxxxx>
- Date: Sat, 15 Mar 2008 22:26:02 +0800
Thanks for your reply!
I'll try conditional CDEFINES in sources.cmn. But I read the following in PB5.0's help:
"After Build.exe parses a sources file, Nmake.exe incorporates the sources file into the common makefile file, Makefile.def. Build.exe follows only the macro assignments and ignores other lines, such as conditional Nmake.exe statements. Conditional statements in sources files are not supported."
Does it say that the means you mentioned is unsupported?
Zhou Yu
nap_yu@xxxxxxxxxxx
"Dean Ramsier" <ramsiernospam@xxxxxxxxxx> 写入消息 news:##WvpOdhIHA.5780@xxxxxxxxxxxxxxxxxxxxxxx
The typical way of passing information to the build tools like this is to use a CDEFINE in the sources file that is controlled by an environment variable. That will allow your code to be conditionally compiled. But instead of spending the time to implement this, might as well spend the same time to fix the code and do it correctly....
--
Dean Ramsier - eMVP
BSQUARE Corporation
"Zhou Yu" <nap_yu@xxxxxxxxxxx> wrote in message news:898526B9-7AE3-4247-9273-585AC9AA6426@xxxxxxxxxxxxxxxxI agree. I just do it for a temporary workaround.
Regards,
Zhou Yu
nap_yu@xxxxxxxxxxx
"Dean Ramsier" <ramsiernospam@xxxxxxxxxx> 写入消息 news:ew7IMMShIHA.2268@xxxxxxxxxxxxxxxxxxxxxxxSounds like you're violating the point of Platform\Common. It shouldn't have BSP specific code. You need to do some more work to separate out *COMMON* code (meaning no BSP dependencies) from BSP code.
--
Dean Ramsier - eMVP
BSQUARE Corporation
"Joe Yu" <nap_yu@xxxxxxxxxxx> wrote in message news:4892928D-C95C-4B1F-9FDD-DD399AAAEB34@xxxxxxxxxxxxxxxxIt does work. Thanks! :)
However, I still have a question. My code in \Platform\Common uses compiler directives to separate code for different BSPs. How can I pass the corresponding CDEFINES to to the compiler when building?
Regards,
Joe Yu
nap_yu@xxxxxxxxxxx
"Dean Ramsier" <ramsiernospam@xxxxxxxxxx> 写入消息
news:#5QbPFHhIHA.1944@xxxxxxxxxxxxxxxxxxxxxxx
You don't.
Your common library needs to be in the \Platform\Common tree, which is
always built.
--
Dean Ramsier - eMVP
BSQUARE Corporation
"Zhou Yu" <nap_yu@xxxxxxxxxxx> wrote in message
news:28ECFBDF-B1B9-4A45-8B57-6AE2513BBAF1@xxxxxxxxxxxxxxxx
Thank you :) Your answer is really helpful.
However, I still have a question. How to build MYBSP_COMMON\SRC\COMMON\IO
to a lib when building my OS design based on BSP1 or BSP2.
Sorry I'm a beginner for WinCE.
Joe Yu
"Luca Calligaris" <anonymous@xxxxxxxxxxxxxxxxxxxxxxxxx> 写入消息
news:OfbnlKDhIHA.536@xxxxxxxxxxxxxxxxxxxxxxx
you do not need to have MYBSP_COMMON\SRC\COMMON\IO
in dirs files in your BSP1 / BSP2:
supposing that the common IO folder will build a .lib file
(bsp_common_io.lib) in PLATFORM\COMMON\LIB\... you can put
this in sources files in BSP1 / BSP2 IO folders:
TARGETNAME=bsp1_io.lib
TARGETTYPE=LIBRARY
RELEASETYPE=PLATFORM
SOURCES=
SOURCELIBS= \
$(_PLATCOMMONLIB)\$(_CPUDEPPATH)\bsp_common_io.lib
TARGETNAME=bsp2_io.lib
TARGETTYPE=LIBRARY
RELEASETYPE=PLATFORM
SOURCES=
SOURCELIBS= \
$(_PLATCOMMONLIB)\$(_CPUDEPPATH)\bsp_common_io.lib
--
Luca Calligaris
www.eurotech.it
"Zhou Yu" <nap_yu@xxxxxxxxxxx> ha scritto nel messaggio
news:C6BD5CA1-DFE9-4FC9-9707-A5AD2B085B6A@xxxxxxxxxxxxxxxx
Hi,
I want to share some code between at least 2 BSPs in PB5.0. This comes
from the idea that I don't want to fix the same bug between different
BSPs source trees. What I'm doing is to organize my BSP source trees in
the way like the following:
$(_PLATFORMROOT)\
MYBSP1\SRC\COMMON\IO
dirs
MYBSP2\SRC\COMMON\IO
dirs
MYBSP_COMMON\SRC\COMMON\IO
sources
makefile
io.c
Either MYBSP1\SRC\COMMON\IO\dirs or MYBSP2\SRC\COMMON\IO\dirs defines
DIRS = ..\..\..\..\MYBSP_COMMON\SRC\COMMON\IO.
When I build my OS design based on either MYBSP1 or MYBSP2, PB5.0
report an error like "BUILD: [00:0000000005:ERRORE] Bad subdirectory:
..\..\..\..\MYBSP_COMMON\SRC\COMMON\IO.
Looks like that DIRS can NOT traverse directory other than its
subdirectories.
How can I fix this problems? Or how can I share common source code
between similar BSPs?
Thanks in advance!
Joe Yu
nap_yu@xxxxxxxxxxx
- Follow-Ups:
- References:
- Get "Bad subdirectory" build error when specifying a non-subdirectory in DIRS
- From: Zhou Yu
- Re: Get "Bad subdirectory" build error when specifying a non-subdirectory in DIRS
- From: Luca Calligaris
- Re: Get "Bad subdirectory" build error when specifying a non-subdirectory in DIRS
- From: Zhou Yu
- Re: Get "Bad subdirectory" build error when specifying a non-subdirectory in DIRS
- From: Dean Ramsier
- Re: Get "Bad subdirectory" build error when specifying a non-subdirectory in DIRS
- From: Joe Yu
- Re: Get "Bad subdirectory" build error when specifying a non-subdirectory in DIRS
- From: Dean Ramsier
- Re: Get "Bad subdirectory" build error when specifying a non-subdirectory in DIRS
- From: Zhou Yu
- Re: Get "Bad subdirectory" build error when specifying a non-subdirectory in DIRS
- From: Dean Ramsier
- Get "Bad subdirectory" build error when specifying a non-subdirectory in DIRS
- Prev by Date: what is the meaning of "Secondary table "?
- Next by Date: Re: builidng eboot/uboot using cygwin
- Previous by thread: Re: Get "Bad subdirectory" build error when specifying a non-subdirectory in DIRS
- Next by thread: Re: Get "Bad subdirectory" build error when specifying a non-subdirectory in DIRS
- Index(es):
Relevant Pages
|