aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile55
1 files changed, 55 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3274451
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,55 @@
1SERVER_BASE_URL ?= https://dev.marussy.com
2SERVER_PORT ?= 1313
3SERVER_LIVE_RELOAD_PORT ?= 443
4DART_SASS_EMBEDDED_VERSION ?= 1.0.0-beta.5
5
6ifeq ($(origin DART_SASS_DOWNLOAD_URL), undefined)
7close_paren := )
8ifeq ($(origin DART_SASS_EMBEDDED_PLATFORM), undefined)
9DART_SASS_EMBEDDED_PLATFORM := $(shell case "$$(uname -s)" in \
10 Linux*$(close_paren) echo 'linux' ;; \
11 Darwin*$(close_paren) echo 'macos' ;; \
12 CYGWIN*|MINGW*$(close_paren) echo 'windows' ;; \
13 *$(close_paren) echo 'unknown' ;; \
14esac)
15endif
16ifeq ($(origin DART_SASS_EMBEDDED_ARCH), undefined)
17DART_SASS_EMBEDDED_ARCH := $(shell case "$$(uname -m)" in \
18 i?86$(close_paren) echo 'ia32' ;; \
19 x86_64|amd64|arm64$(close_paren) echo 'x64' ;; \
20 *$(close_paren) echo 'unknown' ;; \
21esac)
22endif
23DART_SASS_DOWNLOAD_URL := https://github.com/sass/dart-sass-embedded/releases/download/$(DART_SASS_EMBEDDED_VERSION)/sass_embedded-$(DART_SASS_EMBEDDED_VERSION)-$(DART_SASS_EMBEDDED_PLATFORM)-$(DART_SASS_EMBEDDED_ARCH).tar.gz
24endif
25
26VENDOR_DIR ?= vendor
27
28DART_SASS_EMBEDDED_DIR := $(VENDOR_DIR)/sass_embedded
29DART_SASS_EMBEDDED_BINARY := $(DART_SASS_EMBEDDED_DIR)/dart-sass-embedded
30
31HUGO ?= hugo
32HUGO := PATH="$(DART_SASS_EMBEDDED_DIR):$${PATH}" $(HUGO)
33
34.PHONY: all server upgrade_dart_sass_embedded
35
36all: $(DART_SASS_EMBEDDED_BINARY)
37
38server:
39 @$(HUGO) server --baseUrl=$(SERVER_BASE_URL) \
40 --buildDrafts \
41 --disableFastRender \
42 --liveReloadPort=$(SERVER_LIVE_RELOAD_PORT) \
43 --minify \
44 --port=$(SERVER_PORT)
45
46upgrade_dart_sass_embedded:
47 @rm -rf $(DART_SASS_EMBEDDED_DIR)
48 @$(MAKE) --no-print-directory $(DART_SASS_EMBEDDED_BINARY)
49
50$(DART_SASS_EMBEDDED_BINARY):
51 @echo "Downloading $(DART_SASS_DOWNLOAD_URL)..."
52 @mkdir -p vendor
53 @cd vendor && \
54 rm -rf sass_embedded && \
55 curl -L $(DART_SASS_DOWNLOAD_URL) | tar xz