Results 1 to 4 of 4
I Have one Makefile like..
OBJS: a.o b.o c.o d.o
clean:
rm -rf $(OBJS)
Here my question is, suppose if i do 'make clean' it will clean all object files, ...
- 03-15-2010 #1Just Joined!
- Join Date
- Nov 2006
- Location
- Hyderabad
- Posts
- 85
cleaning .o files
I Have one Makefile like..
OBJS: a.o b.o c.o d.o
clean:
rm -rf $(OBJS)
Here my question is, suppose if i do 'make clean' it will clean all object files, but i want to do it with out removing a.o . how can we do this.
thanks.
- 03-15-2010 #2Just Joined!
- Join Date
- Mar 2010
- Location
- Belgium
- Posts
- 4
If you do something like this:
Or just get a.o out of your OBJS?Code:FILES := b.o c.o d.o clean: rm -fr $(foreach file,$(FILES),$(file))
- 03-15-2010 #3Just Joined!
- Join Date
- Nov 2006
- Location
- Hyderabad
- Posts
- 85
You mean that keep the loop repeat and clean the file other than a.o.
OK... thank you.
- 03-15-2010 #4Just Joined!
- Join Date
- Mar 2010
- Location
- Belgium
- Posts
- 4
Yes indeed
Or just like your make-file, but remove a.o out of the OBJS list.


Reply With Quote