Files

90 lines
2.0 KiB
Makefile
Raw Permalink Normal View History

PORT?=8080
2025-03-05 10:05:21 -03:00
lint:
golangci-lint run .
2025-03-05 10:05:21 -03:00
fmt:
go fmt .
golangci-lint run --fix .
2025-03-06 10:02:35 -03:00
dev/server:
go run github.com/joho/godotenv/cmd/godotenv@v1.5.1 \
2025-03-05 10:05:21 -03:00
go run github.com/air-verse/air@v1.52.2 \
2025-03-07 20:34:31 -03:00
--build.cmd "go build -o tmp/bin/main ./cmd" \
--build.bin "tmp/bin/main" \
2025-03-05 10:05:21 -03:00
--build.exclude_dir "node_modules" \
--build.include_ext "go" \
2025-03-05 10:05:21 -03:00
--build.stop_on_error "false" \
--misc.clean_on_exit true \
2025-03-07 20:33:39 -03:00
-- -dev -port $(PORT) -hostname 0.0.0.0
2025-03-06 10:02:35 -03:00
dev/assets:
2025-03-17 10:49:51 -03:00
tailwindcss \
-i ./assets/stylesheets/tailwind.css \
-o ./assets/stylesheets/out.css \
--watch
2025-03-06 10:02:35 -03:00
dev:
$(MAKE) -j2 dev/assets dev/server
2025-03-06 10:02:35 -03:00
2025-06-09 19:20:46 -03:00
dev/debug:
$(MAKE) -j2 debug dev/assets
editor/dev/server:
cd ./editor; go run github.com/joho/godotenv/cmd/godotenv@v1.5.1 \
go run github.com/air-verse/air@v1.52.2 \
--build.cmd "go build -o tmp/bin/main ./cmd" \
--build.bin "tmp/bin/main" \
--build.exclude_dir "node_modules" \
--build.include_ext "go" \
--build.stop_on_error "false" \
--misc.clean_on_exit true \
-- -dev -port $(PORT) -hostname 0.0.0.0
editor/dev/assets:
cd ./editor; tailwindcss \
-i ./assets/css/tailwind.css \
-o ./assets/css/style.css \
--watch
editor/dev:
$(MAKE) -j2 editor/dev/assets editor/dev/server
2025-06-09 19:20:46 -03:00
debug:
dlv debug -l 127.0.0.1:38697 \
--continue \
--accept-multiclient \
--headless \
./cmd -- -dev -port $(PORT) -hostname 0.0.0.0
2025-03-17 10:55:35 -03:00
build/assets:
tailwindcss \
-i ./assets/stylesheets/tailwind.css \
-o ./assets/stylesheets/out.css \
--minify
2025-03-17 10:55:35 -03:00
build: build/assets
go build -o ./.dist/app .
2024-10-11 22:19:07 -03:00
run: build
./.dist/app
2024-10-11 22:19:07 -03:00
epub/example:
cd ./.epub/example; zip ./example.epub ./META-INF/container.xml ./OEBPS/* ./OEBPS/**/* ./mimetype
epub/example/server:
cd ./.epub/example; http-server
calibre:
mkdir -p ./tmp/calibre-library
calibre \
--no-update-check \
--with-library=./tmp/calibre-library \
./.epub/example/example.epub
clean:
# Remove generated directories
if [[ -d ".dist" ]]; then rm -r ./.dist; fi
if [[ -d "tmp" ]]; then rm -r ./tmp; fi
if [[ -d "bin" ]]; then rm -r ./bin; fi