Skip to content

Commit

Permalink
We try again.
Browse files Browse the repository at this point in the history
Revert "Reverted Makefile-related and script changes made since Mon Jan 7.  (This fixes whatever is wrong with the Web UI.)"

This reverts commit 44563e5.
  • Loading branch information
frank-trampe committed Jan 9, 2013
1 parent 3843691 commit 3364bc8
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 9 deletions.
8 changes: 6 additions & 2 deletions scripts/build_handlebars_templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
WEB_TEMP_DIR=$2/webtemp
WEB_SPLIT_DIR=$WEB_TEMP_DIR/raw_split
WEB_HANDLEBARS_DIR=$WEB_TEMP_DIR/handlebars

if [ "$TC_HANDLEBARS_EXE" = "" ] ;
then
export TC_HANDLEBARS_EXE="handlebars" ;
fi ;

mkdir -p $WEB_TEMP_DIR
mkdir -p $WEB_SPLIT_DIR
Expand Down Expand Up @@ -37,5 +40,6 @@ for file in $WEB_HANDLEBARS_DIR/*.handlebars; do
done
# -m minify, -f is the output, it takes about 2 seconds

handlebars -m $WEB_HANDLEBARS_DIR -f $3/template.js
"$TC_HANDLEBARS_EXE" -m $WEB_HANDLEBARS_DIR -f $3/template.js
rm -R $WEB_TEMP_DIR

1 change: 1 addition & 0 deletions scripts/generate_join_macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def generate_make_equality_comparable_macro(nfields):

if __name__ == "__main__":

print "// Copyright 2010-2012 RethinkDB, all rights reserved."
print "#ifndef RPC_SEMILATTICE_JOINS_MACROS_HPP_"
print "#define RPC_SEMILATTICE_JOINS_MACROS_HPP_"
print
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_rpc_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def cpre(template):
print

if __name__ == "__main__":

print "// Copyright 2010-2012 RethinkDB, all rights reserved."
print "#ifndef RPC_MAILBOX_TYPED_HPP_"
print "#define RPC_MAILBOX_TYPED_HPP_"
print
Expand Down
1 change: 1 addition & 0 deletions scripts/generate_serialize_macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def generate_impl_me_serializable_macro(nfields):

if __name__ == "__main__":

print "// Copyright 2010-2012 RethinkDB, all rights reserved."
print "#ifndef RPC_SERIALIZE_MACROS_HPP_"
print "#define RPC_SERIALIZE_MACROS_HPP_"
print
Expand Down
35 changes: 29 additions & 6 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ TC_NODE_INT_EXE:=$(SUPPORT_DIR_ABS)/usr/bin/node
TC_NPM_INT_EXE:=$(SUPPORT_DIR_ABS)/usr/bin/npm
TC_LESSC_INT_EXE:=$(SUPPORT_DIR_ABS)/toolchain/node_modules/less/bin/lessc
TC_COFFEE_INT_EXE:=$(SUPPORT_DIR_ABS)/toolchain/node_modules/coffee-script/bin/coffee
TC_HANDLEBARS_INT_EXE:=$(SUPPORT_DIR_ABS)/toolchain/node_modules/handlebars/bin/handlebars

TC_PROTOC_CFLAGS:=
INT_CHAIN_NODE:=0
Expand All @@ -349,6 +350,7 @@ TC_NODE_EXE:=$(TC_NODE_INT_EXE)
TC_NPM_EXE:=$(TC_NPM_INT_EXE)
TC_LESSC_EXE:=$(TC_LESSC_INT_EXE)
TC_COFFEE_EXE:=$(TC_COFFEE_INT_EXE)
TC_HANDLEBARS_EXE:=$(TC_HANDLEBARS_INT_EXE)
TCMALLOC_CHAIN_IF_NECESSARY:=1
else
ifeq ($(ALLOW_INTERNAL_TOOLS),1)
Expand Down Expand Up @@ -384,6 +386,11 @@ TC_COFFEE_EXE:=$(TC_COFFEE_INT_EXE)
else
TC_COFFEE_EXE:=$(shell which coffee || true)
endif
ifeq ($(shell which handlebars || true),)
TC_HANDLEBARS_EXE:=$(TC_HANDLEBARS_INT_EXE)
else
TC_HANDLEBARS_EXE:=$(shell which which handlebars || true)
endif
ifeq ($(OSX),0)
ifeq ($(shell /sbin/ldconfig -p | awk '/libtcmalloc_minimal.so /'),)
TCMALLOC_CHAIN_IF_NECESSARY:=1
Expand All @@ -394,6 +401,7 @@ TC_PROTOC_EXE:=$(shell which protoc || true)
TC_PROTOC_RUN:=$(TC_PROTOC_EXE)
TC_LESSC_EXE:=$(shell which lessc || true)
TC_COFFEE_EXE:=$(shell which coffee || true)
TC_HANDLEBARS_EXE:=$(shell which which handlebars || true)
TC_NODE_EXE:=$(shell which node || true)
TC_NPM_EXE:=$(shell which npm || true)
endif # ALLOW_INTERNAL_TOOLS
Expand Down Expand Up @@ -749,6 +757,8 @@ SERVER_UNIT_TEST_OBJS:=$(SERVER_NOMAIN_OBJS) $(OBJ_DIR)/unittest/main.o
WEB_SOURCE_DIR:=../admin
WEB_ASSETS_BUILD_DIR:=$(BUILD_DIR)/web
WEB_ASSETS_OBJ_DIR:=$(BUILD_DIR)/webobj
WEB_ASSETS:=$(WEB_ASSETS_BUILD_DIR)/cluster-min.js $(WEB_ASSETS_BUILD_DIR)/cluster.css $(WEB_ASSETS_BUILD_DIR)/index.html $(WEB_ASSETS_BUILD_DIR)/js $(WEB_ASSETS_BUILD_DIR)/fonts $(WEB_ASSETS_BUILD_DIR)/images $(WEB_ASSETS_BUILD_DIR)/favicon.ico $(WEB_ASSETS_BUILD_DIR)/js/rethinkdb.js $(WEB_ASSETS_BUILD_DIR)/js/template.js

#This atrociousness comes from the fact... fuck it blah blah blah coffee script.
#Basically coffee script can't handle dependencies.
COFFEE_SOURCES:=$(patsubst %, $(WEB_SOURCE_DIR)/static/coffee/%,\
Expand Down Expand Up @@ -815,8 +825,9 @@ endif
# High level build targets

# Frank removed $(BUILD_DIR)/$(START_DB_NAME) from this list .
# Note that drivers, as a phony target, only gets rebuilt consistently because it is a prerequisite of real file $(WEB_ASSETS_BUILD_DIR)/js/rethinkdb.js.

all: $(BUILD_DIR)/$(SERVER_EXEC_NAME) $(BUILD_DIR)/$(GDB_FUNCTIONS_NAME) web-assets drivers
all: $(BUILD_DIR)/$(SERVER_EXEC_NAME) $(BUILD_DIR)/$(GDB_FUNCTIONS_NAME) $(WEB_ASSETS) drivers
@echo " Finished building RethinkDB key-value store server version '${RETHINKDB_VERSION}'"

ifeq ($(UNIT_TESTS),1)
Expand Down Expand Up @@ -1014,7 +1025,7 @@ install-deb: install
DEBIAN_V8_VERSION:=$(shell apt-cache show libv8-dev | grep '^Version:' | sed -e 's/^Version: \\([0-9]*\\(\\.[0-9]*\\)*\\).*$$/\\1/g' || true ; )

ifeq ($(BUILD_PORTABLE),1)
build-deb-support: $(TC_LESSC_INT_EXE) $(TC_COFFEE_INT_EXE) $(V8_SRC_DIR) $(NODE_SRC_DIR) $(PROTOC_SRC_DIR) $(GPERFTOOLS_SRC_DIR) $(LIBUNWIND_SRC_DIR)
build-deb-support: $(TC_LESSC_INT_EXE) $(TC_COFFEE_INT_EXE) $(TC_HANDLEBARS_INT_EXE) $(V8_SRC_DIR) $(NODE_SRC_DIR) $(PROTOC_SRC_DIR) $(GPERFTOOLS_SRC_DIR) $(LIBUNWIND_SRC_DIR)
else
build-deb-support: $(TC_LESSC_INT_EXE) $(TC_COFFEE_INT_EXE)
endif
Expand Down Expand Up @@ -1271,10 +1282,10 @@ rpc/mailbox/typed.hpp: ../scripts/generate_rpc_templates.py
rpc/semilattice/joins/macros.hpp rpc/serialize_macros.hpp rpc/mailbox/typed.hpp:
$< > $@

web-assets: $(WEB_ASSETS_BUILD_DIR)/cluster-min.js $(WEB_ASSETS_BUILD_DIR)/cluster.css $(WEB_ASSETS_BUILD_DIR)/index.html $(WEB_ASSETS_BUILD_DIR)/js $(WEB_ASSETS_BUILD_DIR)/fonts $(WEB_ASSETS_BUILD_DIR)/images $(WEB_ASSETS_BUILD_DIR)/favicon.ico $(WEB_ASSETS_BUILD_DIR)/js/rethinkdb.js $(WEB_ASSETS_BUILD_DIR)/js/template.js
web-assets: $(WEB_ASSETS)

$(WEB_ASSETS_BUILD_DIR)/js/template.js: $(WEB_SOURCE_DIR)/static/handlebars
$(QUIET) ../scripts/build_handlebars_templates.sh $(WEB_SOURCE_DIR)/static/handlebars $(BUILD_DIR) $(WEB_ASSETS_BUILD_DIR)/js
$(WEB_ASSETS_BUILD_DIR)/js/template.js: $(WEB_SOURCE_DIR)/static/handlebars $(TC_HANDLEBARS_EXE)
$(QUIET) env TC_HANDLEBARS_EXE=$(TC_HANDLEBARS_EXE) ../scripts/build_handlebars_templates.sh $(WEB_SOURCE_DIR)/static/handlebars $(BUILD_DIR) $(WEB_ASSETS_BUILD_DIR)/js

$(WEB_ASSETS_OBJ_DIR)/cluster-min.concat.coffee: $(COFFEE_SOURCES)
$(QUIET) mkdir -p $(WEB_ASSETS_OBJ_DIR)
Expand Down Expand Up @@ -1507,7 +1518,7 @@ endif
# bug in GNU Make, possibly a bug in our Makefile.
.SECONDARY: $(PROTO_HEADERS)

NO_DEPS_TARGETS:=clean depclean tags etags analyze cscope style web-assets build-deb-src-control build-deb-support $(WEB_ASSETS_BUILD_DIR)/cluster-min.js $(WEB_ASSETS_BUILD_DIR)/cluster.css $(WEB_ASSETS_BUILD_DIR)/index.html $(WEB_ASSETS_BUILD_DIR)/js $(WEB_ASSETS_BUILD_DIR)/fonts $(WEB_ASSETS_BUILD_DIR)/images $(WEB_ASSETS_BUILD_DIR)/favicon.ico $(WEB_ASSETS_BUILD_DIR)/js/rethinkdb.js $(WEB_ASSETS_OBJ_DIR)/cluster-min.concat.coffee $(COFFEE_SOURCES) $(PROTO_DIR)/dummy $(PROTO_SOURCES) $(PROTO_HEADERS) $(PROTO_CODE) $(PROTO_DIR)/dummy $(OPROF_TARGETS) $(TC_LESSC_INT_EXE) $(TC_COFFEE_INT_EXE) $(SUPPORT_DIR) $(V8_SRC_DIR) $(V8_DIR) $(V8_LIB) $(NODE_SRC_DIR) $(NODE_DIR) $(TC_NODE_INT_EXE) $(TC_NPM_INT_EXE) $(PROTOC_SRC_DIR) $(PROTOC_DIR) $(TC_PROTOC_INT_EXE) $(GPERFTOOLS_SRC_DIR) $(GPERFTOOLS_DIR) $(LIBUNWIND_SRC_DIR) $(LIBUNWIND_DIR) $(TCMALLOC_MINIMAL_INT_LIB)
NO_DEPS_TARGETS:=clean depclean tags etags analyze cscope style web-assets build-deb-src-control build-deb-support $(WEB_ASSETS_BUILD_DIR)/cluster-min.js $(WEB_ASSETS_BUILD_DIR)/cluster.css $(WEB_ASSETS_BUILD_DIR)/index.html $(WEB_ASSETS_BUILD_DIR)/js $(WEB_ASSETS_BUILD_DIR)/fonts $(WEB_ASSETS_BUILD_DIR)/images $(WEB_ASSETS_BUILD_DIR)/favicon.ico $(WEB_ASSETS_BUILD_DIR)/js/rethinkdb.js $(WEB_ASSETS_OBJ_DIR)/cluster-min.concat.coffee $(COFFEE_SOURCES) $(PROTO_DIR)/dummy $(PROTO_SOURCES) $(PROTO_HEADERS) $(PROTO_CODE) $(PROTO_DIR)/dummy $(OPROF_TARGETS) $(TC_LESSC_INT_EXE) $(TC_COFFEE_INT_EXE) $(TC_HANDLEBARS_INT_EXE) $(SUPPORT_DIR) $(V8_SRC_DIR) $(V8_DIR) $(V8_LIB) $(NODE_SRC_DIR) $(NODE_DIR) $(TC_NODE_INT_EXE) $(TC_NPM_INT_EXE) $(PROTOC_SRC_DIR) $(PROTOC_DIR) $(TC_PROTOC_INT_EXE) $(GPERFTOOLS_SRC_DIR) $(GPERFTOOLS_DIR) $(LIBUNWIND_SRC_DIR) $(LIBUNWIND_DIR) $(TCMALLOC_MINIMAL_INT_LIB)
# Include the dependencies into the makefile so that they take effect
ifneq (,$(if $(MAKECMDGOALS),$(filter-out $(NO_DEPS_TARGETS),$(MAKECMDGOALS)),non-empty-placeholder))
-include $(DEPS)
Expand Down Expand Up @@ -1542,6 +1553,18 @@ else
@ if [ ! -e $(TC_COFFEE_INT_EXE) ] ; then echo " ERROR: Internal coffee-script is necessary but not present, and FETCH_INTERNAL_TOOLS != 1." ; false ; fi ;
endif

$(TC_HANDLEBARS_INT_EXE): $(TC_NPM_EXE)
ifeq ($(FETCH_INTERNAL_TOOLS),1)
# ifeq ($(shell npm list --global --parseable | grep '\/handlebars$$'),)
$(QUIET) if [ ! -e $(SUPPORT_DIR) ] ; then mkdir -p $(SUPPORT_DIR) ; fi ;
$(QUIET) if [ -d $(SUPPORT_DIR) ] && [ ! -e $(SUPPORT_DIR)/toolchain ] ; then mkdir -p $(SUPPORT_DIR)/toolchain ; fi ;
@echo " NPM-I handlebars"
$(QUIET) cd $(SUPPORT_DIR)/toolchain ; $(TC_NPM_EXE) install handlebars ;
# endif
else
@ if [ ! -e $(TC_HANDLEBARS_INT_EXE) ] ; then echo " ERROR: Internal handlebars is necessary but not present, and FETCH_INTERNAL_TOOLS != 1." ; false ; fi ;
endif

$(SUPPORT_DIR):
# We need to stop using this. The time-stamp causes other things to rebuild.
$(QUIET) mkdir -p $(SUPPORT_DIR) ;
Expand Down
1 change: 1 addition & 0 deletions src/rpc/mailbox/typed.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2010-2012 RethinkDB, all rights reserved.
#ifndef RPC_MAILBOX_TYPED_HPP_
#define RPC_MAILBOX_TYPED_HPP_

Expand Down
1 change: 1 addition & 0 deletions src/rpc/semilattice/joins/macros.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2010-2012 RethinkDB, all rights reserved.
#ifndef RPC_SEMILATTICE_JOINS_MACROS_HPP_
#define RPC_SEMILATTICE_JOINS_MACROS_HPP_

Expand Down
1 change: 1 addition & 0 deletions src/rpc/serialize_macros.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Copyright 2010-2012 RethinkDB, all rights reserved.
#ifndef RPC_SERIALIZE_MACROS_HPP_
#define RPC_SERIALIZE_MACROS_HPP_

Expand Down

0 comments on commit 3364bc8

Please sign in to comment.