From 33da36450758efa4c7cde3e18518102463f08c4f Mon Sep 17 00:00:00 2001 From: Crayon2000 Date: Wed, 23 Jan 2019 11:26:45 -0500 Subject: [PATCH] Simplify Makefile --- GRRLIB/Makefile | 24 ++++++++---------------- GRRLIB/lib/Makefile | 24 ++++++++---------------- examples/Makefile | 24 +++++++----------------- 3 files changed, 23 insertions(+), 49 deletions(-) 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