66 lines
1.4 KiB
Makefile
66 lines
1.4 KiB
Makefile
TMUX_SESSION=knowyt
|
|
VERSION=v$(shell grep version client/package.json | cut -d\" -f4)
|
|
|
|
.PHONY: info run-all run-server run-client run-tmux build podman clean
|
|
|
|
info:
|
|
@echo available targets:
|
|
@perl -ne 'm/^([\w\-]+):/ && print(" $$1\n");' Makefile
|
|
|
|
setup
|
|
@echo "I checking for tools"
|
|
@for binary in go tmux node yarn npx podman; do \
|
|
echo -n " $$binary: " ; \
|
|
if ! which "$$binary"; then \
|
|
echo "not found" ;\
|
|
exit 1 ;\
|
|
fi ;\
|
|
done
|
|
@echo "I installing client dependencies"
|
|
( cd client && yarn install )
|
|
@echo "I installing server dependencies"
|
|
$(MAKE) -C server setup
|
|
@echo "I create client output directory"
|
|
mkdir -p client/.output/public/
|
|
|
|
run-all:
|
|
pexec -R -c -e TARGET \
|
|
-r run-client \
|
|
-r run-server \
|
|
-- $(MAKE) '$$TARGET'
|
|
|
|
run-tmux:
|
|
tmux start-server
|
|
-tmux kill-session -t "$(TMUX_SESSION)"
|
|
tmux new-session -d -s "$(TMUX_SESSION)"
|
|
tmux send-keys "make run-client" C-m
|
|
tmux splitw -v -l 5
|
|
tmux send-keys "make run-server" C-m
|
|
tmux attach-session -t "$(TMUX_SESSION)"
|
|
|
|
run-client:
|
|
(cd client/ && yarn dev)
|
|
|
|
run-server:
|
|
$(MAKE) -C server run-loop
|
|
|
|
build:
|
|
echo $(VERSION)
|
|
(cd client/ && yarn generate)
|
|
$(MAKE) -C server build
|
|
$(MAKE) -C podman build save VERSION="$(VERSION)"
|
|
|
|
podman-run:
|
|
$(MAKE) -C podman run
|
|
|
|
run-standalone:
|
|
$(MAKE) -C server run-standalone
|
|
|
|
clean:
|
|
rm -rf client/.output/
|
|
rm -rf client/.nuxt/
|
|
$(MAKE) -C server clean
|
|
|
|
reset-data:
|
|
rm -rf server/data/
|
|
git checkout server/data/
|