Board index » cppbuilder » How to create new directory-alias like $(BCB)?

How to create new directory-alias like $(BCB)?

Hi,
Is it possible to create my own directory-alias to use in the
Options-screen, something like
$(MYPROJECTS)? And how?

Thanks, Flip

 

Re:How to create new directory-alias like $(BCB)?


Quote
> Is it possible to create my own directory-alias to use in the
> Options-screen, something like
> $(MYPROJECTS)? And how?

No.

+=====================================================+
| Jonathan Arnold (mailto:jdarn...@buddydog.org)      |
|         Comprehensive C++Builder link site:         |
| http://www.buddydog.org/C++Builder/c++builder.html  |
+=====================================================+

Re:How to create new directory-alias like $(BCB)?


What do you mean, create your own? If you mean you want to customize
your makefile
by defining your own make variables, that is no problem. If you perform
command line
builds and you use Builder v4 than just about any valid make syntax can
appear in your .bpr
file. This is true to some extent from the IDE as well. For example if
you alter the CFLAG
make variable it effects the compiler* the same way whether command line
or IDE build.

Although the makefiles generated by BCB4 have sections labeled IDE,
MAKE. I think
these labels are only there to enhance readability. I think that the
entire makefile is parsed
by either make.exe or the IDEs dll equivalent.

There would be nothing wrong with adding your own make variables as long
as they do not
get in the way with existing make arguments.

I would suggest the following procedure:
1) Save a copy of your .bpr file under a different name.
2) Hand edit it to effect the desired changes.
3) Build your project with the altered .bpr file and capture output to a
text file
    make -F -b youredits.bpr > make_output.txt

Saving it to a file will make it easy to verify that your customizations
worked the way
you expected them to. When you have it working from the command line
then verify
that it works in the IDE this will be more difficult. Depending on what
your change
is you may be able to rely on observation.

!if !$d(BCB)
BCB = $(MAKEDIR)\..
!endif

#
---------------------------------------------------------------------------

# IDE SECTION
#
---------------------------------------------------------------------------

# The following section of the project makefile is managed by the BCB
IDE.
# It is recommended to use the IDE to change any of the values in this
# section.
#
---------------------------------------------------------------------------

VERSION = BCB.04.04
#
---------------------------------------------------------------------------

PROJECT = test.exe
OBJFILES = test.obj unit1.obj
RESFILES = test.res
RESDEPEN = $(RESFILES) unit1.dfm
LIBFILES =
LIBRARIES =
SPARELIBS = Vcl40.lib
PACKAGES = Vcl40.bpi Vclx40.bpi vcljpg40.bpi bcbsmp40.bpi Qrpt40.bpi
Vcldb40.bpi \
  ibsmp40.bpi vcldbx40.bpi TeeUI40.bpi teedb40.bpi tee40.bpi
nmfast40.bpi \
  dclocx40.bpi
DEFFILE =
#
---------------------------------------------------------------------------

PATHCPP = .;
PATHASM = .;
PATHPAS = .;
PATHRC = .;
DEBUGLIBPATH = $(BCB)\lib\debug
RELEASELIBPATH = $(BCB)\lib\release
USERDEFINES =
SYSDEFINES = _RTLDLL;NO_STRICT;USEPACKAGES
#
---------------------------------------------------------------------------

CFLAG1 = -I$(BCB)\include;$(BCB)\include\vcl -Od -Hc
-H=$(BCB)\lib\vcl40.csm -w -Ve -r- \
  -a8 -k -y -v -vi- -c -b- -w-par -w-inl -Vx -tW -tWM \
  -D$(SYSDEFINES);$(USERDEFINES)

Quote
Flip Boer wrote:
> Hi,
> Is it possible to create my own directory-alias to use in the
> Options-screen, something like
> $(MYPROJECTS)? And how?

> Thanks, Flip

Re:How to create new directory-alias like $(BCB)?


Quote
> Although the makefiles generated by BCB4 have sections labeled IDE,
> MAKE. I think
> these labels are only there to enhance readability. I think that the
> entire makefile is parsed
> by either make.exe or the IDEs dll equivalent.

If only. No the IDE doesn't use make or a DLL derivative. It has a very
basic parser to extract only what it needs.

The correct answer is that no there is no way short of doing builds at the
command line.

--
Anduin Withers

Re:How to create new directory-alias like $(BCB)?


Do you mind me asking, how you know that the IDE parser is minimal? Also can
you
explain the limitations? Do you have access to the source code?
Have you figured this out by experimentation? I have reviewed the docs, but
could not find any documentation of the differences between command line and
IDE
builds. Basically all I know is that for all the standalone executables make,
linker, compiler
have IDE equivalents mostly implemented in DLLs.

I have experimented with BCB4. You can effect the IDE compiler by editing the
CFLAG
variable in the .bpr file. You can even set compiler options that the IDE does
not allow via
a GUI screen. I used this to force the compiler to quit after 25 warnings and
suppress certain
warnings that occurr frequently and are harmless. The compiler obeys these
options whether
invoked by the IDE or the command line.

Quote
Anduin Withers wrote:
> > Although the makefiles generated by BCB4 have sections labeled IDE,
> > MAKE. I think
> > these labels are only there to enhance readability. I think that the
> > entire makefile is parsed
> > by either make.exe or the IDEs dll equivalent.

> If only. No the IDE doesn't use make or a DLL derivative. It has a very
> basic parser to extract only what it needs.

> The correct answer is that no there is no way short of doing builds at the
> command line.

> --
> Anduin Withers

Re:How to create new directory-alias like $(BCB)?


Quote
> Do you mind me asking, how you know that the IDE parser is minimal?

I submitted bugs against it starting with BCB 1.

Quote
> Also can you explain the limitations?

From the IDE it isn't a make file, you can tweak some of the options but it
is a static parser.

Quote
> Do you have access to the source code?

No.

Quote
> Have you figured this out by experimentation?

Sorta.

Quote
> Basically all I know is that for all the standalone executables make,
> linker, compiler have IDE equivalents mostly implemented in DLLs.

In the case of the linker and compiler this is true, for make the IDE uses
one system, the command-line uses another.

Quote
> I have experimented with BCB4. You can effect the IDE compiler by editing
the
> CFLAG variable in the .bpr file. You can even set compiler options that
the IDE
> does not allow via a GUI screen. I used this to force the compiler to quit
after 25
> warnings and suppress certain warnings that occurr frequently and are
harmless.
> The compiler obeys these options whether invoked by the IDE or the command
> line.

Sure but you are modifying a line you already know the IDE reads. Try adding
a new rule or defining a variable.

--
Anduin Withers

Other Threads