Skip to content

Commit

Permalink
Check for DATE in makefile happens before getting times from PC as th…
Browse files Browse the repository at this point in the history
…ey aren't needed otherwise
  • Loading branch information
voloved committed Jul 13, 2024
1 parent 67c96b6 commit 2f10a8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion make.mk
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,13 @@ endif
# YEAR = Sets the year and timezone to the PC's
# DAY = Sets the default time down to the day (year, month, day, timezone)
# MIN = Sets the default time down to the minute (year, month, day, timezone, hour, minute)
ifdef DATE
TIMEZONE := $(shell date +%z | awk '{print substr($$0, 1, 3) * 60 + substr($$0, 4, 2)}')
CURRENT_YEAR := $(shell echo $$(($(shell date +"%Y") - 2020)))
CURRENT_MONTH := $(shell date +"%-m")
CURRENT_DAY := $(shell date +"%-d")
CURRENT_HOUR := $(shell date +"%-H")
CURRENT_MINUTE := $(shell date +"%-M")
ifdef DATE
ifeq ($(DATE), YEAR)
CFLAGS += -DMAKEFILE_TIMEZONE=$(TIMEZONE)
CFLAGS += -DMAKEFILE_CURR_YEAR=$(CURRENT_YEAR)
Expand Down

0 comments on commit 2f10a8f

Please sign in to comment.