Commits

Paul Ruane committed 6bf96e1

Update ignore file to reflect src path changes.
Added 'install' and 'uninstall' make file targets.

  • Participants
  • Parent commits fcefb9e

Comments (0)

Files changed (3)

 \.a$
 \.8$
 \.6$
-^src/tmsu/tmsu$
+^src/main/tmsu$
 \.tgz$
-^src/tmsu/version.go
+^src/main/version.gen.go
 ^bin
 SHELL=/bin/sh
 VER=0.0.3
 
+SRC_DIR=src/main
+BIN_DIR=bin
+DIST_DIR=tmsu-$(VER)
+INSTALL_DIR=/usr/bin
+
+BIN_FILE=tmsu
+VER_FILE=version.gen.go
+DIST_FILE=tmsu-$(VER).tgz
+
 all: clean generate compile
 
 compile: generate
-	cd src/tmsu; gomake
-	mkdir -p bin
-	cp src/tmsu/tmsu bin
+	cd $(SRC_DIR); gomake
+	mkdir -p $(BIN_DIR)
+	cp $(SRC_DIR)/$(BIN_FILE) $(BIN_DIR)
 
 generate:
-	echo "package main; var version = \"$(VER)\"" >src/tmsu/version.go
+	echo "package main; var version = \"$(VER)\"" >$(SRC_DIR)/$(VER_FILE)
 
 dist: compile
-	mkdir -p tmsu-$(VER)
-	cp -R bin tmsu-$(VER)
-	cp LICENSE README tmsu-$(VER)
-	tar czf tmsu-$(VER).tgz tmsu-$(VER)
-	rm -Rf tmsu-$(VER)
+	mkdir -p $(DIST_DIR)
+	cp -R $(BIN_DIR) $(DIST_DIR)
+	cp LICENSE README $(DIST_DIR)
+	tar czf $(DIST_FILE) $(DIST_DIR)
+	rm -Rf $(DIST_DIR)
 
 clean:
-	rm -f src/tmsu/version.go
-	rm -Rf bin
-	rm -Rf tmsu-$(VER)
-	rm -Rf tmsu-$(VER).tgz
+	rm -f $(SRC_DIR)/$(VER_FILE)
+	rm -f $(SRC_DIR)/$(BIN_FILE)
+	rm -f $(SRC_DIR)/*.8
+	rm -Rf $(BIN_DIR)
+	rm -Rf $(DIST_DIR)
+	rm -Rf $(DIST_FILE)
+
+install:
+	cp $(BIN_DIR)/$(BIN_FILE) $(INSTALL_DIR)
+
+uninstall:
+	rm $(INSTALL_DIR)/$(BIN_NAME)

File src/main/Makefile

 TARG=tmsu
 GOFILES=config.go \
 		main.go \
-		version.go \
+		version.gen.go \
 		command.go \
 		commands/help.go \
 		commands/mount.go \