Source

tmsu / Makefile

Full commit
Paul Ruane 4e9172d 

Paul Ruane 0ddb207 
Paul Ruane 5c61fa7 
Paul Ruane 4e9172d 


Paul Ruane 4feb124 
Paul Ruane 7d4c23f 
Paul Ruane e39aa6d 
Paul Ruane 4ac5ee0 


Paul Ruane 6bf96e1 
Paul Ruane ed8a7f4 
Paul Ruane 8e546ea 
Paul Ruane 31037ce 


Paul Ruane 8e546ea 
Paul Ruane 4e9172d 

Paul Ruane 4ac5ee0 
Paul Ruane 31037ce 


Paul Ruane 3767ddb 
Paul Ruane 7d4c23f 

Paul Ruane 4e9172d 

Paul Ruane 2e0732c 
Paul Ruane 31037ce 
Paul Ruane 5ffd033 
Paul Ruane 2e0732c 
Paul Ruane 7d4c23f 
Paul Ruane 4ac5ee0 






Paul Ruane 8e38eb9 
Paul Ruane 4ac5ee0 


Paul Ruane 2e0732c 
Paul Ruane 6bf96e1 
Paul Ruane b4e2b66 
Paul Ruane 4e9172d 
Paul Ruane b4e2b66 


Paul Ruane 0ddb207 
Paul Ruane 8e38eb9 
Paul Ruane b4e2b66 
Paul Ruane 4e9172d 

Paul Ruane 6bf96e1 

Paul Ruane b4e2b66 
Paul Ruane 4e9172d 
Paul Ruane b4e2b66 
Paul Ruane 4e9172d 
Paul Ruane b4e2b66 
Paul Ruane 0ddb207 
Paul Ruane b4e2b66 
Paul Ruane 4e9172d 
# installation paths
INSTALL_DIR=/usr/bin
MOUNT_INSTALL_DIR=/usr/sbin
MAN_INSTALL_DIR=/usr/share/man/man1
ZSH_COMP_INSTALL_DIR=/usr/share/zsh/site-functions

# other vars
VER=0.4.1
SHELL=/bin/sh
ARCH=$(shell uname -m)
DIST_NAME=tmsu-$(ARCH)-$(VER)
DIST_DIR=$(DIST_NAME)
DIST_FILE=$(DIST_NAME).tgz

export GOPATH:=$(GOPATH):$(PWD)

all: clean generate compile dist test

clean:
	go clean tmsu
	rm -f src/tmsu/common/version.gen.go
	rm -Rf bin
	rm -Rf $(DIST_DIR)
	rm -f $(DIST_FILE)

generate:
	echo "package common; var Version = \"$(VER)\"" >src/tmsu/common/version.gen.go

compile: generate
	@mkdir -p bin
	go build -o bin/tmsu tmsu

test: compile
	go test tmsu/...

dist: compile
	@mkdir -p $(DIST_DIR)
	cp -R bin $(DIST_DIR)
	cp README.md $(DIST_DIR)
	cp COPYING $(DIST_DIR)
	@mkdir -p $(DIST_DIR)/bin
	cp misc/bin/mount.tmsu $(DIST_DIR)/bin/
	@mkdir -p $(DIST_DIR)/man
	gzip -fc misc/man/tmsu.1 >$(DIST_DIR)/man/tmsu.1.gz
	@mkdir -p $(DIST_DIR)/misc/zsh
	cp misc/zsh/_tmsu $(DIST_DIR)/misc/zsh/
	tar czf $(DIST_FILE) $(DIST_DIR)

install:
	@echo "* Installing TMSU"
	cp bin/tmsu $(INSTALL_DIR)
	@echo "* Installing 'mount' command support"
	cp misc/bin/mount.tmsu $(MOUNT_INSTALL_DIR)
	@echo "* Installing man page"
	mkdir -p $(MAN_INSTALL_DIR)
	gzip -fc misc/man/tmsu.1 >$(MAN_INSTALL_DIR)/tmsu.1.gz
	@echo "* Installing Zsh completion"
	mkdir -p $(ZSH_COMP_INSTALL_DIR)
	cp misc/zsh/_tmsu $(ZSH_COMP_INSTALL_DIR)

uninstall:
	@echo "* Uninstalling TMSU"
	rm $(INSTALL_DIR)/tmsu
	@echo "* Uninstalling mount support"
	rm $(MOUNT_INSTALL_DIR)/mount.tmsu
	@echo "* Uninstalling man page"
	rm $(MAN_INSTALL_DIR)/tmsu.1.gz
	@echo "* Uninstalling Zsh completion"
	rm $(ZSH_COMP_INSTALL_DIR)/_tmsu