-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (32 loc) · 1.21 KB
/
Copy pathMakefile
File metadata and controls
39 lines (32 loc) · 1.21 KB
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
# ozwell-studio-launcher server
#
# make deps install dependencies (server + client)
# make build build the client bundle the server serves
# make install install to $(DESTDIR)$(PREFIX) (default /opt/ozwell-studio-launcher)
# make dev run the server with auto-reload + client rebuild on change
PREFIX ?= /opt/ozwell-studio-launcher
LIBDIR ?= /usr/lib
DESTDIR ?=
.PHONY: deps build install dev
deps: node_modules
$(MAKE) -C client deps
node_modules: package.json package-lock.json
npm ci
touch node_modules
build:
$(MAKE) -C client build
install: build
mkdir -p $(DESTDIR)$(PREFIX)
cp -r src package.json package-lock.json $(DESTDIR)$(PREFIX)/
cd $(DESTDIR)$(PREFIX) && npm ci --omit=dev
$(MAKE) -C client install DESTDIR=$(DESTDIR) PREFIX=$(PREFIX)
mkdir -p $(DESTDIR)$(LIBDIR)/systemd/system
sed 's|@PREFIX@|$(PREFIX)|g' \
contrib/ozwell-studio-launcher.service.in \
> $(DESTDIR)$(LIBDIR)/systemd/system/ozwell-studio-launcher.service
# Server restarts on source changes (node --watch); the client is rebuilt
# on change by vite build --watch, so the served dist/ stays fresh.
dev: node_modules
trap 'kill 0' EXIT INT TERM; \
$(MAKE) -C client watch & \
node --watch src/server.js