Skip to content

Instantly share code, notes, and snippets.

@h0ru5
Created October 11, 2015 13:17
Show Gist options
  • Select an option

  • Save h0ru5/97c1c1603598ee18f6e3 to your computer and use it in GitHub Desktop.

Select an option

Save h0ru5/97c1c1603598ee18f6e3 to your computer and use it in GitHub Desktop.
Makefile for neopixel wrapper in java
JNI_INCLUDE = "/usr/lib/jvm/default/include"
all: java rpi_ws281x.so
rpi_ws281x.so: ws2811.o dma.o pwm.o rpi_ws281x_wrap.o
${CC} -shared -o $@ $^
java: python/rpi_ws281x.i
mkdir -p java
swig -java -outdir java $<
rpi_ws281x_wrap.o: python/rpi_ws281x_wrap.c
${CC} -fPIC -I${JNI_INCLUDE} -I${JNI_INCLUDE}/linux -c $< -o $@
%.o: %.c
${CC} -fPIC -c $< -o $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment