Commits

Kevin Lyda committed 6a21803

Get gh-pages target working.

Comments (0)

Files changed (4)

 
 .PHONY: gh-pages
 if HAVE_GCOV
-gh-pages: doxygen-doc coverage-html
+gh-pages: clean
 	test `git rev-parse --abbrev-ref HEAD` = master
 	rm -f $(PWD)/.git/index.gh-pages
+	$(MKDIR_P) docs/html
 	GIT_INDEX_FILE=$(PWD)/.git/index.gh-pages git --work-tree $(PWD)/docs/html checkout gh-pages
+	$(MAKE) doxygen-doc coverage-html || (git co master; exit 1)
 	GIT_INDEX_FILE=$(PWD)/.git/index.gh-pages git --work-tree $(PWD)/docs/html checkout .nojekyll
 	GIT_INDEX_FILE=$(PWD)/.git/index.gh-pages git --work-tree $(PWD)/docs/html checkout CNAME
 	GIT_INDEX_FILE=$(PWD)/.git/index.gh-pages git --work-tree $(PWD)/docs/html add .
 	GIT_INDEX_FILE=$(PWD)/.git/index.gh-pages git --work-tree $(PWD)/docs/html ls-files --deleted | GIT_INDEX_FILE=$(PWD)/.git/index.gh-pages xargs git --work-tree $(PWD)/docs/html rm
-	GIT_INDEX_FILE=$(PWD)/.git/index.gh-pages git --work-tree $(PWD)/docs/doxygen/html commit -m "Update docs."
+	GIT_INDEX_FILE=$(PWD)/.git/index.gh-pages git --work-tree $(PWD)/docs/html commit -m "Update docs."
 	git checkout master
 else
 gh-pages:
 @DX_COND_doc_TRUE@	$(DX_ENV) $(DX_DOXYGEN) $(srcdir)/$(DX_CONFIG)
 
 .PHONY: gh-pages
-@HAVE_GCOV_TRUE@gh-pages: doxygen-doc coverage-html
+@HAVE_GCOV_TRUE@gh-pages: clean
 @HAVE_GCOV_TRUE@	test `git rev-parse --abbrev-ref HEAD` = master
 @HAVE_GCOV_TRUE@	rm -f $(PWD)/.git/index.gh-pages
+@HAVE_GCOV_TRUE@	$(MKDIR_P) docs/html
 @HAVE_GCOV_TRUE@	GIT_INDEX_FILE=$(PWD)/.git/index.gh-pages git --work-tree $(PWD)/docs/html checkout gh-pages
+@HAVE_GCOV_TRUE@	$(MAKE) doxygen-doc coverage-html || (git co master; exit 1)
 @HAVE_GCOV_TRUE@	GIT_INDEX_FILE=$(PWD)/.git/index.gh-pages git --work-tree $(PWD)/docs/html checkout .nojekyll
 @HAVE_GCOV_TRUE@	GIT_INDEX_FILE=$(PWD)/.git/index.gh-pages git --work-tree $(PWD)/docs/html checkout CNAME
 @HAVE_GCOV_TRUE@	GIT_INDEX_FILE=$(PWD)/.git/index.gh-pages git --work-tree $(PWD)/docs/html add .
 @HAVE_GCOV_TRUE@	GIT_INDEX_FILE=$(PWD)/.git/index.gh-pages git --work-tree $(PWD)/docs/html ls-files --deleted | GIT_INDEX_FILE=$(PWD)/.git/index.gh-pages xargs git --work-tree $(PWD)/docs/html rm
-@HAVE_GCOV_TRUE@	GIT_INDEX_FILE=$(PWD)/.git/index.gh-pages git --work-tree $(PWD)/docs/doxygen/html commit -m "Update docs."
+@HAVE_GCOV_TRUE@	GIT_INDEX_FILE=$(PWD)/.git/index.gh-pages git --work-tree $(PWD)/docs/html commit -m "Update docs."
 @HAVE_GCOV_TRUE@	git checkout master
 @HAVE_GCOV_FALSE@gh-pages:
 @HAVE_GCOV_FALSE@	@echo "ERROR: Need to run ./configure --enable-gcov"
  GREP="$ac_cv_path_GREP"
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
 
 
 # Extract the first word of "protoc-c", so it can be a program name with args.
 AM_PROG_CC_C_O
 AC_PROG_INSTALL
 AC_PROG_GREP
+AC_PROG_MAKE_SET
+AC_PROG_MKDIR_P
 AC_ARG_VAR(PROTOC_C, [Protobuf C compiler.])
 AC_ARG_VAR(RE2C, [re2c lexical scanner C pre-processor.])
 AC_CHECK_PROG(PROTOC_C, protoc-c, protoc-c)