Re: Translate lines in Makefile



On Mon, 18 Aug 2008 11:06:21 -0400, "Richard B. Gilbert"
<rgilbert88@xxxxxxxxxxx> wrote:

John wrote:
On Thu, 14 Aug 2008 17:26:15 -0400, "Richard B. Gilbert"
<rgilbert88@xxxxxxxxxxx> wrote:

John wrote:
running Solaris 10

I have been task to modify a makefile using another makefile as an
example. I would like to understand what the heck I'm doing instead of
just copying line over from one make file to another.

The example makefile will compile a 32-bit and/or 64-bit driver. I
familiar with makefile but not an expert.

I would like to know what these line do?

ARCH:sh= uname -m #Assign the value sun4u to the variable ARCH
INST:sh= uname -p #Assign the value sparc to the variable INST

does sh= means to perform uname in a shell enviroment and set ARCH to
the output of uname -m? uname -m = sun4u - uname -p = sparc

What does the below translate to?
what dos MOD_CONF equate to? atds.conf?
does ARCH_OBJS equte to, "sparc/obj32" or "OBJS:sparc/obj32"? if
latter, then ARCH_MOD = 'atds:sparc/obj32/atds' Right?

MOD=atds # Assign the string value "atds" to MOD
MOD_CONF= $(MOD:%=%.conf)
OBJS= a.o bi.o c.o # Defines the names of three object files.

OBJ32=obj32 # String assignment
OBJ64=obj64

ARCH_OBJS= $(OBJS:%=$(INST)/$(OBJ32)/%) # String substitutions
ARCH_OBJS64= $(OBJS:%=$(INST)/$(OBJ64)/%)
ARCH_MOD = $(MOD:%=$(INST)/$(OBJ32)/$(MOD))
ARCH_MOD64= $(MOD:%=$(INST)/$(OBJ64)/$(MOD))

There was an excellent book available from O'Reilly & Associates, Inc.
It's "Managing Projects With make" by Andrew Oram and Steve Talbot. My
copy is dated 1993. It appears to be out of print now but see:

http://oreilly.com/catalog/9780596006105/index.html

which appears to be a somewhat updated and retitled version.

Make is a very handy tool if you are building software from multiple
source files. It checks if the source is newer than any exist object
file and if an object file is newer than the executable. It compiles
exactly what needs to be compiled, and links it if necessary.

The larger the project, the more you will appreciate the capabilities of
make!

While you are waiting for your copy to arrive, man make might be of some
use.

I have ordered the book. However, can you translate the make
statements above?

John

It has been many long years since I needed make for anything. I've
added some comments above to indicate what I THINK is going on. I would
not recommend relying on my interpretation for anything important! If
it's important, I'd suggest hiring someone who KNOWS. So you pay a
consultant's outrageous fee for a few hours of his time. But you get
something you can rely on.

OTOH, my interpretation and advice may be worth somewhat less than it costs!

I think that this make file is intended to build software in both 32 bit
and 64 bit flavors. It looks as if it's intended to build for both the
SUN4U SPARC platform and the x86 platform. I don't have Solaris running
on the X86 platform so I can't predict the outcome of this being
executed on the X86 platform. I actually executed "uname -m" and "uname
-p" to see what results I got on the SPARC platform.

If you already have what this is supposed to build, executing the
makefile will rebuild it! This might be of some benefit. It might also
have negative value, e.g. it could break something.

BTW, comp.unix.solaris is probably NOT the best newsgroup in which to
look for help. You really want to talk to people who write software and
actually USE this tool. I don't know what group(s) to direct you to; my
interests these days are mostly system administration related.

Thanks for your response.

I'll check on other groups to see if I can find someone with current
knowledge of 'make'. I'll probably get the book before I find someone.
In the meantime, I'm also studying 'man make'


.



Relevant Pages

  • Re: Translate lines in Makefile
    ... I have been task to modify a makefile using another makefile as an ... ARCH:sh= uname -m #Assign the value sun4u to the variable ARCH ... It checks if the source is newer than any exist object file and if an object file is newer than the executable. ... It looks as if it's intended to build for both the SUN4U SPARC platform and the x86 platform. ...
    (comp.unix.solaris)
  • Re: [RFC] kbuild - introduce vdir to make life easier for x86_64
    ... I did not like the vdir hack for a couple of reasons as partly outline by Andi. ... # Makefile for the linux x86_64-specific parts of the memory manager. ... # $is a list of directories that contain object files ... Anyway the kbuild fix needs to be pushed first. ...
    (Linux-Kernel)
  • porting third-party build system to bsd.kmod.mk
    ... After getting a few pointers from jhb at BSDCan on what a bsd.kmod.mk-using Makefile should look like, I have been trying my hand at porting the OpenAFS kernel module build system to use it. ... A lot of the difficulty is in getting an autogenerated vnode_if.h while using a list of files to include in the modulethat's given as a list of object files. ... But many of these links are needed for common code to work. ...
    (freebsd-hackers)
  • Re: switching from gnu make to bsd make
    ... Does gmake also create the `obj/' directory automagically? ... You have no makefile rule to create `obj/' and no dependency of all the ... object files to the object directory. ... # Clean everything. ...
    (freebsd-questions)
  • makefiles -- need help on string substitution and object file redirect
    ... Each dir has source files and a Makefile. ... Let's say that dir2 ... Dir1 also has a makefile that compiles "myfile5.C" into the object directory. ... my problem is as follows: I want to seperate the object files generated from dir1's ...
    (comp.unix.programmer)