summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile27
-rw-r--r--tests/Makefile21
2 files changed, 48 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..7e9ea9a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,27 @@
+QMAKE = qmake
+MAKEFILE = libresourceqt.make
+LIB = build/libresourceqt.so.1.0.0
+
+%.make: %.pro
+ $(QMAKE) -o $@ $<
+
+clean: $(MAKEFILE)
+ $(MAKE) -f $(MAKEFILE) clean
+ cd tests; $(MAKE) clean
+ $(RM) $(MAKEFILE)
+ $(RM) -r build
+
+all: $(MAKEFILE)
+ $(MAKE) -f $(MAKEFILE) all
+ cd tests; $(MAKE) all
+
+install: $(MAKEFILE)
+ $(MAKE) -f $(MAKEFILE) install
+ cd tests; $(MAKE) install
+
+tests: force
+ cd tests; $(MAKE) tests
+
+force: ;
+
+.phony: clean all install tests
diff --git a/tests/Makefile b/tests/Makefile
new file mode 100644
index 0000000..f7a97a8
--- /dev/null
+++ b/tests/Makefile
@@ -0,0 +1,21 @@
+QMAKE = qmake
+MAKEFILES = $(patsubst %.pro,%.make,$(wildcard *.pro))
+
+%.make: %.pro
+ $(QMAKE) -o $@ $<
+
+tests: all
+ find build -type f -name 'test-*' -exec sh -c "if test -x {}; then {}; fi" \;
+
+clean: $(MAKEFILES)
+ for makefile in $(MAKEFILES); do make -f "$$makefile" clean; done
+ $(RM) $(MAKEFILES)
+ $(RM) -r build
+
+all: $(MAKEFILES)
+ for makefile in $(MAKEFILES); do make -f "$$makefile" all; done
+
+install: $(MAKEFILES)
+ for makefile in $(MAKEFILES); do make -f "$$makefile" install; done
+
+.phony: install tests all clean