Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

.INIT capability in gnumake

1 view
Skip to first unread message

ja...@reshape.com

unread,
May 30, 2000, 3:00:00 AM5/30/00
to
Hi Folks,

I am trying to implement .INIT capability in SunOS "make" with gnumake.
Here is what .INIT does:

.INIT: If defined in the makefile, this target and its
dependencies are built before any other targets
are processed.

I tried using "%:" and GNUmakefile workarounds with gnumake but they
don't work extactly in the same way .INIT does. Does anyone know a
way to make gnumake to coerce it into behaving like it understands
.INIT.

A side question, why gnumake doesn't have such default target (it is
very useful).

Thanks in advance.

- Jagat


Sent via Deja.com http://www.deja.com/
Before you buy.

Paul D. Smith

unread,
May 31, 2000, 3:00:00 AM5/31/00
to ja...@reshape.com
%% ja...@reshape.com writes:

j> I am trying to implement .INIT capability in SunOS "make" with gnumake.
j> Here is what .INIT does:

j> .INIT: If defined in the makefile, this target and its
j> dependencies are built before any other targets
j> are processed.

j> I tried using "%:" and GNUmakefile workarounds with gnumake but they
j> don't work extactly in the same way .INIT does. Does anyone know a
j> way to make gnumake to coerce it into behaving like it understands
j> .INIT.

Use $(shell ...) in conjunction with :=. See the GNU make manual for
details.

For example, I always use something like this to create object
directories:

__junk := $(shell [ -d $(OBJDIR) ] || $(MKDIR) $(OBJDIR))

This isn't identical to some implementations of .INIT; some guarantee
they won't be invoked unless some target is going to be built; this will
happen every time make is run.

On the other hand, it's more flexible since you can put as many of these
lines as you like anywhere in your makefiles.

--
-------------------------------------------------------------------------------
Paul D. Smith <psm...@baynetworks.com> Network Management Development
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
These are my opinions---Nortel Networks takes no responsibility for them.

0 new messages