1
0
mirror of https://github.com/iv-org/invidious.git synced 2024-12-14 22:30:34 +05:30
invidious/Makefile

120 lines
2.2 KiB
Makefile
Raw Normal View History

2021-11-16 03:38:48 +05:30
# -----------------------
# Compilation options
# -----------------------
RELEASE := 1
STATIC := 0
2022-01-04 06:17:41 +05:30
DISABLE_QUIC := 0
2021-11-16 03:38:48 +05:30
NO_DBG_SYMBOLS := 0
FLAGS ?=
ifeq ($(RELEASE), 1)
FLAGS += --release
endif
ifeq ($(STATIC), 1)
FLAGS += --static
endif
ifeq ($(NO_DBG_SYMBOLS), 1)
FLAGS += --no-debug
else
FLAGS += --debug
endif
ifeq ($(DISABLE_QUIC), 1)
FLAGS += -Ddisable_quic
2021-11-16 03:38:48 +05:30
endif
# -----------------------
# Main
# -----------------------
all: invidious
get-libs:
shards install --production
# TODO: add support for ARM64 via cross-compilation
invidious: get-libs
crystal build src/invidious.cr $(FLAGS) --progress --stats --error-trace
run: invidious
./invidious
# -----------------------
# Development
# -----------------------
format:
crystal tool format
test:
crystal spec
verify:
2022-02-08 07:35:49 +05:30
crystal build src/invidious.cr -Dskip_videojs_download \
--no-codegen --progress --stats --error-trace
2021-11-16 03:38:48 +05:30
# -----------------------
# (Un)Install
# -----------------------
# TODO
# -----------------------
# Cleaning
# -----------------------
clean:
rm invidious
distclean: clean
rm -rf libs
# -----------------------
# Help page
# -----------------------
help:
@echo "Targets available in this Makefile:"
@echo ""
@echo " get-libs Fetch Crystal libraries"
@echo " invidious Build Invidious"
@echo " run Launch Invidious"
@echo ""
@echo " format Run the Crystal formatter"
@echo " test Run tests"
@echo " verify Just make sure that the code compiles, but without"
@echo " generating any binaries. Useful to search for errors"
@echo ""
@echo " clean Remove build artifacts"
@echo " distclean Remove build artifacts and libraries"
@echo ""
@echo ""
@echo "Build options available for this Makefile:"
@echo ""
@echo " RELEASE Make a release build (Default: 1)"
@echo " STATIC Link libraries statically (Default: 0)"
@echo ""
@echo " DISABLE_QUIC Disable support for QUIC (Default: 0)"
@echo " NO_DBG_SYMBOLS Strip debug symbols (Default: 0)"
2021-11-16 03:38:48 +05:30
# No targets generates an output named after themselves
2021-11-16 04:06:52 +05:30
.PHONY: all get-libs build amd64 run
.PHONY: format test verify clean distclean help