-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (50 loc) · 1.32 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Makefile
# Variables
GO_APP_NAME=server
GO_APP_PATH=./server
GO_APP_OUTPUT_PATH=../../
VUE_APP_PATH=./client
# Targets
.PHONY: all build serve clean
all: build
## Build Go and Vue applications
build: build-go build-vue
## Build Go application
build-go:
@echo "Building Go server..."
cd $(GO_APP_PATH)/cmd && go build -o $(GO_APP_OUTPUT_PATH)/$(GO_APP_NAME).exe
## Build Vue application
install-npm-dep:
@echo "Installing npm dependencies"
cd $(VUE_APP_PATH) && npm install
build-vue:
@echo "Building Vue app..."
cd $(VUE_APP_PATH) && npm run build
## Serve Go and Vue applications
serve: build-go build-vue serve-go
## Serve Go application
serve-go:
@echo "Running Go server..."
cd $(GO_APP_PATH) && $(GO_APP_NAME).exe
## Serve Vue application
serve-vue:
@echo "Running Vue development server..."
cd $(VUE_APP_PATH) && npm run serve
## Clean Go and Vue build files
clean: clean-go clean-vue
clean-go:
@echo "Cleaning Go server build..."
rm -f $(GO_APP_PATH)/$(GO_APP_NAME)
clean-vue:
@echo "Cleaning Vue build..."
rm -rf $(VUE_APP_PATH)/dist
## Help
help:
@echo "Usage:"
@echo " make [target]"
@echo ""
@echo "Targets:"
@echo " build Build Go and Vue applications"
@echo " serve Serve Go and Vue applications"
@echo " clean Clean build files"
@echo " help Show this help message"