|
|||
How do I keep some .o files after they are archived?
In most cases, after nmake creates an archive library it removes the
archived In the following example b.c and c.c are used for both libraries.
:ALL:
libone.a :: a.c b.c c.c
libtwo.a :: b.c c.c d.c
$ nmake
+ cc -O -I- -c a.c
+ cc -O -I- -c b.c
+ cc -O -I- -c c.c
+ ar r libone.a a.o b.o c.o
ar: creating libone.a
+ rm -f a.o b.o c.o
+ cc -O -I- -c d.c
+ ar r libtwo.a b.o c.o d.o
ar: cannot open b.o
No such file or directory
ar: cannot open c.o
No such file or directory
ar: creating libtwo.a
ar: b.o not found
ar: c.o not found
make: *** exit code 2 making libtwo.a
Use the arclean = :N!=b.o|c.o $ nmake + cc -O -I- -c a.c + cc -O -I- -c b.c + cc -O -I- -c c.c + ar r libone.a a.o b.o c.o ar: creating libone.a + rm -f a.o + cc -O -I- -c d.c + ar r libtwo.a b.o c.o d.o ar: creating libtwo.a + rm -f d.o
If you want to keep only one arclean = :N!=file.o
Shell pattern matching can be used too. For example, to keep all the
arclean = :N!=*.o Last Update: Wednesday,20-Dec-06 13:21:57 CST
|
|||