From a363891b010e11815068209f5b61ada47249aa74 Mon Sep 17 00:00:00 2001 From: Michael Uleysky Date: Tue, 22 Sep 2015 12:46:47 +1000 Subject: [PATCH] Testing psbasemap --- test/Makefile | 32 +++++++++++++++++++++++ test/gmttest.cpp | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 test/Makefile create mode 100644 test/gmttest.cpp diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 0000000..97de039 --- /dev/null +++ b/test/Makefile @@ -0,0 +1,32 @@ +SHELL=/bin/bash +OPTFLAGS=-O2 -flto -g +EXPORTFLAGS=-fvisibility=hidden -fpic -Wl,--export-dynamic +CPPFLAGS=-std=gnu++11 -I../include -I/home/michael/tmp/gmt5/include/gmt +LIBSFLAGS=-L/home/michael/tmp/gmt5/lib64 -Wl,-rpath /home/michael/tmp/gmt5/lib64 -lgmt -ldl -lpthread $(MODLIBS) +WARNFLAGS=-Wall + +CFLAGS=$(OPTFLAGS) $(EXPORTFLAGS) $(WARNFLAGS) $(CPPFLAGS) +LDFLAGS=$(OPTFLAGS) $(EXPORTFLAGS) $(WARNFLAGS) $(LIBSFLAGS) + +CC=g++ + +SOURCE = $(wildcard *.cpp) +DEPENDS = $(subst .cpp,.d,$(SOURCE)) +OBJECTS = $(subst .cpp,.o,$(SOURCE)) + +gmttest: $(OBJECTS) $(MODOBJECTS) + $(CC) -o $@ $(OBJECTS) $(MODOBJECTS) $(LDFLAGS) + +include $(DEPENDS) + +%.o: %.cpp + $(CC) -c $(CFLAGS) -o $@ $< + +%.d: %.cpp + $(CC) $(CPPFLAGS) -MM -MT $(subst .cpp,.o,$<) $< | sed 's%\(^.*\):%\1 $@ :%g' >$@ + +clean: + rm -f *.o *.d + +distclean: clean + rm -f gmttest \ No newline at end of file diff --git a/test/gmttest.cpp b/test/gmttest.cpp new file mode 100644 index 0000000..beaf607 --- /dev/null +++ b/test/gmttest.cpp @@ -0,0 +1,66 @@ +#include +#include +#include +#include +#include + +int print_func(FILE* fd, const char* str) +{ + std::cout<<"PRINT: "<