diff options
author | Jakob Odersky <jodersky@gmail.com> | 2014-03-28 17:08:21 +0100 |
---|---|---|
committer | Jakob Odersky <jodersky@gmail.com> | 2014-03-28 17:08:21 +0100 |
commit | e1dbcd03d9c0504ef9d0e4172236481222ef70f2 (patch) | |
tree | 6945f8ec3104253179564dd9ab98e57be9ecc864 /flow-native/Makefile | |
parent | 99b1ad237edfed9dd9b64dffe9aa5d38b0721175 (diff) | |
download | akka-serial-e1dbcd03d9c0504ef9d0e4172236481222ef70f2.tar.gz akka-serial-e1dbcd03d9c0504ef9d0e4172236481222ef70f2.tar.bz2 akka-serial-e1dbcd03d9c0504ef9d0e4172236481222ef70f2.zip |
implement alternative native build, we're kind of at a turning point here, see roadmap for ideas
Diffstat (limited to 'flow-native/Makefile')
-rw-r--r-- | flow-native/Makefile | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/flow-native/Makefile b/flow-native/Makefile new file mode 100644 index 0000000..fb973f3 --- /dev/null +++ b/flow-native/Makefile @@ -0,0 +1,56 @@ +# Build native binaries for flow. +# =============================== + +# name of the library to produce +NAME=flow +MAJOR=3 +MINOR=0 +MICRO=0 + +SONAME=lib$(NAME).so.$(MAJOR) +TARGET=$(SONAME).$(MINOR).$(MICRO) + +JAVA_HOME=/usr/lib/jvm/java-7-oracle + +# where the library should be installed +PREFIX?=usr/lib + +# compiler and linker settings +CC=$(CROSS_COMPILE)gcc +LD=$(CROSS_COMPILE)ld +CFLAGS= -O2 -fPIC -Wall + +# since java connot easily load a library with a specific +# major version, the vesion is included in the library's name + +LDFLAGS+=-shared -Wl,-soname,$(SONAME) +INCLUDES=./include/ $(JAVA_HOME)/include/ $(JAVA_HOME)/include/linux/ + +OBJECTS=flow_jni.o posix/flow.o + +# rules +all: $(TARGET) $(SONAME) + +$(TARGET): $(OBJECTS) + $(CC) $(LDFLAGS) -o $@ $^ + +$(SONAME): $(TARGET) + ln -s $(TARGET) $(SONAME) + +%.o: %.c + $(CC) $(CFLAGS) $(addprefix -I, $(INCLUDES)) -o $@ -c $< + +install: + cp -P -t $(DESTDIR)/$(PREFIX)/ $(TARGET) $(SONAME) + +uninstall: + rm $(DESTDIR)/$(PREFIX)/$(TARGET) + rm $(DESTDIR)/$(PREFIX)/$(SONAME) + +clean: + rm -f posix/*.o + rm -f posix/*.so + rm -f $(TARGET) + rm -f $(SONAME) + +.PHONY: clean install |