<commit_before>#-  GNU Makefile

#-  Makefile ~~
#
#   This contains a live development workflow for QMachine. To get started on
#   Mac OS X 10.8 "Mountain Lion", you will need to install ...
#
#       ... Homebrew using directions from http://mxcl.github.com/homebrew/.
#
#       ... a minimal set of native dependencies by typing
#           $ brew install couchdb imagemagick node phantomjs
#
#       ... Node Package Manager (NPM) using directions from https://npmjs.org.
#
#       ... Kanso (if you want to use the CouchDB backend) by typing
#           $ npm install -g kanso
#
#       ... as many of the optional dependencies as you desire by typing
#           $ brew install closure-compiler jsmin qrencode yuicompressor
#
#   For a long time, icon generation from LaTeX source code was included as an
#   extra touch, but folks complained too much about the extra dependency on
#   MacTeX 2012. Consequently, the workflow now generates a green placeholder
#   directly from ImageMagick which can be overridden by your own image file
#   if you provide one. If you want to deploy to your own Heroku instance, you
#   will need to install their "Heroku Toolbelt".
#
#   Thanks for stopping by :-)
#
#                                                       ~~ (c) SRW, 10 Nov 2012

PROJ_ROOT       :=  $(realpath $(dir $(firstword $(MAKEFILE_LIST))))

include $(PROJ_ROOT)/share/macros.make

BUILD_DIR       :=  $(PROJ_ROOT)/build
CACHE_DIR       :=  $(PROJ_ROOT)/cache
ICONS_DIR       :=  $(PROJ_ROOT)/icons
SHARE_DIR       :=  $(PROJ_ROOT)/share
SRC_DIR         :=  $(PROJ_ROOT)/src
VAR_DIR         :=  $(PROJ_ROOT)/var

HEROKU_APP      :=  qmachine
LOCAL_COUCH     :=  http://localhost:5984
LOCAL_NODE      :=  http://localhost:8177
MOTHERSHIP      :=  https://$(strip $(HEROKU_APP)).herokuapp.com
PLISTS          :=  $(addprefix $(VAR_DIR)/com.QM., couchdb.plist nodejs.plist)

.PHONY: all clean clobber distclean help reset
.SILENT: ;

'': help;

all: $(shell $(LS) $(SRC_DIR))

clean: reset
	@   if [ -d "$(BUILD_DIR)/web-service/packages" ]; then             \
                $(CP) $(BUILD_DIR)/web-service/packages/ $(PROJ_ROOT)   ;   \
                $(RM) $(BUILD_DIR)                                      ;   \
                $(MKDIR) $(BUILD_DIR)                                   ;   \
                $(MKDIR) $(BUILD_DIR)/web-service                       ;   \
                $(CP) $(PROJ_ROOT)/packages $(BUILD_DIR)/web-service    ;   \
                $(RM) $(PROJ_ROOT)/packages                             ;   \
            else                                                            \
                $(RM) $(BUILD_DIR)                                      ;   \
            fi                                                          ;   \
            for each in $(PLISTS); do                                       \
                if [ -f "$${each}" ]; then                                  \
                    $(LAUNCHCTL) unload -w $${each} >/dev/null 2>&1     ;   \
                fi                                                      ;   \
            done

clobber: clean
	@   $(RM) $(CACHE_DIR) $(VAR_DIR)

distclean: clobber
	@   $(RM) $(PROJ_ROOT)/.d8_history $(PROJ_ROOT)/.v8_history     ;   \
            if [ -f "$(ICONS_DIR)/logo.pdf" ]; then                         \
                $(CP) $(ICONS_DIR)/logo.pdf $(PROJ_ROOT)/logo.pdf       ;   \
                $(RM) $(ICONS_DIR)                                      ;   \
                $(MKDIR) $(ICONS_DIR)                                   ;   \
                $(CP) $(PROJ_ROOT)/logo.pdf $(ICONS_DIR)                ;   \
                $(RM) $(PROJ_ROOT)/logo.pdf                             ;   \
            else                                                            \
                $(RM) $(ICONS_DIR)                                      ;   \
            fi

help:
	@   $(call show-usage-info)

reset:
	@   $(call contingent, clear)

###<commit_msg>Build instructions for offline development are now significantly faster<commit_after>#-  GNU Makefile

