adventofcode/Makefile
2024-12-03 20:25:14 +01:00

17 lines
308 B
Makefile

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