-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
44 lines (35 loc) · 1.37 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
# Go parameters
GOCMD=go
TEMPL=templ
BUILD_DIR=./tmp
URCHIN_DIR=./cmd/urchin
URCHIN_ADMIN_DIR=./cmd/urchin-admin
# Name of the binary
BINARY_NAME=urchin
ADMIN_BINARY_NAME=urchin-admin
all: build test
prepare_env:
cp -r migrations tests/helpers/
build: prepare_env install-tailwindcss
$(TEMPL) generate
GIN_MODE=release $(GOCMD) build -ldflags "-s" -v -o $(BUILD_DIR)/$(BINARY_NAME) $(URCHIN_DIR)
GIN_MODE=release $(GOCMD) build -ldflags "-s" -v -o $(BUILD_DIR)/$(ADMIN_BINARY_NAME) $(URCHIN_ADMIN_DIR)
./tailwindcss -i ./static/css/custom.css -o ./static/css/style.css --minify
test: prepare_env
$(GOCMD) test -v ./...
clean:
$(GOCMD) clean
rm -rf $(BUILD_DIR)
# TODO: For now we support only the linux version of tailwindcss, has to be updated in the future to support Windows and MacOS as well.
install-tools:
go install github.com/pressly/goose/v3/cmd/[email protected]
go install github.com/a-h/templ/cmd/[email protected]
go install github.com/cosmtrek/[email protected]
install-tailwindcss:
if [ ! -f tailwindcss ]; then \
wget -q https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.16/tailwindcss-linux-x64 \
&& echo "33f254b54c8754f16efbe2be1de38ca25192630dc36f164595a770d4bbf4d893 tailwindcss-linux-x64" | sha256sum -c \
&& chmod +x tailwindcss-linux-x64 \
&& mv tailwindcss-linux-x64 tailwindcss; \
fi
.PHONY: all build test clean install-tailwindcss