forked from gofiber/recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
48 lines (42 loc) · 1.3 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
.PHONY: all info go-build svelte-build install-template-dependencies clean
# Default target
all: svelte-build go-build
# Print information about available commands
info:
$(info ------------------------------------------)
$(info - SvelteKit Embed App -)
$(info ------------------------------------------)
$(info This Makefile helps you manage your projects.)
$(info )
$(info Available commands:)
$(info - go-build: Build the Golang project.)
$(info - svelte-build: Build the SvelteKit project.)
$(info - all: Run all commands (SvelteBuild, GoBuild).)
$(info )
$(info Usage: make <command>)
# Build the Golang project
go-build:
@echo "=== Building Golang Project ==="
@go build -o app -v
# Build the SvelteKit project
svelte-build: install-template-dependencies
@echo "=== Building SvelteKit Project ==="
@if command -v pnpm >/dev/null; then \
pnpm run -C ./template build; \
else \
npm run --prefix ./template build; \
fi
# Install template dependencies
install-template-dependencies:
@if command -v pnpm >/dev/null; then \
pnpm install -C ./template; \
else \
npm install --prefix ./template; \
fi
# Clean build artifacts
clean:
@echo "=== Cleaning build artifacts ==="
@rm -f app
@if [ -d "./template/__svelte_build__" ]; then \
rm -rf ./template/__svelte_build__; \
fi