-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (43 loc) · 1 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Makefile
APP_NAME="gohyper"
BUILD_DIR="cmd/${APP_NAME}/"
TEMP_DIR="tmp/"
DB_NAME="database.db"
.PHONY: init run build clean
default: run
init:
@echo "Building Pollen.."
@pollen
@echo "Installing pnpm dependencies.."
@pnpm install
@echo "Copying env files"
@cp .env.example .env
@echo "Refresh go packages.."
@go mod tidy
@echo "Initializtion complete. Please run make run to run the project."
run:
@echo "Building Pollen.."
@pollen
@echo "Running pnpm.."
@pnpm run dev &
@echo "Running Go.."
@air
build:
@echo "Building Pollen.."
@pollen
@echo "Building pnpm tasks.."
@pnpm run build
@echo "Copying directories.."
@mkdir -p "${BUILD_DIR}"
@cp -r public "${BUILD_DIR}"
@cp -r view "${BUILD_DIR}"
@cp .env "${BUILD_DIR}.env"
@echo "Copying database.."
@cp "${DB_NAME}" "${BUILD_DIR}${DB_NAME}"
@echo "Building Go app.."
@go build -o "${BUILD_DIR}app" cmd/main.go
clean:
@echo "Cleaning ${TEMP_DIR} directory.."
@rm -rf "${TEMP_DIR}"
@echo "Cleaning building tasks.."
@rm -rf "${BUILD_DIR}"