diff --git a/GNUmakefile b/GNUmakefile index cd8b449..db56dc0 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -34,6 +34,7 @@ x64: targs: $(IBISAMI_LIB) $(IBISAMI_LIB): $(OBJS) - @echo "Building $@..." - $(RUN_CMD) $(LIB) $(LIBFLAGS) $^ + @echo "Built $(OBJS)." +# @echo "Building $@..." +# $(RUN_CMD) $(LIB) $(LIBFLAGS) $^ diff --git a/defs.mak b/defs.mak index 5ce71d8..5011313 100644 --- a/defs.mak +++ b/defs.mak @@ -66,7 +66,7 @@ else CXX := g++ LIB := $(CXX) LD := $(CXX) - CFLAGS := -c -fPIC -I. -std=gnu++11 + CFLAGS := -c -fPIC -std=gnu++11 -I. -I"$(IBISAMI_ROOT)" LDFLAGS = -o $@ -shared ifeq ($(MACHINE), X86) LDFLAGS += -m32 @@ -79,7 +79,7 @@ else CFLAGS += -g LDFLAGS += -g else - LDFLAGS += -s -static-libgcc -static-libstdc++ + LDFLAGS += -s -static-libgcc -static-libstdc++ $(@:%_$(SUFFIX).so=%.exp) endif CXXFLAGS := $(CFLAGS) IBISAMI_LIB := libibisami_$(SUFFIX).a diff --git a/example/GNUmakefile b/example/GNUmakefile index cae77b9..a480e78 100644 --- a/example/GNUmakefile +++ b/example/GNUmakefile @@ -21,8 +21,10 @@ include $(IBISAMI_ROOT)/defs.mak # Handle Windows vs. Linux target naming differences. ifeq ($(OS), Windows_NT) TARGS := $(MODS:%=%_$(SUFFIX).dll) + LIB_OBJS = $(LIB_MODS:%="$(IBISAMI_ROOT_DOS)\\%_$(SUFFIX).obj") else TARGS := $(MODS:%=%_$(SUFFIX).so) + LIB_OBJS = $(LIB_MODS:%="$(IBISAMI_ROOT)/%_$(SUFFIX).o") endif # Targets @@ -39,7 +41,6 @@ tx64: targs: $(TARGS) -LIB_OBJS = $(LIB_MODS:%="$(IBISAMI_ROOT_DOS)\\%_$(SUFFIX).obj") $(TARGS): $(OBJS) @echo "Building $@..." # $(RUN_CMD) $(LD) $(LDFLAGS) "$(IBISAMI_ROOT_DOS)\$(IBISAMI_LIB)" "$(IBISAMI_ROOT_DOS)\$(IBISAMI_LIB:%.lib=%.exp)" $^ diff --git a/example/example_tx.cpp b/example/example_tx.cpp index c653f76..e41e903 100644 --- a/example/example_tx.cpp +++ b/example/example_tx.cpp @@ -64,5 +64,5 @@ class MyTx : public AmiTx { } } my_tx; -extern AMIModel *ami_model = &my_tx; +AMIModel *ami_model = &my_tx; diff --git a/example/example_tx.exp b/example/example_tx.exp new file mode 100644 index 0000000..734284c --- /dev/null +++ b/example/example_tx.exp @@ -0,0 +1,10 @@ +VERSION { + DEFAULT { + global: + AMI_Init; + AMI_Close; + local: + *; + }; +} + diff --git a/example/test.py b/example/test.py new file mode 100755 index 0000000..5267620 --- /dev/null +++ b/example/test.py @@ -0,0 +1,19 @@ +#! /usr/bin/env python +# A quick test of the ibisami example Tx model. +# +# Original author: David Banas +# Original date: May 18, 2015 +# +# Copyright (c) 2015 David Banas; all rights reserved World wide. + +import pyibisami.amimodel as ami + +gDLLName = './example_tx_x86_amd64.so' + +the_model = ami.AMIModel(gDLLName) +init_data = ami.AMIModelInitializer({'root_name': "exampleTx"}) +the_model.initialize(init_data) + +print "Model returned message:", the_model.msg +print "Model returned parameters:", the_model.ami_params_out + diff --git a/include/amimodel.h b/include/amimodel.h index 2e3f1f1..7df1190 100644 --- a/include/amimodel.h +++ b/include/amimodel.h @@ -10,7 +10,6 @@ #ifndef INCLUDE_AMIMODEL_H_ #define INCLUDE_AMIMODEL_H_ -#include #include #include #include