-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
140 lines (119 loc) · 4.59 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/usr/bin/env make -f
################################################################################
# 🅳🅾🆃🅵🅸🅻🅴🆂
# File: Makefile
# Version: 0.2.469
# Author: Sebastien Rousseau
# Copyright (c) 2015-2025. All rights reserved
# Description: Build automation for dotfiles installation and management
# Website: https://dotfiles.io
# License: MIT
################################################################################
#------------------------------------------------------------------------------
# Configuration Variables
#------------------------------------------------------------------------------
# Default target if no target is specified
.DEFAULT_GOAL := help
# Define shell and working directory
SHELL := /bin/bash
HOMEDIR := $(shell pwd)
BANNER := $(HOMEDIR)/scripts/banner.sh
# Script paths
BACKUP_SCRIPT := $(HOMEDIR)/scripts/backup.sh
BUILD_SCRIPT := $(HOMEDIR)/scripts/build.sh
CLEAN_SCRIPT := $(HOMEDIR)/scripts/clean.sh
COPY_SCRIPT := $(HOMEDIR)/scripts/copy.sh
DOWNLOAD_SCRIPT := $(HOMEDIR)/scripts/download.sh
UNPACK_SCRIPT := $(HOMEDIR)/scripts/unpack.sh
#------------------------------------------------------------------------------
# Phony Targets Declaration
#------------------------------------------------------------------------------
.PHONY: backup build clean copy download help unpack
#------------------------------------------------------------------------------
# Backup Target
#------------------------------------------------------------------------------
# @name backup
# @brief Creates a backup of existing dotfiles
# @description Saves current dotfiles to prevent accidental loss
# @command make backup
# @example make backup
backup: ## Backup your current dotfiles
@$(BACKUP_SCRIPT) backup
#------------------------------------------------------------------------------
# Build Target
#------------------------------------------------------------------------------
# @name build
# @brief Performs complete dotfiles installation
# @description Runs the full installation process including all necessary steps
# @command make build
# @example make build
build: ## Run the full installation process
@$(BUILD_SCRIPT) build
#------------------------------------------------------------------------------
# Clean Target
#------------------------------------------------------------------------------
# @name clean
# @brief Removes previous dotfiles setup
# @description Cleans up any existing dotfiles installation
# @command make clean
# @example make clean
clean: ## Removes any previous setup
@$(CLEAN_SCRIPT) clean
#------------------------------------------------------------------------------
# Copy Target
#------------------------------------------------------------------------------
# @name copy
# @brief Copies dotfiles to system
# @description Deploys dotfiles to appropriate locations
# @command make copy
# @example make copy
copy: ## Copy the dotfiles on your system
@$(COPY_SCRIPT) copy
#------------------------------------------------------------------------------
# Download Target
#------------------------------------------------------------------------------
# @name download
# @brief Downloads latest dotfiles
# @description Retrieves the most recent version of dotfiles
# @command make download
# @example make download
download: ## Download the dotfiles on your system
@$(DOWNLOAD_SCRIPT) download
#------------------------------------------------------------------------------
# Unpack Target
#------------------------------------------------------------------------------
# @name unpack
# @brief Extracts downloaded dotfiles
# @description Unpacks the dotfiles archive to the system
# @command make unpack
# @example make unpack
unpack: ## Extract the dotfiles to your system
@$(UNPACK_SCRIPT) unpack
#------------------------------------------------------------------------------
# Help Target
#------------------------------------------------------------------------------
# @name help
# @brief Displays help information
# @description Shows available commands and documentation
# @command make help
# @example make help
help: ## Display the help menu
@$(BANNER)
@awk 'BEGIN { \
FS = ":.*##"; \
printf "USAGE:\n\n make \033[1;96m[COMMAND]\033[0m\n\nCOMMANDS:\n\n"; \
} \
/^[$$()% a-zA-Z_-]+:.*?##/ { \
printf " \033[1;96m%-8s\033[0m -%s\n", $$1, $$2; \
} \
/^##@/ { \
printf "\n\033[1m%s\033[0m\n", substr($$0, 5); \
}' $(MAKEFILE_LIST)
@echo ""
@echo "DOCUMENTATION:"
@echo ""
@echo -e " \033[4;36mhttps://dotfiles.io\033[0m\n"
@echo "LICENSE:"
@echo ""
@echo " This project is licensed under the MIT License."
@echo ""