Skip to content

Commit

Permalink
Simplify and specify targets to avoid picking up the README.
Browse files Browse the repository at this point in the history
  • Loading branch information
coatless committed Feb 8, 2024
1 parent eb9cec7 commit c028d2e
Showing 1 changed file with 14 additions and 22 deletions.
36 changes: 14 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
# Define the source directory for assets
SRC_DIR := lib

# Define the destination directories for different languages
PYTHON_DEST := python/countdown/assets
R_DEST := r/inst/countdown
QUARTO_DEST := quarto/_extensions/countdown/assets
# Define the languages being used:
LANG_VARIANTS := python r quarto

# Define the corresponding destination directories for each language
LANG_DEST := python/countdown/assets r/inst/countdown quarto/_extensions/countdown/assets

# Convert LANG_VARIANTS to a list of sync targets, e.g. make sync-r, sync-python
SYNC_TARGETS := $(addprefix sync-, $(LANG_VARIANTS))

# Set the default target to sync
.DEFAULT_GOAL := sync

# Define the sync target
sync: sync-python sync-r sync-quarto

# Rule to copy assets to Python directory
sync-python:
@echo "Syncing assets to Python directory..."
mkdir -p $(PYTHON_DEST)
cp -r $(SRC_DIR)/* $(PYTHON_DEST)

# Rule to copy assets to R directory
sync-r:
@echo "Syncing assets to R directory..."
mkdir -p $(R_DEST)
cp -r $(SRC_DIR)/* $(R_DEST)
sync: $(SYNC_TARGETS)

# Rule to copy assets to Quarto directory
sync-quarto:
@echo "Syncing assets to Quarto directory..."
mkdir -p $(QUARTO_DEST)
cp -r $(SRC_DIR)/* $(QUARTO_DEST)
# Rule to create directories and copy assets based on LANG_DEST
sync-%:
@echo "Syncing assets to $(filter $*%, $(LANG_DEST)) directory..."
mkdir -p $(filter $*%, $(LANG_DEST))
cp -r $(SRC_DIR)/*.js $(SRC_DIR)/*.css $(SRC_DIR)/*.mp3 $(filter $*%, $(LANG_DEST))

0 comments on commit c028d2e

Please sign in to comment.