#-  Makefile ~~
#
#   This contains a live development workflow for QMachine (QM). To get started
#   on Mac OS X 10.8 "Mountain Lion" with your own local sandbox, you will need
#   to install ...
#
#       ... Homebrew using directions from http://mxcl.github.com/homebrew/.
#
#       ... a minimal set of native dependencies by typing
#           $ brew install imagemagick node
#
#       ... Node Package Manager (NPM) using directions from https://npmjs.org.
#
#   Then, to launch a local sandbox environment that uses SQLite for storage,
#   run
#
#           $ make local-sandbox
#
#   If you want to use the CouchDB backend, you will need to install CouchDB
#   (duh) as well as Kanso ...
#
#           $ brew install couchdb
#           $ npm install -g kanso
#
#   ... before running the following command to launch the CouchDB sandbox:
#
#           $ make local-couch
#
#   QMachine also supports MongoDB and PostgreSQL for persistent storage, but
#   I have not automated those variants and have to plans to do so. Other
#   dependencies for other tasks, some of which are optional, can be installed
#   via
#
#           $ brew install closure-compiler jsmin mongodb qrencode \
#               phantomjs yuicompressor
#
#   For a long time, icon generation from LaTeX source code was included as an
#   extra touch, but folks complained too much about the extra dependency on
#   MacTeX 2012. Consequently, the workflow now generates a green placeholder
#   directly from ImageMagick which can be overridden by your own image file
#   if you provide one. If you want to deploy to your own Heroku instance, you
#   will need to install the Heroku-provided "Heroku Toolbelt".
#
#   Thanks for stopping by :-)
#
#                                                       ~~ (c) SRW, 12 Nov 2012

PROJ_ROOT       :=  $(realpath $(dir $(firstword $(MAKEFILE_LIST))))

include $(PROJ_ROOT)/share/macros.make

BUILD_DIR       :=  $(PROJ_ROOT)/build
CACHE_DIR       :=  $(PROJ_ROOT)/cache
ICONS_DIR       :=  $(PROJ_ROOT)/icons
SHARE_DIR       :=  $(PROJ_ROOT)/share
SRC_DIR         :=  $(PROJ_ROOT)/src
VAR_DIR         :=  $(PROJ_ROOT)/var

HEROKU_APP      :=  qmachine
LOCAL_COUCH     :=  http://localhost:5984
LOCAL_NODE      :=  http://localhost:8177
MOTHERSHIP      :=  https://$(strip $(HEROKU_APP)).herokuapp.com
PLISTS          :=  $(addprefix $(VAR_DIR)/com.QM., couchdb.plist nodejs.plist)

.PHONY: all clean clobber distclean help reset
.SILENT: ;

'': help;

all: $(shell $(LS) $(SRC_DIR))

clean: reset
	@   for each in $(PLISTS); do                                       \
                if [ -f "$${each}" ]; then                                  \
                    $(LAUNCHCTL) unload -w $${each} >/dev/null 2>&1     ;   \
                fi                                                      ;   \
            done                                                        ;   \
            $(RM) $(VAR_DIR)

clobber: clean
	@   if [ -d "$(BUILD_DIR)/web-service/packages" ]; then             \
                $(CP) $(BUILD_DIR)/web-service/packages/ $(PROJ_ROOT)   ;   \
                $(RM) $(BUILD_DIR)                                      ;   \
                $(MKDIR) $(BUILD_DIR)                                   ;   \
                $(MKDIR) $(BUILD_DIR)/web-service                       ;   \
                $(CP) $(PROJ_ROOT)/packages $(BUILD_DIR)/web-service    ;   \
                $(RM) $(PROJ_ROOT)/packages                             ;   \
            else                                                            \
                $(RM) $(BUILD_DIR)                                      ;   \
            fi                                                          ;   \
            $(RM) $(CACHE_DIR)

distclean: clobber
	@   $(RM) $(PROJ_ROOT)/.d8_history $(PROJ_ROOT)/.v8_history     ;   \
            if [ -f "$(ICONS_DIR)/logo.pdf" ]; then                         \
                $(CP) $(ICONS_DIR)/logo.pdf $(PROJ_ROOT)/logo.pdf       ;   \
                $(RM) $(ICONS_DIR)                                      ;   \
                $(MKDIR) $(ICONS_DIR)                                   ;   \
                $(CP) $(PROJ_ROOT)/logo.pdf $(ICONS_DIR)                ;   \
                $(RM) $(PROJ_ROOT)/logo.pdf                             ;   \
            else                                                            \
                $(RM) $(ICONS_DIR)                                      ;   \
            fi

help:
	@   $(call show-usage-info)

reset:
	@   $(call contingent, clear)

###
{'fraction_non_alphanumeric': 0.11018518518518519, 'fraction_numerical': 0.005787037037037037, 'mean_word_length': 1.2490890161374284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 40, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1574476', 'n_tokens_mistral': 2480, 'n_tokens_neox': 2327, 'n_words': 658}