almnck/Makefile

24 lines
754 B
Makefile
Raw Normal View History

# Define the source directory, read from the environment variable ALMANACK_ROOT
# Ensure to handle the case where ALMANACK_ROOT is not set
SRC_DIR := $(ALMANACK_ROOT)/web
ALMANACK_ROOT := $(ALMANACK_ROOT)
# Define the destination for rsync
DEST := boat:/var/local/www/www.almnck.com/
# Define the rsync options
RSYNC_OPTS := -avz --delete
# Define the default target, so it does nothing if just 'make' is run
.PHONY: default
default:
@echo "Please specify a target to run, e.g., 'make live' for live deployment."
# Define the 'live' target which will be triggered on 'make live'
.PHONY: live
live:
ifndef ALMANACK_ROOT
$(error ALMANACK_ROOT is undefined. Please export it before running 'make live'.)
endif
@rsync $(RSYNC_OPTS) $(SRC_DIR) $(DEST)