From owner-freebsd-questions Wed Mar 13 11:46: 8 2002 Delivered-To: freebsd-questions@freebsd.org Received: from web14706.mail.yahoo.com (web14706.mail.yahoo.com [216.136.224.123]) by hub.freebsd.org (Postfix) with SMTP id 6563C37B417 for ; Wed, 13 Mar 2002 11:46:04 -0800 (PST) Message-ID: <20020313194604.46754.qmail@web14706.mail.yahoo.com> Received: from [64.131.161.101] by web14706.mail.yahoo.com via HTTP; Wed, 13 Mar 2002 11:46:04 PST Date: Wed, 13 Mar 2002 11:46:04 -0800 (PST) From: Wayne Lubin Subject: Learning the make files To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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