Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
Michael Uleysky | f1f224262d | 9 years ago |
Michael Uleysky | ab599e2eba | 9 years ago |
Michael Uleysky | 542e8c50e9 | 9 years ago |
Michael Uleysky | a363891b01 | 9 years ago |
2 changed files with 52 additions and 0 deletions
@ -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
|
@ -0,0 +1,20 @@
|
||||
#include <gmt.h> |
||||
|
||||
int main() |
||||
{ |
||||
void* gmtapi; |
||||
char* text="GMT"; |
||||
char* args="-R130/160/40/60 -JM12c -Xa2c -Ya2c -B5/5/swNE ->/proc/cmdline"; |
||||
struct GMT_OPTION* opts; |
||||
int ret; |
||||
|
||||
gmtapi=GMT_Create_Session(text,2,1,0); |
||||
opts=GMT_Create_Options(gmtapi,0,args); |
||||
ret=GMT_Call_Module(gmtapi,"psbasemap",GMT_MODULE_OPT,opts); |
||||
printf("%i\n",ret); |
||||
|
||||
GMT_Destroy_Options(gmtapi,&opts); |
||||
GMT_Destroy_Session(gmtapi); |
||||
|
||||
return 0; |
||||
} |
Loading…
Reference in new issue