Discussion:
Makefiles guidance
Anmol Mishra
2018-06-14 19:04:22 UTC
Permalink
https://pastebin.com/gDiMCEpC

https://github.com/Shopify/pyoozie/blob/master/Makefile

What actually is my_cmd.python.2 and my_cmd.python.3 really do.
In these, What actually is happening in these lines?

1. python_version_full := $(wordlist 2,4,$(subst ., ,$(shell python
--version 2>&1)))
2. python_version_major := $(word 1,${python_version_full}
Bob Friesenhahn
2018-06-14 19:41:10 UTC
Permalink
Post by Anmol Mishra
https://pastebin.com/gDiMCEpC
https://github.com/Shopify/pyoozie/blob/master/Makefile
What actually is my_cmd.python.2 and my_cmd.python.3 really do.
In these, What actually is happening in these lines?
1. python_version_full := $(wordlist 2,4,$(subst ., ,$(shell python
--version 2>&1)))
2. python_version_major := $(word 1,${python_version_full}
This is GNU make specific syntax (not portable) and so you should
consult the GNU make manual.

As a quick check you can add something this at the bottom of the
Makefile to see what these variables end up being defined to:

test_vars:
echo $(python_version_full)
echo $(python_version_major)

and then do

make test_vars

to see what gets printed.

Bob
--
Bob Friesenhahn
***@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Anmol Mishra
2018-06-14 22:01:53 UTC
Permalink
Now, in Makefile.am Rules are a bit different than regular makefile?


On Fri, Jun 15, 2018 at 1:11 AM, Bob Friesenhahn <
Post by Anmol Mishra
https://pastebin.com/gDiMCEpC
Post by Anmol Mishra
https://github.com/Shopify/pyoozie/blob/master/Makefile
What actually is my_cmd.python.2 and my_cmd.python.3 really do.
In these, What actually is happening in these lines?
1. python_version_full := $(wordlist 2,4,$(subst ., ,$(shell python
--version 2>&1)))
2. python_version_major := $(word 1,${python_version_full}
This is GNU make specific syntax (not portable) and so you should consult
the GNU make manual.
As a quick check you can add something this at the bottom of the Makefile
echo $(python_version_full)
echo $(python_version_major)
and then do
make test_vars
to see what gets printed.
Bob
--
Bob Friesenhahn
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
--
[image: Developer in progress]
Anmol Mishra
Student | Developer in progress
M: +91 9990752180 <+91+9990752180>
E: ***@gmail.com
[image: facebook] <https://www.facebook.com/1453830764744514> [image:
twitter] <https://twitter.com/_octamois> [image: linkedin]
<https://www.linkedin.com/in/anmol-mishra-720219136/> [image: github]
<https://github.com/octamois> [image: snapchat-ghost]
<https://www.snapchat.com/add/octamois>
Bob Friesenhahn
2018-06-14 22:29:55 UTC
Permalink
Post by Anmol Mishra
Now, in Makefile.am Rules are a bit different than regular makefile?
Makefile.am is written in Automake syntax which is transformed using
the 'automake' program into a portable make syntax so that any 'make'
program should be able to use it. See
https://www.gnu.org/software/automake/manual/

The GNU Make Makefile you found previously is written in GNU-make
specific syntax. See https://www.gnu.org/software/make/manual/

However, portable Makefiles (such as produced by GNU Automake) are
written in a portable subset of POSIX make syntax.

I should mention that this is the Autoconf mailing list, intended for
Autoconf, which is related to Automake, but not the same thing.
Automake and GNU make have their own mailing lists.

Bob
--
Bob Friesenhahn
***@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/
Loading...