changeset 30:9bb5dfef3d2a

Makefile for Linux.
author David Barts <n5jrn@me.com>
date Fri, 17 Apr 2020 10:09:30 -0700
parents 0161374f7a60
children 3b0546fa0d74
files Makefile.linux
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile.linux	Fri Apr 17 10:09:30 2020 -0700
@@ -0,0 +1,20 @@
+CXX = g++
+CXXFLAGS = -shared -fPIC -I$(JRE_HOME)/include -I$(JRE_HOME)/include/linux
+NDIR = src/name/blackcap/exifwasher/exiv2
+BDIR = src/name/blackcap/exifwasher/binaries/linux
+
+.PHONY: all checkenv
+
+all: checkenv $(BDIR)/libjni.so $(BDIR)/libexiv2.so
+
+checkenv:
+	@if [ -z "$(JRE_HOME)" ]; then \
+		1>&2 echo "JRE_HOME not set"; \
+		exit 1; \
+	fi
+
+$(BDIR)/libjni.so: $(NDIR)/native.cpp
+	$(CXX) $(CXXFLAGS) -o $@ $< -lexiv2
+
+$(BDIR)/libexiv2.so: /usr/lib/x86_64-linux-gnu/libexiv2.so
+	cp -fp $< $@