From 0d253c7da675db76a3434e20aa3dd22a7f843849 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 3 Dec 2024 20:25:14 +0100 Subject: [PATCH] Add useless makefiles --- 2023/Makefile | 15 +++++++++++++++ Makefile | 17 +++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 2023/Makefile create mode 100644 Makefile diff --git a/2023/Makefile b/2023/Makefile new file mode 100644 index 0000000..d93ad8e --- /dev/null +++ b/2023/Makefile @@ -0,0 +1,15 @@ +MKDIR = mkdir + +LATEST_DAY := $(patsubst day%,%,$(lastword $(sort $(wildcard day[0-9]*)))) + +ifeq ($(LATEST_DAY),) + NEW_DAY := 1 +else + NEW_DAY := $(shell echo $$(( $(LATEST_DAY) + 1 )) ) +endif + + +all: create_day + +create_day: + $(MKDIR) "day$(NEW_DAY)" diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f796384 --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +MKDIR = mkdir +CP = cp + +LATEST_YEAR := $(lastword $(sort $(wildcard [0-9]*))) + +ifeq ($(LATEST_YEAR),) + NEW_YEAR := $(shell date -u +%Y) +else + NEW_YEAR := $(shell echo $$(( $(LATEST_YEAR) + 1 )) ) +endif + + +all: create_year + +create_year: + $(MKDIR) "$(NEW_YEAR)" + $(CP) "$(LATEST_YEAR)/Makefile" "$(NEW_YEAR)"