Skip to content

Commit

Permalink
Revert "Remove Makefile"
Browse files Browse the repository at this point in the history
This reverts commit 4021793.
  • Loading branch information
alexanderGugel committed Nov 27, 2015
1 parent 83851d1 commit 74a144f
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
50 changes: 50 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# TODO Actually we could just use `npm link`, but we don't really want to rely
# on npm. Ideally we would even check-in the dependencies, but then people
# wouldn't take us seriously.

CURRENT_DIR = $(shell pwd)
INSTALL_DIR = /usr/local/lib/node_modules
BIN_DIR = /usr/local/bin
BIN = ied
BOOTSTRAP_DIR = .bootstrap
DEPS_BIN_DIR = ./node_modules/.bin

.PHONY: install

# http://blog.jgc.org/2015/04/the-one-line-you-should-add-to-every.html
print-%: ; @echo $*=$($*)

node_modules: package.json
rm -rf node_modules $(BOOTSTRAP_DIR)
npm install
mkdir $(BOOTSTRAP_DIR)
cp package.json $(BOOTSTRAP_DIR)/package.json
cd $(BOOTSTRAP_DIR); node ../bin/cmd.js i
rm -rf node_modules
mv $(BOOTSTRAP_DIR)/node_modules node_modules
rm -rf $(BOOTSTRAP_DIR)

prepdirs:
mkdir -p $(INSTALL_DIR)
mkdir -p $(BIN_DIR)

link: uninstall prepdirs node_modules
ln -s $(CURRENT_DIR) $(INSTALL_DIR)/$(BIN)
ln -s $(INSTALL_DIR)/ied/bin/cmd.js $(BIN_DIR)/ied

install: uninstall prepdirs node_modules
cp -R $(CURRENT_DIR) $(INSTALL_DIR)/$(BIN)
ln -s $(INSTALL_DIR)/ied/bin/cmd.js $(BIN_DIR)/ied

uninstall:
rm -rf $(INSTALL_DIR)/$(BIN)
rm -f $(BIN_DIR)/$(BIN)

clean:
rm -rf $(BOOTSTRAP_DIR)

test:
$(DEPS_BIN_DIR)/mocha

dev:
$(DEPS_BIN_DIR)/mocha -w --reporter dot
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ FAQ
License
-------

Licensed under the MIT license. See [LICENSE](LICENSE.md).
Licensed under the MIT license. See [LICENSE.md].

0 comments on commit 74a144f

Please sign in to comment.