diff --git a/LICENSE_HEADER b/LICENSE_HEADER new file mode 100644 index 000000000..06764a69c --- /dev/null +++ b/LICENSE_HEADER @@ -0,0 +1,8 @@ +/* + * popcorn.js version @VERSION + * http://popcornjs.org + * + * Copyright 2011, Mozilla Foundation + * Licensed under the MIT license + */ + diff --git a/Makefile b/Makefile index 73f111bf3..2b5fe8a90 100644 --- a/Makefile +++ b/Makefile @@ -55,6 +55,9 @@ POPCORN_COMPLETE_LIST := --js ${POPCORN_SRC} \ POPCORN_COMPLETE_DIST = ${DIST_DIR}/popcorn-complete.js POPCORN_COMPLETE_MIN = ${DIST_DIR}/popcorn-complete.min.js +# Create a versioned license header for js files we ship: arg1=source arg2=dest +add_license = cat ${PREFIX}/LICENSE_HEADER | sed -e 's/@VERSION/${VERSION}/' > $(2) ; \ + cat $(1) >> $(2) all: lint lint-plugins lint-parsers lint-players popcorn plugins parsers players complete min @@echo "Popcorn build complete." @@ -66,23 +69,28 @@ popcorn: ${POPCORN_DIST} ${POPCORN_DIST}: ${POPCORN_SRC} | ${DIST_DIR} @@echo "Building" ${POPCORN_DIST} - @@cat ${POPCORN_SRC} | sed -e 's/@VERSION/${VERSION}/' > ${POPCORN_DIST} + @@$(call add_license, $(POPCORN_SRC), $(POPCORN_DIST)) +# @@cat ${POPCORN_SRC} | sed -e 's/@VERSION/${VERSION}/' > ${POPCORN_DIST} min: ${POPCORN_MIN} ${PLUGINS_MIN} ${PARSERS_MIN} ${PLAYERS_MIN} ${POPCORN_COMPLETE_MIN} ${POPCORN_MIN}: ${POPCORN_DIST} @@echo "Building" ${POPCORN_MIN} - $(call compile, --js ${POPCORN_DIST}, ${POPCORN_MIN}) + @@$(call compile, --js ${POPCORN_DIST}, ${POPCORN_MIN}.tmp) + @@$(call add_license, ${POPCORN_MIN}.tmp, ${POPCORN_MIN}) + @@rm ${POPCORN_MIN}.tmp ${POPCORN_COMPLETE_MIN}: ${POPCORN_SRC} ${PLUGINS_SRC} ${PARSERS_SRC} ${DIST_DIR} @@echo "Building" ${POPCORN_COMPLETE_MIN} - @@$(call compile, ${POPCORN_COMPLETE_LIST}, ${POPCORN_COMPLETE_MIN}) + @@$(call compile, ${POPCORN_COMPLETE_LIST}, ${POPCORN_COMPLETE_MIN}.tmp) + @@$(call add_license, ${POPCORN_COMPLETE_MIN}.tmp, ${POPCORN_COMPLETE_MIN}) + @@rm ${POPCORN_COMPLETE_MIN}.tmp plugins: ${PLUGINS_DIST} ${PLUGINS_MIN}: ${PLUGINS_DIST} @@echo "Building" ${PLUGINS_MIN} - $(call compile, $(shell for js in ${PLUGINS_SRC} ; do echo --js $$js ; done), ${PLUGINS_MIN}) + @@$(call compile, $(shell for js in ${PLUGINS_SRC} ; do echo --js $$js ; done), ${PLUGINS_MIN}) ${PLUGINS_DIST}: ${PLUGINS_SRC} ${DIST_DIR} @@echo "Building ${PLUGINS_DIST}" @@ -92,7 +100,7 @@ parsers: ${PARSERS_DIST} ${PARSERS_MIN}: ${PARSERS_DIST} @@echo "Building" ${PARSERS_MIN} - $(call compile, $(shell for js in ${PARSERS_SRC} ; do echo --js $$js ; done), ${PARSERS_MIN}) + @@$(call compile, $(shell for js in ${PARSERS_SRC} ; do echo --js $$js ; done), ${PARSERS_MIN}) ${PARSERS_DIST}: ${PARSERS_SRC} ${DIST_DIR} @@echo "Building ${PARSERS_DIST}" @@ -102,7 +110,7 @@ players: ${PLAYERS_DIST} ${PLAYERS_MIN}: ${PLAYERS_DIST} @@echo "Building" ${PLAYERS_MIN} - $(call compile, $(shell for js in ${PLAYERS_SRC} ; do echo --js $$js ; done), ${PLAYERS_MIN}) + @@$(call compile, $(shell for js in ${PLAYERS_SRC} ; do echo --js $$js ; done), ${PLAYERS_MIN}) ${PLAYERS_DIST}: ${PLAYERS_SRC} ${DIST_DIR} @@echo "Building ${PLAYERS_DIST}" diff --git a/popcorn.js b/popcorn.js index 0372d8f56..6555f625a 100644 --- a/popcorn.js +++ b/popcorn.js @@ -1,11 +1,3 @@ -/* - * popcorn.js version @VERSION - * http://popcornjs.org - * - * Copyright 2011, Mozilla Foundation - * Licensed under the MIT license - */ - (function(global, document) { // Cache refs to speed up calls to native utils