summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile86
-rwxr-xr-xbuild30
2 files changed, 30 insertions, 86 deletions
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 98c8927..0000000
--- a/Makefile
+++ /dev/null
@@ -1,86 +0,0 @@
-# Makefile for 6.945
-# Copyright (C) 2013 Benjamin Barenblat <bbaren@mit.edu>
-#
-# This file is a part of 6.947.
-#
-# 6.947 is is free software: you can redistribute it and/or modify it under the
-# terms of the GNU Affero General Public License as published by the Free
-# Software Foundation, either version 3 of the License, or (at your option) any
-# later version.
-#
-# 6.947 is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
-# details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with 6.947. If not, see <http://www.gnu.org/licenses/>.
-
-# This Makefile is intended to build a CGI executable for use on the MIT SIPB's
-# Scripts service. Attempting to build elsewhere will require modifications.
-
-
-################################ Configuration ################################
-
-UR = urweb
-URFLAGS = -protocol cgi -static
-
-PROJECT = site
-PROJECTFLAGS =
-
-
-################################### Utility ###################################
-
-# Verbosity controls
-ifeq ($(V),1)
-at =
-ech = @true
-else
-ech = @echo
-at = @
-endif
-
-project_structures = $(addsuffix .ur, \
- $(shell if grep --silent '^$$' $(1).urp; \
- then sed '1,/^$$/d' $(1).urp; \
- else cat $(1).urp; fi))
-project_signatures = $(addsuffix .urs, \
- $(shell if grep --silent '^$$' $(1).urp; \
- then sed '1,/^$$/d' $(1).urp; \
- else cat $(1).urp; fi))
-project_deps = $(call project_signatures,$(1)) $(call project_structures,$(1))
-
-
-################################### Targets ###################################
-
-all: $(PROJECT).exe
-
-$(PROJECT).exe: $(PROJECT).urp $(call project_deps,$(PROJECT))
- $(ech) " URWEB $@"
- $(at)$(UR) $(URFLAGS) $(PROJECT)
-
-clean:
- $(ech) " RM $(PROJECT).exe"
- $(at)$(RM) $(PROJECT).exe
-
-
-serve: $(PROJECT).exe
- $(ech) " EXEC $(PROJECT).exe"
- $(at)./$(PROJECT).exe $(PROJECTFLAGS)
-
-# Normally, we'd use inotify for this, but AFS doesn't like inotify, so we get
-# to use this nasty hack.
-cont: continual
-continual: $(PROJECT).exe
- @while true; do \
- sums=$$(sha256sum $(PROJECT).urp $(call project_deps,$(PROJECT))); \
- $(MAKE) --no-print-directory all V=$(V); \
- newsums=$$(sha256sum $(PROJECT).urp $(call project_deps,$(PROJECT))); \
- while [ "$$sums" = "$$newsums" ]; do \
- sleep 1; \
- newsums=$$(sha256sum $(PROJECT).urp $(call project_deps,$(PROJECT))); \
- done; \
- done
-
-
-.PHONY: all clean cont continual serve
diff --git a/build b/build
new file mode 100755
index 0000000..68eb99f
--- /dev/null
+++ b/build
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Build script for 6.947
+# Copyright (C) 2013 Benjamin Barenblat <bbaren@mit.edu>
+#
+# This file is a part of 6.947.
+#
+# 6.947 is is free software: you can redistribute it and/or modify it under the
+# terms of the GNU Affero General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
+#
+# 6.947 is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with 6.947. If not, see <http://www.gnu.org/licenses/>.
+
+# This build script is intended to build a CGI executable for use on the MIT
+# SIPB's Scripts service. Attempting to build elsewhere will require
+# modifications.
+#
+# This used to be done with a Makefile, but 'urweb' is a whole-program compiler
+# anyway, so a Makefile is a bit silly.
+
+cd `hg root`
+. /mit/bbaren/ur/setup.sh
+
+urweb -protocol cgi -static site