summaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile')
-rwxr-xr-xsrc/Makefile20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
new file mode 100755
index 0000000..ad535f0
--- /dev/null
+++ b/src/Makefile
@@ -0,0 +1,20 @@
+LIBNAME = fun
+
+all: lib$(LIBNAME).so test$(LIBNAME)
+
+$(LIBNAME).o: $(LIBNAME).h $(LIBNAME).cpp
+ mkoctfile -c -fPIC $(LIBNAME).cpp
+
+lib$(LIBNAME).so: $(LIBNAME).o
+ g++ -loctave -loctinterp -shared -o lib$(LIBNAME).so $(LIBNAME).o
+
+test$(LIBNAME): lib$(LIBNAME).so main.cpp fun.h
+ g++ -Wall -L$(PWD) -Wl,-rpath=$(PWD) -o $@ main.cpp -l$(LIBNAME) -g -loctave -loctinterp
+
+install:
+ cp fun.h ../thirdparty/linux/include/
+ cp libfun.so ../thirdparty/linux/lib/x64/
+
+.PHONY: clean
+clean:
+ $(RM) -f *.out *.so *.o *.oct