Adapted build scripts for the common/* sub-tree.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@602 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/boilerplate.mk b/common/boilerplate.mk
new file mode 100644
index 0000000..6792b92
--- /dev/null
+++ b/common/boilerplate.mk
@@ -0,0 +1,35 @@
+
+all::
+ @subdirs="$(SUBDIRS)"; for d in $$subdirs; do (cd $$d; $(MAKE) $@) || exit 1; done
+
+clean::
+ @subdirs="$(SUBDIRS)"; for d in $$subdirs; do (cd $$d; $(MAKE) $@) || exit 1; done
+
+clean::
+ rm -f $(program) $(library) *.o
+
+SHELL = @SHELL@
+top_srcdir = @top_srcdir@
+@SET_MAKE@
+CC = @CC@
+CFLAGS = @CFLAGS@ $(DIR_CFLAGS)
+CCLD = $(CC)
+CXX = @CXX@
+CXXFLAGS = @CXXFLAGS@
+CXXLD = $(CXX)
+CPPFLAGS = @CPPFLAGS@
+DEFS = @DEFS@
+ALL_CPPFLAGS = $(CPPFLAGS) $(DEFS) $(DIR_CPPFLAGS)
+LIBS = @LIBS@
+LDFLAGS = @LDFLAGS@
+RANLIB = @RANLIB@
+AR = ar cq
+
+.SUFFIXES:
+.SUFFIXES: .cxx .c .o
+
+.c.o:
+ $(CC) $(ALL_CPPFLAGS) $(CFLAGS) -o $@ -c $<
+
+.cxx.o:
+ $(CXX) $(ALL_CPPFLAGS) $(CXXFLAGS) -o $@ -c $<