2021-01-26 00:31:29 +01:00
|
|
|
# Generate the FreeBSD website
|
|
|
|
#
|
|
|
|
# Copyright (c) 2020-2021, The FreeBSD Documentation Project
|
|
|
|
# Copyright (c) 2020-2021, Sergio Carlavilla <carlavilla@FreeBSD.org>
|
|
|
|
#
|
|
|
|
# Targets intended for use on the command line
|
|
|
|
#
|
|
|
|
# all (default) - generate the releases.toml and compile all the website
|
2021-01-28 05:22:48 +01:00
|
|
|
# run - serves the built website for local browsing
|
|
|
|
#
|
|
|
|
# The run target uses hugo's built-in webserver to make the built website
|
|
|
|
# available for local browsing. The website should have been built prior
|
|
|
|
# to attempting to use the `run` target. By default, hugo will start its
|
|
|
|
# webserver on port 1313.
|
2021-01-26 00:31:29 +01:00
|
|
|
|
|
|
|
MAINTAINER=carlavilla@FreeBSD.org
|
|
|
|
|
|
|
|
PYTHON_CMD = /usr/local/bin/python3.7
|
|
|
|
HUGO_CMD = /usr/local/bin/hugo
|
|
|
|
|
2021-02-14 22:39:20 +01:00
|
|
|
.ifndef HOSTNAME
|
|
|
|
.HOST+=localhost
|
|
|
|
.else
|
|
|
|
.HOST+=$(HOSTNAME)
|
|
|
|
.endif
|
|
|
|
|
2021-01-28 05:22:48 +01:00
|
|
|
.ORDER: all run
|
|
|
|
|
2021-01-29 04:51:18 +01:00
|
|
|
.ORDER: starting-message generate-releases
|
2021-01-27 17:05:58 +01:00
|
|
|
.ORDER: starting-message build
|
2021-01-29 04:51:18 +01:00
|
|
|
.ORDER: generate-releases build
|
2021-01-27 17:05:58 +01:00
|
|
|
|
2021-01-28 05:22:48 +01:00
|
|
|
all: starting-message generate-releases build
|
2021-02-13 20:04:10 +01:00
|
|
|
run: starting-message generate-releases run-local
|
2021-01-26 00:31:29 +01:00
|
|
|
|
2021-01-27 17:09:02 +01:00
|
|
|
starting-message: .PHONY
|
2021-01-26 00:31:29 +01:00
|
|
|
@echo ---------------------------------------------------------------
|
|
|
|
@echo Building the website
|
|
|
|
@echo ---------------------------------------------------------------
|
|
|
|
|
2021-01-27 17:09:02 +01:00
|
|
|
generate-releases: .PHONY
|
2021-01-26 00:31:29 +01:00
|
|
|
${PYTHON_CMD} ./tools/releases-toml.py -p ./shared/releases.adoc
|
|
|
|
|
2021-02-13 20:04:10 +01:00
|
|
|
run-local: .PHONY
|
2021-02-14 22:39:20 +01:00
|
|
|
${HUGO_CMD} server -D --baseURL="http://$(.HOST):1313"
|
2021-01-26 00:31:29 +01:00
|
|
|
|
2021-01-27 17:09:02 +01:00
|
|
|
build: .PHONY
|
2021-01-26 00:31:29 +01:00
|
|
|
${HUGO_CMD}
|