[go: nahoru, domu]

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

enhance makefile for install/uninstall #3

Closed
wants to merge 1 commit into from
Closed
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
enhance makefile for install/uninstall
  • Loading branch information
yorkie committed May 26, 2014
commit b740359f08cd55732a1410b4d6b102763a0e541b
18 changes: 11 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@

BIN ?= bpkg
PREFIX ?= /usr/local
CMDS = json install package term
CMDS = json install package term suggest

install: uninstall
install $(BIN) $(PREFIX)/bin
for cmd in $(CMDS); do cp $(BIN)-$${cmd} $(PREFIX)/bin; done
cd ./lib/term && make install
cp ./lib/json/JSON.sh $(PREFIX)/bin/JSON.sh
install $(BIN) $(PREFIX)/bin
for cmd in $(CMDS); do cp $(BIN)-$${cmd} $(PREFIX)/bin; done

uninstall:
rm -f $(PREFIX)/bin/$(BIN)
for cmd in $(CMDS); do rm -f $(PREFIX)/bin/$(BIN)-$${cmd}; done
cd ./lib/term && make uninstall
rm -f $(PREFIX)/bin/JSON.sh
rm -f $(PREFIX)/bin/$(BIN)
for cmd in $(CMDS); do rm -f $(PREFIX)/bin/$(BIN)-$${cmd}; done

link: uninstall
ln -s $(BIN) $(PREFIX)/bin/$(BIN)
for cmd in $(CMDS); do ln -s $(BIN)-$${cmd} $(PREFIX)/bin; done
ln -s $(BIN) $(PREFIX)/bin/$(BIN)
for cmd in $(CMDS); do ln -s $(BIN)-$${cmd} $(PREFIX)/bin; done

unlink: uninstall