Last change
on this file since 1304 was
364,
checked in by Maciej Komosinski, 10 years ago
|
Warn non incorrect paths in makefile
|
-
Property svn:eol-style set to
native
|
File size:
771 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 | |
---|
[364] | 6 | MISSING_ALL_DIRS=$(strip $(foreach DIR,$(shell echo $(ALL_DIRS)), $(if $(wildcard $(DIR)),,$(DIR)))) |
---|
| 7 | |
---|
[109] | 8 | clean: |
---|
| 9 | ifeq "$(ALL_DIRS)$(ALL_DIRS)" "" |
---|
| 10 | @echo "Makefile-maintain clean: ALL_DIRS and/or EXTRA_CLEAN_FILES must be defined" |
---|
| 11 | else |
---|
[364] | 12 | @echo -e -n $(if $(MISSING_ALL_DIRS),\\nMissing ALL_DIRS paths:\\n$(MISSING_ALL_DIRS)\\n\\n) |
---|
[109] | 13 | rm -f $(EXTRA_CLEAN_FILES) $(ALL_DIRS)/*.{a,o,d} |
---|
| 14 | endif |
---|
| 15 | |
---|
| 16 | ALL_DEPS=$(ALL_OBJS:.o=.d) |
---|
| 17 | |
---|
| 18 | ifneq "$(MAKECMDGOALS)" "clean" |
---|
| 19 | -include $(ALL_DEPS) |
---|
| 20 | endif |
---|
| 21 | |
---|
| 22 | depend: $(ALL_DEPS) |
---|
| 23 | |
---|
| 24 | %.d: %.cpp |
---|
| 25 | @set -e; rm -f $@; $(CXX) $(CXXFLAGS) -MM -MT $(<:.cpp=.o) $< > $@ |
---|
| 26 | # g++ $(CXXFLAGS) -MM -MT $(<:.o=.d) $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@ |
---|
Note: See
TracBrowser
for help on using the repository browser.