aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 8 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 2e1a758..dad9f4c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
MAKEFILES = $(shell dirname $(shell find . -name Makefile ! -path ./Makefile ! -path "./build/*"))
+CMAKELISTS = $(shell dirname $(shell find . -name CMakeLists.txt ! -path "./build/*"))
OBJDIR = $(PWD)/build
@@ -15,8 +16,13 @@ export CXXFLAGS = -std=c++11 $(CFLAGS) -fno-exceptions
export LDFLAGS = -pthread -static-libgcc
export LDXXFLAGS = $(LDFLAGS) -static-libstdc++
-.PHONY: all clean pylint $(MAKEFILES)
-all: $(OBJDIR)/ccinfo $(MAKEFILES)
+.PHONY: all clean pylint $(MAKEFILES) $(CMAKELISTS)
+all: $(OBJDIR)/ccinfo $(MAKEFILES) $(CMAKELISTS)
+
+$(CMAKELISTS):
+ $(eval BENCHDIR=$(OBJDIR)$(shell echo $@ | sed s/src//))
+ @if test \( ! \( -d $(BENCHDIR) \) \) ;then mkdir -p $(BENCHDIR);fi
+ cd $(BENCHDIR); cmake $(PWD)/$@; make
$(MAKEFILES):
$(MAKE) -C $@ OBJDIR=$(OBJDIR)$(shell echo $@ | sed s/src//)