Skip to content

Instantly share code, notes, and snippets.

@sonOfRa
Created September 10, 2013 23:17
Show Gist options
  • Save sonOfRa/6517109 to your computer and use it in GitHub Desktop.
Save sonOfRa/6517109 to your computer and use it in GitHub Desktop.
# Define a variable for classpath
CLASS_PATH = ../bin
GCC_INCLUDE = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
# Package name
PACKAGE_NAME = im.tox.jtoxcore
all : libjtox.so
libjtox.so : JTox.o
gcc -shared -o $@ $< -ltoxcore
JTox.o : JTox.c im_tox_jtoxcore_JTox.h
LANG="en_US.UTF-8" gcc $(GCC_INCLUDE) -fPIC -ggdb -c $< -o $@
# Define a virtual path for .class in the bin directory
vpath %.class $(CLASS_PATH)/im/tox/jtoxcore
# $* matches the target filename without the extension
im_tox_jtoxcore_JTox.h : JTox.class
javah -classpath $(CLASS_PATH) $(PACKAGE_NAME).JTox
clean :
rm -f libjtox.so JTox.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment