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

Create more magical Makefile #13

Open
jpmens opened this issue Jan 5, 2020 · 2 comments
Open

Create more magical Makefile #13

jpmens opened this issue Jan 5, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@jpmens
Copy link
Owner

jpmens commented Jan 5, 2020

Create a slightly more intelligent Makefile which works with Gnu make and BSD make. (I do not want to hear cmake or autotools or the like, thank you.)

OS.exec = uname -s | tr '[A-Z]' '[a-z]'
OS = $(shell $(OS.exec))$(OS.exec:sh)
show:
        @echo $(OS)

/via

@jpmens
Copy link
Owner Author

jpmens commented Jan 5, 2020

$ sh -c '. /etc/os-release; echo $ID'
debian   
centos
alpine       # on 3.8.1

jpmens added a commit that referenced this issue Jan 5, 2020
@jpmens
Copy link
Owner Author

jpmens commented Jan 5, 2020

I've a bit of a feeling as though this is way overkill for this small utility, but this first attempt works on darwin, freebsd, openbsd, and debian.

The install target is particularly messy; I pass the target on through the layers of _makewith the$(TARGET)` variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant