[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference smurf::buildhelp

Title:USG buildhelp questions/answers
Moderator:SMURF::FILTER
Created:Mon Apr 26 1993
Last Modified:Mon Jan 20 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2763
Total number of notes:5802

1009.0. "help with OSF makefiles" by SMURF::FILTER (Automatic Posting Software - mail to flume::puck) Mon Oct 17 1994 19:57

Date Of Receipt: 	17-OCT-1994 18:31:09.29
From: 	FLAMBE::"[email protected]"
To: 	[email protected]
CC: 	
Subj: 	help with OSF makefiles

What I'm trying to do is setup a directory under /usr/field to build two 
utilities that share an object modual.  Like so:

/usr/field/vbmt containing:
	   Makefile
           vbmtods.c
	   vbmtods.h
           vbmtpg.c
	   vbmtchain.c

To build /usr/field/vbmtpg and /usr/field/vbmtchain linking in the common
module vbmtods.o.  Below is my first cut that builds one utility with two 
object moduals.  Can such a makefile be constructed?

Thanks!

Alan

---
#
# @DEC_COPYRIGHT@
#
#
# HISTORY
# $Log: Makefile,v $
# $EndLog$
#
# @(#)$RCSfile: Makefile,v $ $Revision: 1.1.4.3 $ (DEC) $Date: 1994/05/26 02:10:05 $
#

PROGRAMS		= vbmtpg

ILIST			= vbmtpg
IDIR			= /usr/field/
IOWNER			= root
IMODE			= 755

LIBS			= -lmsfs -lmsfs_stat -llmf
INCFLAGS                = -I${MAKETOP}/usr/field/vbmt
HFILES			= vbmtods.h
OFILES			= vbmtods.o vbmtpg.o 
LDFLAGS                 = ${LDSTRIP}

include ${MAKEFILEPATH}/standard.mk
include ${MAKEFILEPATH}/programs.mk
include ${MAKEFILEPATH}/objects.mk





T.RTitleUserPersonal
Name
DateLines
1009.1Re: help with OSF makefilesSMURF::FILTERAutomatic Posting Software - mail to flume::puckTue Oct 18 1994 00:0814
Date Of Receipt: 	17-OCT-1994 22:50:43.99
From: 	FLUME::jmcg "Jim McGinness"
To: 	[email protected]
CC: 	buildhelp@DEC:.zko.flume
Subj: 	Re:  help with OSF makefiles

What you're trying to do is admirable, but the typical way our Makefiles
work is to rebuild the object modules specified in the OFILES.  You
can conserve on the source modules and only put it in one place -- this
takes a VPATH directive, but trying to share the .o file can cause problems
with build order.

	-- jmcg

1009.2Re: help with OSF makefilesSMURF::FILTERAutomatic Posting Software - mail to flume::puckTue Oct 18 1994 13:3226
Date Of Receipt: 	18-OCT-1994 12:26:04.42
From: 	WASTED::"[email protected]"
To: 	Jim McGinness <[email protected]>
CC: 	[email protected]
Subj: 	Re: help with OSF makefiles

I don't understand your "conserve on source" strategy.  Are you saying
that I should #include procedures?  That would not allow me to do file 
scoping.  What I can do is create a library like vdump/vrestore, but that 
seems like a lot of bother (3 directories with Makefiles, etc) for 2 
simple utilties.

Alan

On Mon, 17 Oct 1994, Jim McGinness wrote:

> What you're trying to do is admirable, but the typical way our Makefiles
> work is to rebuild the object modules specified in the OFILES.  You
> can conserve on the source modules and only put it in one place -- this
> takes a VPATH directive, but trying to share the .o file can cause problems
> with build order.
> 
> 	-- jmcg
> 


1009.3Re: help with OSF makefilesSMURF::FILTERAutomatic Posting Software - mail to flume::puckTue Oct 18 1994 14:3630
Date Of Receipt: 	18-OCT-1994 12:59:42.59
From: 	FLUME::jmcg "Jim McGinness"
To: 	[email protected]
CC: 	buildhelp@DEC:.zko.flume
Subj: 	Re: help with OSF makefiles

Now that I'm more awake, the simplest solution seems to be using a
single directory for both of the programs.  The Makefile gets just a
little more complicated (you need two OFILES lines instead of one),
but it achieves all the goals I can infer from your original message.

In trying to find an existing Makefile to recommend as an example, I
looked at usr/bin/nroff/Makefile and usr/bin/troff/Makefile and found
that they have done something completely stupid: they've duplicated
what were once common source files and now the source files have
diverged (i.e. fixes applied to one have not been applied to the
other).  Don't emulate that!

I think looking at usr/sbin/bootpd/Makefile will show you what I
mean about two OFILES lines: you need one qualified for each of the
PROGRAMS.

If you don't like the suggestion of a combined source directory, take
a look at usr/sbin/restore/Makefile.  You'll see an example of using
VPATH to pull in a source file from a related command (in this case,
"dump").  It also shows two programs being created from a single
source directory, so shows an OFILES directive for each program.

	--jmcg