I started using Autotool in my project and I have a python module that I would like to compile into a pyc and to copy to the default path for python libraries, so that after installation it can be imported without the need to define extra environment variables. I could find many examples of Makefile.am configurations for python libraries, but they are all using SWIG, which is not my case. Up to now, my Makefile.am file in the pythonlib subfolder has only one line
python_PYTHON = mymodule.py
In configure.ac I have:
AM_PATH_PYTHON([2.4])
and in the topdir Makefile.am :
ACLOCAL_AMFLAGS = -I m4
SUBDIRS=src pythonlib
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
but when after configuration I run the make command I get:
Making all in pythonlib
make[2]: Entering directory '/home/golosio/myproject/pythonlib'
make[2]: *** No rule to make target 'all'. Stop.
make[2]: Leaving directory '/home/golosio/myproject/pythonlib'
make[1]: *** [Makefile:426: all-recursive] Error 1
make[1]: Leaving directory '/home/golosio/myproject'
make: *** [Makefile:358: all] Error 2
I also tried to define pyexec_LTLIBRARIES, but without success. What should I write in the Makefile.am file to compile and install the module?
Sorry, it was a trivial mistake on my part, the problem was not in the Makefile.am files, but in the configure.ac file, I just had to add the path "pythonlib" to AC_CONFIG_FILES:
AC_CONFIG_FILES([Makefile
src/Makefile
pythonlib/Makefile])
with this everything works fine.