Re: Making "make" auto-strip and auto-clean

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Shriramana Sharma,


On Sun, 26 Feb 2006 09:35:27 +0530 Shriramana Sharma <samjnaa@xxxxxxxxx> wrote:

> I would like make to always 
> 
> 1. strip the executable it created
> 2. remove the *.o files it created
> 
> after it has compiled the target executable. How do I do this? What do I
> add to the makefile? The current default command I am using is: 
> 
> pan: pan.o libswe.a
> 	gcc -g -O2 -o pan pan.o -L. -lswe -lm

First, if you always want to strip, no need to add -g.
Then:

all: pan strip clean

pan: pan.o libswe.a
	gcc -O2 -o $@ pan.o -L. -lswe -lm

strip: pan
	strip $<

clean:
	-rm -f pan.o

Or something similar..


Regards,

-- 
wwp

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux