refactor: project structure, makefile

This commit is contained in:
2025-11-25 18:25:06 +03:00
parent d367dd0909
commit e5fe816325
13 changed files with 996 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
APP_NAME := autoattendance
SRC_DIR := src
SRC_DIR := ./
BUILD_DIR := bin
CMD_PATH := ./cmd
@@ -28,11 +28,11 @@ $(shell $(MKDIR) $(BUILD_DIR))
all: tidy test 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)"
run: build
@./$(BINARY_NAME)
@$(BINARY_NAME)
test:
@cd $(SRC_DIR) && $(GOTEST) ./...
@@ -50,8 +50,8 @@ help:
build-linux:
@$(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:
@$(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)