Skip to content

Commit

Permalink
Replace the build and release scripts by a Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertAudi committed Jun 2, 2019
1 parent 4635e8f commit 6c99338
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 50 deletions.
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
SHELL = /bin/bash

BUILD_DIR := ./build
DIST_DIR := ./dist
SRC_DIR := ./src
BIN_NAME := tsm
BIN_DIR := $(DIST_DIR)/bin
FUNCTIONS_DIR := $(DIST_DIR)/functions

FILES := shebang logo setup $(addsuffix /*,core utils helpers commands) main tsm
SRC_FILES := $(addsuffix .zsh,$(addprefix $(SRC_DIR)/,$(FILES)))
COMPLETION_FILE := ./share/zsh/_tsm
VERSION_FILE := VERSION.txt

all: build

.PHONY: release
release: build
@mkdir -p -m 700 $(BIN_DIR) $(FUNCTIONS_DIR)
@cp -f $(BUILD_DIR)/$(BIN_NAME) $(BIN_DIR)/$(BIN_NAME)
@cp -f $(COMPLETION_FILE) $(FUNCTIONS_DIR)/
@$(BIN_DIR)/$(BIN_NAME) version > $(VERSION_FILE)

.PHONY: build
build: $(SRC_FILES)
@mkdir -p -m 700 $(BUILD_DIR)
@awk 'FNR==1 && NR > 1 {print ""}{print}' $(SRC_FILES) > $(BUILD_DIR)/$(BIN_NAME)
@chmod a+x $(BUILD_DIR)/$(BIN_NAME)

.PHONY: clean
clean:
rm -rf $(BUILD_DIR)
16 changes: 0 additions & 16 deletions tools/build.zsh

This file was deleted.

34 changes: 0 additions & 34 deletions tools/release.zsh

This file was deleted.

0 comments on commit 6c99338

Please sign in to comment.