flat assembler
Message board for the users of flat assembler.

Index > Heap > regarding MAKE utility, borland C

Author
Thread Post new topic Reply to topic
sleepsleep



Joined: 05 Oct 2006
Posts: 8975
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
i don't know if this heap is the correct section for this question, if it isn't, anyone who got the priviledges please move it accordingly.

the problem is like this, i am trying to figure out the implicit and explicit rules stated on the help file.
basically,

explicit rules = instructions for specific files
implicit rules = general instructions for files without explicit rules.

Code:
.cpp.obj:
        bcc32 -c $<
minimal.obj:
    

1st is implicit rule, format => [.source extension][.target extension]:

2nd line is command, bcc32 -c $<
$< is a macro that expand based on whether it is implicit/explicit,
[$<] = (implicit) path\dependent file + ext
[$<] = (explicit) path\target file + ext

so, in this case, i assume, it expands to path\dependent file + ext
but, what is this "path\dependent file + ext" ??

3rd line is explicit rule. minimal.obj: but without anything after the colon...?
explicit rules format is [target]:[dependent]

supprisingly, if you do make -f mymakefile.txt, it will start doing compilation?.... it is beyond my logic, why these 3 lines could get the source file compiled to obj file.
Post 16 Dec 2008, 01:59
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17352
Location: In your JS exploiting you and your system
revolution
I expect the third line says make "minimal.obj". And the first two lines tell make that any .obj file is to be made from the .ccp file and to execute the command "bcc ...".

Since "minimal.obj:" has no explicit path then it will use the implicit path rules to make it.


Last edited by revolution on 16 Dec 2008, 03:11; edited 1 time in total
Post 16 Dec 2008, 02:06
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8975
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
i found some info here,
http://edmulroy.portbridge.com/howto5.htm

i think the borland help file failed to mention this critical information.
Quote:

In a makefile these relationships are expressed with rules. Each rule shows a target which is to be built and the list of dependencies or items upon which it depends. The first rule in the file is the one item which is to be built by using this make file. Other rules that follow are for intermediate files that must be created to get to where the all dependencies exist and are up to date.


and i found out that the builtins.mak inside the make folder also can affects the MAKE process.

if i delete that file builtins.mak
Code:
minimal.obj : minimal.cpp
    

return only
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland

but if that file builtins.mak is present, then it will start compiles.

so, just now, i tried the following
Code:
minimal.obj : minimal.cpp
.cpp.obj:
        bcc32 -c $<
    

it started to makes sense now.
my goal is to make minimal.obj. (first line is our goal, but i didn't saw borland wrote this on its manual)
it is an explicit rules, the obj file is depend on the minimal.cpp file.

so, general rules states, to turn .cpp into .obj, the make needs to use bcc32 -c.

so, what this $< doing? i comprehend it as, since the minimal.obj depends on minimal.cpp, so minimal.cpp is dependent file.

at least a little breakthrough...... btw, thanks revolution for his reply.
Post 16 Dec 2008, 02:36
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17352
Location: In your JS exploiting you and your system
revolution
sleepsleep wrote:
thanks revolution for his reply.
For his or her reply Wink
Post 16 Dec 2008, 03:19
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8975
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
holly shemale..........run!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
run!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
Post 16 Dec 2008, 05:32
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8975
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
i discovered the whole process actually to be quite easy,

was messing with this util lately, hmm, does anyone know how to get the defined constant from .cpp source file and use it on the make file?

i wrote a make script to compile .cpp file .exe using wxwidget

to use it, just install the bcc and compile the wxwidget library using bcc.
then through cmd, make -f thissavedname.txt -DF=filename

what i want to do is to link with specific wx library only, not all libs, like the below script did now.

i am thinking of define a constant in .cpp file, then get it in the make file, is that possible?

Code:
all : $(F).exe
I1 = -I"D:/BIN/BCC/Include"
I2 = -I"D:/WX/lib/bcc_lib/msw"
I3 = -I"D:/WX/include"

L1 = -L"D:/BIN/BCC/Lib"
L2 = -L"D:/BIN/BCC/Lib/PSDK"
L3 = -L"D:/WX/lib/bcc_lib"

A1 = wxbase28.lib wxmsw28_core.lib wxregex.lib wxbase28_net.lib wxmsw28_adv.lib
A2 = wxmsw28_media.lib wxbase28_odbc.lib wxmsw28_dbgrid.lib wxmsw28_html.lib
A3 = wxbase28_xml.lib wxmsw28_xrc.lib wxmsw28_aui.lib wxmsw28_richtext.lib
A4 = wxmsw28_gl.lib wxzlib.lib wxpng.lib wxjpeg.lib wxtiff.lib wxexpat.lib
A5 = c0w32.obj ole2w32.lib oleacc.lib odbc32.lib import32.lib cw32.lib

$(F).exe : $(F).obj
  ilink32 -q -Tpe -aa -x -Gn $(L1) $(L2) $(L3) $(F).obj $(A1) $(A2) $(A3) $(A4) $(A5)

all :
!if GUI_TYPE
!message link gui lib
!else
!message link console lib
!endif
       -if exist $(F).tds del $(F).tds

$(F).obj : $(F).cpp
      bcc32 -6 -c -a4 -q -v- $(I1) $(I2) $(I3) $(F).cpp
    
Post 19 Dec 2008, 13:08
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8975
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
i tried the following modification on minimal.cpp yesterday.
Code:
#include "wx/wxprec.h"

#ifdef __BORLANDC__
       #pragma hdrstop
#endif

#ifdef WX_PRECOMP
  #include "wx/wx.h"
#endif

class MyApp : public wxApp
{
      public:
 virtual bool OnInit();
};

class MyFrame : public wxFrame
{
       public:
 MyFrame(const wxString& title);
};

bool MyApp::OnInit()
{
        MyFrame *frame = new MyFrame(_T("sleepsleep"));
   frame->Show(true);
       return true;
}

MyFrame::MyFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title) {}

IMPLEMENT_APP(MyApp)
    

it just a more bare bone with no event handler, just a simple window frame.
i did some modification on my make file to support resource icon files.

Code:
A5 = c0w32.obj ole2w32.lib oleacc.lib odbc32.lib import32.lib cw32.lib

$(F).res : $(F).rc
        brcc32 -32 -v -i"D:/WX/include" -i"D:/BIN/BCC/Include" $(F).rc
    

just add the above line after the A5
Post 20 Dec 2008, 13:09
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17352
Location: In your JS exploiting you and your system
revolution
I would be nice if your example code had at least some ASM in it. I not forcing you to put some in 'cause you can do whatever ya want in the heap of course. But just sayin', you know Wink
Post 20 Dec 2008, 13:16
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8975
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
oh, sorry bout that.
you can add
Code:
//asm
    

after the line IMPLEMENT_APP(MyApp), just make sure start it with //
/* then followed by */ is okay also.
Post 21 Dec 2008, 12:45
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17352
Location: In your JS exploiting you and your system
revolution
You're cruel. You know that don't you?

Okay, sure, you added the word "asm". Yeah, fine, okay, good one. Crying or Very sad
Post 21 Dec 2008, 13:06
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17352
Location: In your JS exploiting you and your system
revolution
revolution wrote:
sleepsleep wrote:
thanks revolution for his reply.
For his or her reply Wink
Or its Wink
Post 27 Dec 2008, 05:53
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.