Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Mar 2002 11:46:04 -0800 (PST)
From:      Wayne Lubin <wayneclubin@yahoo.com>
To:        freebsd-questions@freebsd.org
Subject:   Learning the make files
Message-ID:  <20020313194604.46754.qmail@web14706.mail.yahoo.com>

next in thread | raw e-mail | index | archive | help
Hi,

I am attempting to learn the make files and the
porting process and so have decided to pick a port and
try to follow the actions that make goes through when
"make" is typed in a port directory. I have previously
installed graphics/gqview and so have decided to use
that as my model. I am using freebsd 4.2. I have read
the man page for make and have read the oreilly book
"Managing Projects with Make" by Oram and Talbott. 

I begin by looking at /graphics/gqview/Makefile, which
is the makefile loaded first when I typed "make" in
this directory,  and right from the start I am running
into something I find confusing. I am aware that the
first thing everyone thinks make should do is go to
the included bsd.port.mk file and run a target there
that sees if the required tar ball exists, and if not,
go get it. 

But if you look at /graphics/gqview/Makfile you will
see that the first target listed in that file, after
some variable asignments, is

pre-patch:
        @${PERL} -pi -e 's|-lpthread|-pthread|g ; \
                
s|DATADIRNAME=lib|DATADIRNAME=share|g'
${WRKSRC}/configure
        @find ${WRKSRC} -name "Makefile.in" | xargs
${PERL} -pi -e \
               
's|GNOME_DATADIR\)/gnome/|GNOME_DATADIR\)/|g'

The details of the script under the pre-patch target
are not important right now. What is important is I am
not sure why make would run some target in the
included bsd.port.mk file first as apposed to the
above first encountered pre-patch target. The only way
this can happen as far as I know from reading the man
page, is if there exists a .BEGIN target in
bsd.port.mk, in which case that is the target that
will be initially run(since only "make" was typed and
no specified target was passed to make on the command
line). But if you look in bsd.port.mk you will find
severeral .BEGIN targets, however they are within if
statements and only apply during fatal error
conditions, and would not apply.

If someone could explain to me how this works it would
be greatly appreciated. Thanks.

Wayne

__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020313194604.46754.qmail>