Skip to content
This repository
Browse code

Merge branch 'dev-master' into dev-3.x

  • Loading branch information...
commit d89374d7213ad8260e5004200e8f99efd54e705b 2 parents 6dbbe4c + f1d54cf
Eric Ferraiuolo ericf authored

Showing 1 changed file with 63 additions and 0 deletions. Show diff stats Hide diff stats

  1. +63 0 src/handlebars/Makefile
63 src/handlebars/Makefile
... ... @@ -0,0 +1,63 @@
  1 +# -- Constants -----------------------------------------------------------------
  2 +
  3 +# Path to the "lib" directory of a Handlebars.js git checkout.
  4 +HANDLEBARS_LIB = $(PWD)/../../../handlebars.js/lib
  5 +
  6 +# Path to which YUI Handlebars source files should be written.
  7 +OUTPUT_DIR = $(PWD)/js
  8 +
  9 +# Comment to prepend to the imported source files.
  10 +PREPEND_COMMENT = /* THIS FILE IS GENERATED BY A BUILD SCRIPT - DO NOT EDIT! */\n
  11 +
  12 +# Files that make up the handlebars-base module. We intentionally skip utils.js
  13 +# because we've reimplemented that for YUI.
  14 +BASE_FILES = \
  15 + $(HANDLEBARS_LIB)/handlebars/base.js \
  16 + $(HANDLEBARS_LIB)/handlebars/runtime.js
  17 +
  18 +# Files that make up the handlebars-compiler module.
  19 +COMPILER_FILES = \
  20 + $(HANDLEBARS_LIB)/handlebars/compiler/parser.js \
  21 + $(HANDLEBARS_LIB)/handlebars/compiler/base.js \
  22 + $(HANDLEBARS_LIB)/handlebars/compiler/ast.js \
  23 + $(HANDLEBARS_LIB)/handlebars/compiler/compiler.js
  24 +
  25 +# -- Targets -------------------------------------------------------------------
  26 +
  27 +BASE_TARGETS = $(addprefix $(OUTPUT_DIR)/handlebars-, $(notdir $(BASE_FILES)))
  28 +COMPILER_TARGETS = $(addprefix $(OUTPUT_DIR)/handlebars-compiler-, $(notdir $(COMPILER_FILES)))
  29 +
  30 +# target: all - Default target.
  31 +all: import
  32 +
  33 +# target: clean - Removes imported source files.
  34 +clean:
  35 + rm -f $(BASE_TARGETS) $(COMPILER_TARGETS)
  36 +
  37 +# target: import - Imports Handlebars.js source files from a separate repo.
  38 +import: import-base import-compiler
  39 +
  40 +# target: import-base - Imports the source files that make up handlebars-base.
  41 +import-base: $(BASE_TARGETS)
  42 +
  43 +# target: import-compiler - Imports the source files that make up handlebars-compiler.
  44 +import-compiler: $(COMPILER_TARGETS)
  45 +
  46 +# target: help - Displays help.
  47 +help:
  48 + @egrep "^# target:" Makefile
  49 +
  50 +$(OUTPUT_DIR)/handlebars-%.js: $(HANDLEBARS_LIB)/handlebars/%.js
  51 + @echo "$(notdir $@)"
  52 + @echo "$(PREPEND_COMMENT)" > $@
  53 + @sed -n '/^\/\/ BEGIN(BROWSER)$$/,/^\/\/ END(BROWSER)$$/p' $< >> $@
  54 +
  55 +$(OUTPUT_DIR)/handlebars-compiler-%.js: $(HANDLEBARS_LIB)/handlebars/compiler/%.js
  56 + @echo "$(notdir $@)"
  57 + @echo "$(PREPEND_COMMENT)" > $@
  58 + @sed -n '/^\/\/ BEGIN(BROWSER)$$/,/^\/\/ END(BROWSER)$$/p' $< >> $@
  59 +
  60 +$(OUTPUT_DIR)/handlebars-compiler-parser.js: $(HANDLEBARS_LIB)/handlebars/compiler/parser.js
  61 + @echo "$(notdir $@)"
  62 + @echo "$(PREPEND_COMMENT)" > $@
  63 + @cat $< >> $@

0 comments on commit d89374d

Please sign in to comment.
Something went wrong with that request. Please try again.