refactor: project structure, makefile
This commit is contained in:
10
Makefile
10
Makefile
@@ -1,5 +1,5 @@
|
|||||||
APP_NAME := autoattendance
|
APP_NAME := autoattendance
|
||||||
SRC_DIR := src
|
SRC_DIR := ./
|
||||||
BUILD_DIR := bin
|
BUILD_DIR := bin
|
||||||
CMD_PATH := ./cmd
|
CMD_PATH := ./cmd
|
||||||
|
|
||||||
@@ -28,11 +28,11 @@ $(shell $(MKDIR) $(BUILD_DIR))
|
|||||||
all: tidy test build
|
all: tidy test build
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@cd $(SRC_DIR) && $(GOBUILD) -o ../$(BINARY_NAME) $(CMD_PATH)
|
@cd $(SRC_DIR) && $(GOBUILD) -o $(BINARY_NAME) $(CMD_PATH)
|
||||||
@echo "Build complete: $(BINARY_NAME)"
|
@echo "Build complete: $(BINARY_NAME)"
|
||||||
|
|
||||||
run: build
|
run: build
|
||||||
@./$(BINARY_NAME)
|
@$(BINARY_NAME)
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@cd $(SRC_DIR) && $(GOTEST) ./...
|
@cd $(SRC_DIR) && $(GOTEST) ./...
|
||||||
@@ -50,8 +50,8 @@ help:
|
|||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
@$(MKDIR) $(BUILD_DIR)
|
@$(MKDIR) $(BUILD_DIR)
|
||||||
@cd $(SRC_DIR) && GOOS=linux GOARCH=amd64 $(GOBUILD) -o ../$(BUILD_DIR)/$(APP_NAME)-linux $(CMD_PATH)
|
@cd $(SRC_DIR) && GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BUILD_DIR)/$(APP_NAME)-linux $(CMD_PATH)
|
||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
@$(MKDIR) $(BUILD_DIR)
|
@$(MKDIR) $(BUILD_DIR)
|
||||||
@cd $(SRC_DIR) && GOOS=windows GOARCH=amd64 $(GOBUILD) -o ../$(BUILD_DIR)/$(APP_NAME).exe $(CMD_PATH)
|
@cd $(SRC_DIR) && GOOS=windows GOARCH=amd64 $(GOBUILD) -o $(BUILD_DIR)/$(APP_NAME).exe $(CMD_PATH)
|
||||||
|
|||||||
Reference in New Issue
Block a user