From 6728df3556e2d5d4ce62a28b427e0a853446a072 Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Sat, 3 Jan 2015 00:25:00 +0000 Subject: [PATCH] one Makefile to rule them all --- examples/Makefile | 26 ++++++++++++++++++++++++++ examples/graphics/Makefile | 7 +++++++ examples/graphics/printing/Makefile | 7 +++++++ examples/templates/Makefile | 7 +++++++ 4 files changed, 47 insertions(+) create mode 100644 examples/Makefile create mode 100644 examples/graphics/Makefile create mode 100644 examples/graphics/printing/Makefile create mode 100644 examples/templates/Makefile diff --git a/examples/Makefile b/examples/Makefile new file mode 100644 index 0000000..756d82d --- /dev/null +++ b/examples/Makefile @@ -0,0 +1,26 @@ +SUBDIRS:= $(shell ls | egrep -v '^(CVS)$$') + +DATESTRING := $(shell date +%Y)$(shell date +%m)$(shell date +%d) + +#--------------------------------------------------------------------------------- +all: examples +#--------------------------------------------------------------------------------- + @rm -fr bin + @mkdir -p bin + @find . -name "*.3dsx" -exec cp -fv {} bin \; + +examples: + @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i || { exit 1;} fi; done; + +#--------------------------------------------------------------------------------- +clean: +#--------------------------------------------------------------------------------- + @rm -fr bin + @rm -f *.bz2 + @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i clean || { exit 1;} fi; done; + +#--------------------------------------------------------------------------------- +dist: clean +#--------------------------------------------------------------------------------- + @rm -fr bin + @tar --exclude=.svn --exclude=*CVS* -cvjf 3ds-examples-$(DATESTRING).tar.bz2 * diff --git a/examples/graphics/Makefile b/examples/graphics/Makefile new file mode 100644 index 0000000..bce05ec --- /dev/null +++ b/examples/graphics/Makefile @@ -0,0 +1,7 @@ +SUBDIRS:= `ls | egrep -v '^(CVS)$$'` +all: + @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i || { exit 1;} fi; done; +clean: + @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i clean || { exit 1;} fi; done; +install: + @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i install || { exit 1;} fi; done; diff --git a/examples/graphics/printing/Makefile b/examples/graphics/printing/Makefile new file mode 100644 index 0000000..bce05ec --- /dev/null +++ b/examples/graphics/printing/Makefile @@ -0,0 +1,7 @@ +SUBDIRS:= `ls | egrep -v '^(CVS)$$'` +all: + @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i || { exit 1;} fi; done; +clean: + @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i clean || { exit 1;} fi; done; +install: + @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i install || { exit 1;} fi; done; diff --git a/examples/templates/Makefile b/examples/templates/Makefile new file mode 100644 index 0000000..bce05ec --- /dev/null +++ b/examples/templates/Makefile @@ -0,0 +1,7 @@ +SUBDIRS:= `ls | egrep -v '^(CVS)$$'` +all: + @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i || { exit 1;} fi; done; +clean: + @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i clean || { exit 1;} fi; done; +install: + @for i in $(SUBDIRS); do if test -e $$i/Makefile ; then $(MAKE) -C $$i install || { exit 1;} fi; done;