Hi.
I confronted with difficulties when try to write simple makefile with
"special targets" (.SECONDARY)/
book: "Managing Projects with GNU make, 3rd Edition" say :
"Prerequisites of this special target are treated as intermediate files but
are never automatically deleted. The most common use of .SECONDARY is to
mark object files stored in libraries. Normally these object files will be
deleted as soon as they are added to an archive. Sometimes it is more
convenient during development to keep these object files, but still use the
*make* support for updating archives".
Normally these object files will be deleted as soon as they are added to an
archive, but I create makefile to ensure in this behaviour and to my regret
i found that all object still locate in my directory when archive was
created
my Makefile is:
sources = main.c
objects = main.o
CC = gcc
.SECONDARY : $(objects)
main : $(sources)
$(AR) rv $(objects)
$(CC) $(sources)
//---
I think that above makefile should delete all objects before running
*gcc*command, and then
*gcc* should yield message like this: *"gcc: no input files"/*
**
Please, help me with this .SECONDARY special targets
**
**
**
2008/3/14, John Calcote <[EMAIL PROTECTED]>:
>
> Hi Vad,
> > learn make utility.
> >
> > And i want to know more about target modifiers
> > aside from .PHONY, like this:
> > .INTERMEDIATE .SECONDARY
> >
> > Please show me some simple examples of using this targets
> Please check out the GNU make manual here:
>
> http://www.gnu.org/software/make/manual
>
> Look in section 10.4 under intermediate dependencies. .INTERMEDIATE and
> .SECONDARY both provide a mechanism for you to explicitly declare a target
> as an intermediate product. Section 10.4 explains why you might want to do
> this, and what the side effects are.
>
> John
>
>
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make