Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix makefile #5

Open
wants to merge 5 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 14 additions & 43 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,70 +1,41 @@
BOWER ?= node_modules/.bin/bower
JSHINT ?= node_modules/.bin/jshint
PEGJS ?= node_modules/.bin/pegjs
PHANTOMJS ?= node_modules/.bin/phantomjs
BINDIR ?= .bundle/bin
# XXX: See stamp-bundler below.
# BUNDLE ?= $(BINDIR)/bundle
BUNDLE ?= bundle

PATTERNS = src/bower_components/patternslib
SOURCES = $(wildcard $(PATTERNS)/src/*.js) $(wildcard $(PATTERNS)/src/pat/*.js) $(wildcard $(PATTERNS)/src/lib/*.js)
BUNDLES = bundles/patterns.js bundles/patterns.min.js

GENERATED = $(PATTERNS)/src/lib/depends_parse.js

JSHINTEXCEPTIONS = $(GENERATED) \
$(PATTERNS)/src/lib/dependshandler.js \
$(PATTERNS)/src/lib/htmlparser.js \
$(PATTERNS)/src/pat/skeleton.js
CHECKSOURCES = $(filter-out $(JSHINTEXCEPTIONS),$(SOURCES))

RELEASE = $(shell git describe --tags)
RELEASE_DIR = release/prototype
RELEASE_TARBALL = release/prototype-$(RELEASE).tar.gz

# This directory is relative to ./prototype dir.
DIAZO_DIR = ../src/unibw/theme/static

LATEST = $(shell cat LATEST)
BUNDLE ?= $(BUNDLER_BIN_DIR)/bundle
BUNDLEPLONEID = casc
BUNDLEDISTNAME = casc-bundle
BUNDLEDISTURL = https://products.syslab.com/packages/$(BUNDLEDISTNAME)/$(LATEST)/$(BUNDLEDISTNAME)-$(LATEST).tar.gz
BUNDLER ?= $(BUNDLER_BIN_DIR)/bundler
BUNDLER_BIN_DIR ?= $(BUNDLER_DIR)/bin
BUNDLER_DIR ?= .bundle


all:: jekyll
default: all

########################################################################
## Install dependencies

stamp-bundler:
mkdir -p $(BUNDLER_BIN_DIR) && gem install --user-install bundler -v 2.1.4 --bindir=$(BUNDLER_BIN_DIR) --no-wrappers 2>&1 | grep -Ev 'PATH|not run'
$(BUNDLER) install --path $(BUNDLER_DIR)
touch stamp-bundler

stamp-npm: package.json
npm install
touch stamp-npm

stamp-bower: stamp-npm
$(BOWER) install
touch stamp-bower

clean::
rm -rf stamp-npm stamp-bower stamp-bundler node_modules src/bower_components bundles/*

extra-clean:: clean
rm -rf ~/.cache/bower
rm -rf stamp-npm stamp-bundler .bundler/ node_modules bundles/*


########################################################################
## Bundle generation

build: jekyll
jekyll: #fetchrelease stamp-bundler
jekyll: stamp-bundler
$(BUNDLE) exec jekyll build

dev: stamp-bower jekyll
dev: stamp-npm jekyll
# Set up development environment
rm -rf _site/bundles
ln -s ../src _site/bundles
rm -f _site/bundles/$(BUNDLEPLONEID).js
ln -s bower_components/requirejs/require.js _site/bundles/$(BUNDLEPLONEID).js
rm -f _site/main.js
cp main.js src/main.js
sed -i -e "s|baseUrl: 'src',|baseUrl: '/bundles/',|" src/main.js
Expand All @@ -84,4 +55,4 @@ node_modules/.bin/grunt:
bundle: node_modules/.bin/grunt
node_modules/.bin/grunt

.PHONY: all bundle extra-clean clean jshint check-clean release serve
.PHONY: all bundle clean serve
2 changes: 1 addition & 1 deletion js/unibw.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/unibw.min.js.map

Large diffs are not rendered by default.