Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Makefile compatible with GNU Make >= 3.79.1 #2853

Merged
merged 1 commit into from Mar 30, 2019

Conversation

@alandipert
Copy link
Contributor

commented Mar 29, 2019

This is a small change to the Makefile that makes it syntactically compatible with GNU make as far back as at least 3.79.1 while remaining forward compatible.

I'm interested in this change because some coworkers of mine are working on an R package wrapper, and some of the build tools available in the R package compilation environment — particularly make — are really dated. They aren't able to include libsass sources directly in the package (as is required of such things in the R world) without patching it first.

I figured it might be useful for other people to build with really old versions of make, and it would be nice not to patch it locally. So, I put together this PR.

Technical context

The particular reason for this change is that make (since 3.8 I think?) supports two kinds of "complex conditionals", or conditional statements with else clauses:

conditional-directive
text-if-true
else
text-if-false
endif

and

conditional-directive-one
text-if-one-is-true
else conditional-directive-two
text-if-two-is-true
else
text-if-one-and-two-are-false
endif

The latter syntax is the one used in libsass's Makefile, but make 3.79.1 only supports the former.

This PR translates instances of of the "new" syntax into the old so that make 3.79.1 can process the Makefile without any syntax errors.

Upside

With the old syntax, libsass is likely to build on a wider variety of old platforms.

Downside

The old syntax is slightly more verbose.

Thanks in advance for considering this change!

@xzyfer
xzyfer approved these changes Mar 30, 2019
@xzyfer

This comment has been minimized.

Copy link
Contributor

commented Mar 30, 2019

Thanks! The CI failures are not related to this change.

@xzyfer xzyfer merged commit 2050492 into sass:master Mar 30, 2019
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build failed
Details
@glebm

This comment has been minimized.

Copy link
Contributor

commented Mar 30, 2019

Wow. GNU Make 3.79.1 was released 19 years ago, 2000-06-23. R seems to have a serious ecosystem problem.

@wch

This comment has been minimized.

Copy link

commented May 29, 2019

Unfortunately, the build system for R packages on Windows was quite dated. They are in the process of modernizing it, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.