From 3b89a26a5266f33dbfdf6968557de29a471098ab Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Wed, 20 Jul 2016 15:37:24 -0700 Subject: Don't depend on the submodule; copy-paste instead --- .gitignore | 1 - Makefile | 21 ++++++++++++++------- Makefile.submodule | 35 ----------------------------------- 3 files changed, 14 insertions(+), 43 deletions(-) delete mode 100644 Makefile.submodule diff --git a/.gitignore b/.gitignore index 088f0262e..aeba9e55d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ *~ .#* /.dir-locals.el -/submodule-update Makefile.bak Makefile.coq Makefile.coq.bak diff --git a/Makefile b/Makefile index 2cb9a1a63..c4c9f0c6b 100644 --- a/Makefile +++ b/Makefile @@ -2,24 +2,27 @@ MOD_NAME := Crypto SRC_DIR := src STDTIME?=/usr/bin/time -f "$* (real: %e, user: %U, sys: %S, mem: %M ko)" +VERBOSE?= +SHOW := $(if $(VERBOSE),@true "",@echo "") +HIDE := $(if $(VERBOSE),,@) + .PHONY: coq clean update-_CoqProject cleanall install \ install-coqprime clean-coqprime coqprime \ specific non-specific -.DEFAULT_GOAL := coq --include Makefile.submodule +SORT_COQPROJECT = sed 's,[^/]*/,~&,g' | env LC_COLLATE=C sort | sed 's,~,,g' + +FAST_TARGETS += archclean clean cleanall printenv clean-old update-_CoqProject Makefile.coq +SUPER_FAST_TARGETS += update-_CoqProject Makefile.coq -STRICT_COQDEP ?= 1 +-include Makefile.coq --include etc/coq-scripts/Makefile.coq.common +.DEFAULT_GOAL := coq update-_CoqProject:: $(SHOW)'ECHO > _CoqProject' $(HIDE)(echo '-R $(SRC_DIR) $(MOD_NAME)'; echo '-R Bedrock Bedrock'; (git ls-files 'src/*.v' 'Bedrock/*.v' | $(SORT_COQPROJECT))) > _CoqProject -clean:: - rm -f submodule-update - $(VOFILES): | coqprime # add files to this list to prevent them from being built by default @@ -51,6 +54,10 @@ clean-coqprime: install-coqprime: $(MAKE) -C $(COQPRIME_FOLDER) install +Makefile.coq: Makefile _CoqProject + $(SHOW)'COQ_MAKEFILE -f _CoqProject > $@' + $(HIDE)$(COQBIN)coq_makefile -f _CoqProject | sed s'|^\(-include.*\)$$|ifneq ($$(filter-out $(FAST_TARGETS),$$(MAKECMDGOALS)),)~\1~else~ifeq ($$(MAKECMDGOALS),)~\1~endif~endif|g' | tr '~' '\n' | sed s'/^clean:$$/clean-old::/g' | sed s'/^clean::$$/clean-old::/g' | sed s'/^Makefile: /Makefile-old: /g' > $@ + cleanall:: clean clean-coqprime rm -f .dir-locals.el diff --git a/Makefile.submodule b/Makefile.submodule deleted file mode 100644 index 78f301210..000000000 --- a/Makefile.submodule +++ /dev/null @@ -1,35 +0,0 @@ -ifneq (,$(wildcard .git)) # if we're in a git repo - -# if the submodule changed, update it -SUBMODULE_DIFF=$(shell git diff etc/coq-scripts 2>&1 | grep 'Subproject commit') -SUBMODULE_DIRTY=$(shell git diff etc/coq-scripts 2>&1 | grep dirty) -ifneq (,$(SUBMODULE_DIRTY)) -submodule-update:: - @ echo "\033[0;31mThe submodule is dirty; some scripts may fail.\033[0m" - @ echo "\033[0;31mRun (cd etc/coq-scripts && git clean -xfd && git reset --hard)\033[0m" -else -ifneq (,$(SUBMODULE_DIFF)) -submodule-update:: - git submodule sync && \ - git submodule update --init && \ - touch "$@" -endif -endif - -ifeq (,$(wildcard submodule-update)) -submodule-update:: - git submodule sync && \ - git submodule update --init && \ - touch "$@" -else -submodule-update:: -endif - -etc/coq-scripts/Makefile.coq.common etc/coq-scripts/compatibility/Makefile.coq.compat_84_85 etc/coq-scripts/compatibility/Makefile.coq.compat_84_85-early: submodule-update - @ touch "$@" -endif - -FAST_TARGETS += clean-doc etc/coq-scripts etc/coq-scripts/Makefile.coq.common etc/coq-scripts/compatibility/Makefile.coq.compat_84_85 etc/coq-scripts/compatibility/Makefile.coq.compat_84_85-early submodule-update -SUPER_FAST_TARGETS += submodule-update - -Makefile.coq: etc/coq-scripts/Makefile.coq.common etc/coq-scripts/compatibility/Makefile.coq.compat_84_85 etc/coq-scripts/compatibility/Makefile.coq.compat_84_85-early -- cgit v1.2.3