diff --git a/GRRLIB/Makefile b/GRRLIB/Makefile index 68b999c..d126031 100644 --- a/GRRLIB/Makefile +++ b/GRRLIB/Makefile @@ -1,25 +1,17 @@ -SUBDIRS:= `ls | egrep -v '^(\.svn)$$'` +MAKEFILES := $(shell find . -mindepth 2 -maxdepth 2 -name Makefile) all: - @for i in $(SUBDIRS); do \ - if test -e $$i/Makefile ; then \ - echo "-----------------------------------------------------------";\ - $(MAKE) -C $$i || { exit 1;} \ - fi; \ + @for i in $(MAKEFILES); do \ + echo "-----------------------------------------------------------"; \ + $(MAKE) -C `dirname $$i` || exit 1; \ done; clean: - @rm -f *.bz2 - @for i in $(SUBDIRS); do \ - if test -e $$i/Makefile ; then \ - $(MAKE) -C $$i clean || { exit 1;} \ - fi; \ + @for i in $(MAKEFILES); do \ + $(MAKE) -C `dirname $$i` clean || exit 1; \ done; install: - @rm -f *.bz2 - @for i in $(SUBDIRS); do \ - if test -e $$i/Makefile ; then \ - $(MAKE) -C $$i install || { exit 1;} \ - fi; \ + @for i in $(MAKEFILES); do \ + $(MAKE) -C `dirname $$i` install || exit 1; \ done; \ No newline at end of file diff --git a/GRRLIB/lib/Makefile b/GRRLIB/lib/Makefile index 68b999c..d126031 100644 --- a/GRRLIB/lib/Makefile +++ b/GRRLIB/lib/Makefile @@ -1,25 +1,17 @@ -SUBDIRS:= `ls | egrep -v '^(\.svn)$$'` +MAKEFILES := $(shell find . -mindepth 2 -maxdepth 2 -name Makefile) all: - @for i in $(SUBDIRS); do \ - if test -e $$i/Makefile ; then \ - echo "-----------------------------------------------------------";\ - $(MAKE) -C $$i || { exit 1;} \ - fi; \ + @for i in $(MAKEFILES); do \ + echo "-----------------------------------------------------------"; \ + $(MAKE) -C `dirname $$i` || exit 1; \ done; clean: - @rm -f *.bz2 - @for i in $(SUBDIRS); do \ - if test -e $$i/Makefile ; then \ - $(MAKE) -C $$i clean || { exit 1;} \ - fi; \ + @for i in $(MAKEFILES); do \ + $(MAKE) -C `dirname $$i` clean || exit 1; \ done; install: - @rm -f *.bz2 - @for i in $(SUBDIRS); do \ - if test -e $$i/Makefile ; then \ - $(MAKE) -C $$i install || { exit 1;} \ - fi; \ + @for i in $(MAKEFILES); do \ + $(MAKE) -C `dirname $$i` install || exit 1; \ done; \ No newline at end of file diff --git a/examples/Makefile b/examples/Makefile index ccc5dda..0924af2 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -1,22 +1,12 @@ -SUBDIRS:= `ls | egrep -v '^(\.svn)$$'` - -DATESTRING := $(shell date +%Y)$(shell date +%m)$(shell date +%d) +MAKEFILES := $(shell find . -mindepth 2 -maxdepth 2 -name Makefile) all: - @for i in $(SUBDIRS); do \ - if test -e $$i/Makefile ; then \ - echo "-----------------------------------------------------------";\ - $(MAKE) -C $$i || { exit 1;} \ - fi; \ + @for i in $(MAKEFILES); do \ + echo "-----------------------------------------------------------"; \ + $(MAKE) -C `dirname $$i` || exit 1; \ done; clean: - @rm -f *.bz2 - @for i in $(SUBDIRS); do \ - if test -e $$i/Makefile ; then \ - $(MAKE) -C $$i clean || { exit 1;} \ - fi; \ - done; - -dist: clean - @tar --exclude=.svn -cvjf wii-examples-$(DATESTRING).tar.bz2 * + @for i in $(MAKEFILES); do \ + $(MAKE) -C `dirname $$i` clean || exit 1; \ + done; \ No newline at end of file