4

I am creating a package that uses Makefiles to build and installs various files on the system. Two of the targets requires including the Python and Java headers, so I resorted to using automake to create a configure script.

I followed the directions from http://mij.oltrelinux.com/devel/autoconf-automake/ with the exception that my Makefile.am files are copies of my former Makefiles as all targets are PHONY.

configure.ac

AC_PREREQ([2.69])
m4_include([m4/ax_jni_include_dir.m4])

AC_INIT(apis, 0.0.0, fabian.bergmark@gmail.com)
AM_INIT_AUTOMAKE

AX_JNI_INCLUDE_DIR

for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS
do
        CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR"
done

AC_OUTPUT(Makefile ffi/java/Makefile)

ffi/java/Makefile.am

.PHONY: all

all:
    $(CXX) $(CFLAGS) $(CPPFLAGS) --std=c++11 -O3 -fPIC -shared ffi_java.c -L.. -I.. -I../c/lib -I../cpp/lib -I$(JNI_INCLUDE_DIRS) -I$(JNI_INCLUDE_DIRS)/linux -lAPI -o API.so
    javac *.java
    mkdir -p se/fbergmark/apis
    cp *.class se/fbergmark/apis
    jar cf APIs.jar se

When I run configure, the Makefiles generated obviosult dont respect my PHONY targes, and $(JNI_INCLUDE_DIRS) is empty. How do I write a Makefile.am that runs one (or several) of my PHONY targets?

prinsen
  • 748
  • 6
  • 16

0 Answers0