Last change
on this file since 332 was
252,
checked in by Maciej Komosinski, 10 years ago
|
Fixed makefile clean for bash
|
-
Property svn:eol-style set to
native
|
File size:
575 bytes
|
Rev | Line | |
---|
[252] | 1 | ifeq "$(SHELL)" "/bin/sh" |
---|
| 2 | # because of bash-specific shell expansion used in 'clean': |
---|
| 3 | SHELL=/bin/bash |
---|
| 4 | endif |
---|
[109] | 5 | |
---|
| 6 | clean: |
---|
| 7 | ifeq "$(ALL_DIRS)$(ALL_DIRS)" "" |
---|
| 8 | @echo "Makefile-maintain clean: ALL_DIRS and/or EXTRA_CLEAN_FILES must be defined" |
---|
| 9 | else |
---|
| 10 | rm -f $(EXTRA_CLEAN_FILES) $(ALL_DIRS)/*.{a,o,d} |
---|
| 11 | endif |
---|
| 12 | |
---|
| 13 | ALL_DEPS=$(ALL_OBJS:.o=.d) |
---|
| 14 | |
---|
| 15 | ifneq "$(MAKECMDGOALS)" "clean" |
---|
| 16 | -include $(ALL_DEPS) |
---|
| 17 | endif |
---|
| 18 | |
---|
| 19 | depend: $(ALL_DEPS) |
---|
| 20 | |
---|
| 21 | %.d: %.cpp |
---|
| 22 | @set -e; rm -f $@; $(CXX) $(CXXFLAGS) -MM -MT $(<:.cpp=.o) $< > $@ |
---|
| 23 | # g++ $(CXXFLAGS) -MM -MT $(<:.o=.d) $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@ |
---|
Note: See
TracBrowser
for help on using the repository browser.