Add useless makefiles

This commit is contained in:
Mylloon 2024-12-03 20:25:14 +01:00
parent eac8ccf339
commit 0d253c7da6
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 32 additions and 0 deletions

15
2023/Makefile Normal file
View file

@ -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)"

17
Makefile Normal file
View file

@ -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)"