Rework Makefile with install/link/update targets and auto-generation
Add gen-update-targets.sh to parse flake.nix and generate grouped update targets (update-kyle, update-mc). Makefile now has install (copy) and link (symlink) targets for rebuild-nixos. Also fix mc flake input URLs to use /mc/ org path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
18
Makefile
18
Makefile
@@ -1,12 +1,18 @@
|
||||
BIN_DIR := ${HOME}/.local/bin
|
||||
SCRIPTS := $(BIN_DIR)/rebuild-nixos
|
||||
|
||||
.PHONY: all
|
||||
all: $(SCRIPTS)
|
||||
.PHONY: install link update-targets
|
||||
|
||||
install: $(BIN_DIR)
|
||||
cp script/rebuild-nixos $(BIN_DIR)/
|
||||
chmod +x $(BIN_DIR)/rebuild-nixos
|
||||
|
||||
link: $(BIN_DIR)
|
||||
ln -sf $(CURDIR)/script/rebuild-nixos $(BIN_DIR)/
|
||||
|
||||
$(BIN_DIR):
|
||||
mkdir -p $(BIN_DIR)
|
||||
|
||||
$(BIN_DIR)/rebuild-nixos: script/rebuild-nixos
|
||||
cp script/rebuild-nixos $(BIN_DIR)/
|
||||
chmod +x $(BIN_DIR)/rebuild-nixos
|
||||
update-targets.mk: flake.nix script/gen-update-targets.sh
|
||||
script/gen-update-targets.sh > $@
|
||||
|
||||
-include update-targets.mk
|
||||
|
||||
Reference in New Issue
Block a user