T.R | Title | User | Personal Name | Date | Lines |
---|
843.1 | Need help in creating a Makefile that builds a library under ODIE | SMURF::FILTER | Automatic Posting Software - mail to flume::puck | Fri Jul 15 1994 13:35 | 44 |
| Date Of Receipt: 15-JUL-1994 11:53:06.46
From: FLAMBE::"[email protected]" "15-Jul-1994 1151"
To: [email protected]
CC: [email protected]
Subj: Need help in creating a Makefile that builds a library under ODIE
Note minor correction below. "ar cr ../libsys5/sigpause.o"
I need to build a library which will compile sources from libbsd, libc, libsys5.
Since multiple copies of the same file can exist in different libraries,
I want to be able to specify which copy to pick up and not let VPATH decide
to pick the first one found.
The following Makefile compiles the right copy of sigpause from libsys5 but
when adding into the libs1170.a library it tries to find the sigpause.o
but cannot because it does "ar tr libs1170 ../libsys5/sigpause.o".
- - - --------------------------------------------------------------
VPATH = ../libbsd:../libc:../libsys5
LIBRARIES = libs1170.a
EXPLIB_TARGETS = export_libs1170.a
ILIST = libs1170.a
IDIR = /usr/ccs/lib/
IMODE = 644
CFLAGS = -D_EXTENDED -D_BSD
# example of pulling sources from multiple libraries
OFILES = ../libsys5/sigpause.o dirname.o ftime.o
include ${MAKEFILEPATH}/standard.mk
include ${MAKEFILEPATH}/libs.mk
include ${MAKEFILEPATH}/objects.mk
~
- - - -------------------------------end-----------------------------
Deepak Gupta
DTN(462)-6028
|
843.2 | Re: Need help in creating a Makefile that builds a library under ODIE | SMURF::FILTER | Automatic Posting Software - mail to flume::puck | Fri Jul 15 1994 14:38 | 45 |
| Date Of Receipt: 15-JUL-1994 13:16:18.04
From: FLUME::jmcg "Jim McGinness"
To: [email protected]
CC: buildhelp@DEC:.zko.flume
Subj: Re: Need help in creating a Makefile that builds a library under ODIE
Normally, when building a library under ODE, you want to first collect
all of the .o files for the library in a single directory in the obj
tree. Having a pathname instead of a simple filename in an OFILES
definition would be abnormal.
In situations where a .c filename occurs in more than one of the
directories listed in VPATH and you want to specify which one is
intended, do it with a explicit dependency rule.
I suggest you try something that looks more like:
===========================================================================
VPATH = ../libbsd:../libc:../libsys5
LIBRARIES = libs1170.a
EXPLIB_TARGETS = export_libs1170.a
ILIST = libs1170.a
IDIR = /usr/ccs/lib/
IMODE = 644
CFLAGS = -D_EXTENDED -D_BSD
# example of pulling sources from multiple libraries
OFILES = sigpause.o dirname.o ftime.o
include ${MAKEFILEPATH}/standard.mk
include ${MAKEFILEPATH}/libs.mk
include ${MAKEFILEPATH}/objects.mk
sigpause.o: ../libsys5/sigpause.c
${_CC_} -c ${_CCFLAGS_} $?
===========================================================================
|
843.3 | Re: Need help in creating a Makefile that builds a library under ODIE | SMURF::FILTER | Automatic Posting Software - mail to flume::puck | Fri Jul 15 1994 15:46 | 25 |
| Date Of Receipt: 15-JUL-1994 14:26:53.80
From: FLUME::jmcg "Jim McGinness"
To: [email protected]
CC: buildhelp@DEC:.zko.flume
Subj: Re: Need help in creating a Makefile that builds a library under ODIE
I was afraid something like this might happen. Make is using the
suffix rule in addition to the explict dependency we've supplied in
creating the expansion of $? ... the list of dependencies with which
the target sigpause.o is out-of-date.
The wrong thing is happening. The libc version of sigpause.o is
overwriting the libsys5 version.
I don't know how to supress the automatic application of the suffix
rule. Changing $? to ../libsys5/sigpause.c in the command for
sigpause.o will solve this problem, at the cost of appearing less
generic.
There are two things about your output trace I don't understand.
Why did it remove *.a in response to a "build" command? Why
are dirname.o and ftime.o not being built?
-- jmcg
|
843.4 | Re: Need help in creating a Makefile that builds a library under ODIE | SMURF::FILTER | Automatic Posting Software - mail to flume::puck | Fri Jul 15 1994 16:50 | 62 |
| Date Of Receipt: 15-JUL-1994 15:18:14.85
From: FLUME::jmcg "Jim McGinness"
To: [email protected]
CC: buildhelp@DEC:.zko.flume
Subj: Re: Need help in creating a Makefile that builds a library under ODIE
I'm happy if you're happy. No, seriously, there's nothing wrong with
solving the problem this way. Make is doing the right thing for the
standard case and usually saves us a lot of work. In this particular
case where we have to disambiguate something, it's quite acceptable to
say what we mean in exactly the way that's required. I only prefer
generics when generics work....
-- jmcg
To: Jim McGinness <[email protected]>
Subject: Re: Need help in creating a Makefile that builds a library under ODIE
Date: Fri, 15 Jul 94 14:47:54 EDT
From: [email protected]
Jim,
Thanks for the help. The following dependency rule in the Makefile did the
trick. I know you are not totally happy with this solution. So if you get
a better idea let me know. I will try it.
Deepak
--------------------------------------------------------------------------------
DEPENDENCY RULE
===============
sigpause.o: ../libsys5/sigpause.c
${_CC_} -c ${_CCFLAGS_} ../libsys5/sigpause.c
---------------------------------------------------------------------------------
$ build
relative path: ./usr/ccs/lib/libs1170.
cd ../../../../../obj/alpha/usr/ccs/lib/libs1170
/usr/sde/osf1/build/goldos.2wk/tools/alpha_OSF1/alpha/acc/cc -std0 -EL -c -DBSD44 -DMSG
-DNLS -D__WCHAR_T_LEN=4 -Wf,-wchar32 -DMACH -DCMU -DOSF -Dalpha -D__alpha__
-D__alpha -Dunix -D__unix__ -D_SHARED_LIBRARIES -O2 -Olimit 5000
-D_EXTENDED -D_BSD -I `genpath -I.` `genpath
` -I/usr/users/dg/sandboxes/spec1170/export/alpha/usr/include
-I/spec1170/sandbox/stdsbld/export/alpha/usr/include
-I/usr/sde/osf1/build/goldos.2wk/export/alpha/usr/include
../../../../../../src/usr/ccs/lib/libsys5/sigpause.c
/usr/sde/osf1/build/goldos.2wk/tools/alpha_OSF1/alpha/acc/ar cr libs1170.a sigpause.o
/usr/sde/osf1/build/goldos.2wk/tools/alpha_OSF1/alpha/acc/ar ts libs1170.a
________64ELEL_
sigpause.o
s - creating symbol hash table. Wait...
rm -f sigpause.o
rm -f /usr/users/dg/sandboxes/spec1170/export/alpha/usr/ccs/lib//libs1170.a
makepath /usr/users/dg/sandboxes/spec1170/export/alpha/usr/ccs/lib//libs1170.a
tar cf - libs1170.a | (cd /usr/users/dg/sandboxes/spec1170/export/alpha/usr/ccs/lib/;
tar xf -
|