Skip to content

Commit

Permalink
win32: fix RUBY_RELEASE_DATE in Makefile
Browse files Browse the repository at this point in the history
As it is overridden by the definition in common.mk, instead define
YEAR, MONTH and DAY which are used there.

This macro is useful for daily build&installation by the
combination with "relative-load", for example:
```sh
$ ./configure --prefix=/. --enable-load-relative \
  --with-destdir='$(HOME)/.rbenv/versions/$(RUBY_RELEASE_DATE)'
```
This can install images usable by rbenv per days.
  • Loading branch information
nobu committed Apr 10, 2021
1 parent 836da24 commit 0a93a3f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions win32/setup.mak
Expand Up @@ -140,9 +140,17 @@ verconf.mk: nul
#define STRINGIZE0(expr) #expr
#define STRINGIZE(x) STRINGIZE0(x)
#include "version.h"
for %%I in (RUBY_RELEASE_DATE) do set ruby_release_date=%%~I
#undef RUBY_RELEASE_DATE
echo RUBY_RELEASE_DATE = %ruby_release_date:""=%
set ruby_release_year=RUBY_RELEASE_YEAR
set ruby_release_month=RUBY_RELEASE_MONTH
set ruby_release_day=RUBY_RELEASE_DAY
set ruby_release_month=0%ruby_release_month%
set ruby_release_day=0%ruby_release_day%
#undef RUBY_RELEASE_YEAR
#undef RUBY_RELEASE_MONTH
#undef RUBY_RELEASE_DAY
echo RUBY_RELEASE_YEAR = %ruby_release_year%
echo RUBY_RELEASE_MONTH = %ruby_release_month:~-2%
echo RUBY_RELEASE_DAY = %ruby_release_day:~-2%
echo MAJOR = RUBY_VERSION_MAJOR
echo MINOR = RUBY_VERSION_MINOR
echo TEENY = RUBY_VERSION_TEENY
Expand Down

0 comments on commit 0a93a3f

Please sign in to comment.