17 lines
308 B
Makefile
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)"
|