forked from soutade/libgourou
Compare commits
4 Commits
8f0341d0bd
...
e4cd74e741
| Author | SHA1 | Date | |
|---|---|---|---|
| e4cd74e741 | |||
| a7cfd3ef89 | |||
| 772abdd2f9 | |||
| 1605656c73 |
17
Makefile
17
Makefile
@@ -12,6 +12,8 @@ LDFLAGS = -lpugixml
|
|||||||
|
|
||||||
VERSION := $(shell cat include/libgourou.h |grep LIBGOUROU_VERSION|cut -d '"' -f2)
|
VERSION := $(shell cat include/libgourou.h |grep LIBGOUROU_VERSION|cut -d '"' -f2)
|
||||||
|
|
||||||
|
UNAME := $(shell uname)
|
||||||
|
|
||||||
BUILD_STATIC ?= 0
|
BUILD_STATIC ?= 0
|
||||||
BUILD_SHARED ?= 1
|
BUILD_SHARED ?= 1
|
||||||
BUILD_UTILS ?= 1
|
BUILD_UTILS ?= 1
|
||||||
@@ -27,8 +29,13 @@ ifneq ($(BUILD_STATIC), 0)
|
|||||||
STATIC_UTILS=1
|
STATIC_UTILS=1
|
||||||
endif
|
endif
|
||||||
ifneq ($(BUILD_SHARED), 0)
|
ifneq ($(BUILD_SHARED), 0)
|
||||||
TARGETS += libgourou.so
|
ifeq ($(UNAME), Darwin)
|
||||||
TARGET_LIBRARIES += libgourou.so libgourou.so.$(VERSION)
|
TARGETS += libgourou.dylib
|
||||||
|
TARGET_LIBRARIES += libgourou.dylib libgourou.dylib.$(VERSION)
|
||||||
|
else
|
||||||
|
TARGETS += libgourou.so
|
||||||
|
TARGET_LIBRARIES += libgourou.so libgourou.so.$(VERSION)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
ifneq ($(BUILD_UTILS), 0)
|
ifneq ($(BUILD_UTILS), 0)
|
||||||
TARGETS += build_utils
|
TARGETS += build_utils
|
||||||
@@ -82,6 +89,12 @@ libgourou.so.$(VERSION): $(OBJECTS) $(UPDFPARSERLIB)
|
|||||||
libgourou.so: libgourou.so.$(VERSION)
|
libgourou.so: libgourou.so.$(VERSION)
|
||||||
ln -f -s $^ $@
|
ln -f -s $^ $@
|
||||||
|
|
||||||
|
libgourou.dylib.$(VERSION): $(OBJECTS) $(UPDFPARSERLIB)
|
||||||
|
$(CXX) $^ $(LDFLAGS) -o $@ -shared
|
||||||
|
|
||||||
|
libgourou.dylib: libgourou.dylib.$(VERSION)
|
||||||
|
ln -f -s $^ $@
|
||||||
|
|
||||||
build_utils: $(TARGET_LIBRARIES)
|
build_utils: $(TARGET_LIBRARIES)
|
||||||
$(MAKE) -C utils ROOT=$(PWD) CXX=$(CXX) AR=$(AR) DEBUG=$(DEBUG) STATIC_UTILS=$(STATIC_UTILS) DESTDIR=$(DESTDIR) PREFIX=$(PREFIX)
|
$(MAKE) -C utils ROOT=$(PWD) CXX=$(CXX) AR=$(AR) DEBUG=$(DEBUG) STATIC_UTILS=$(STATIC_UTILS) DESTDIR=$(DESTDIR) PREFIX=$(PREFIX)
|
||||||
|
|
||||||
|
|||||||
@@ -165,8 +165,8 @@ namespace gourou
|
|||||||
Exception(const Exception& other)
|
Exception(const Exception& other)
|
||||||
{
|
{
|
||||||
this->code = other.code;
|
this->code = other.code;
|
||||||
this->line = line;
|
this->line = other.line;
|
||||||
this->file = file;
|
this->file = other.file;
|
||||||
this->fullmessage = strdup(other.fullmessage);
|
this->fullmessage = strdup(other.fullmessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ namespace gourou
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int code, line;
|
int code, line;
|
||||||
const char* message, *file;
|
const char* file;
|
||||||
char* fullmessage;
|
char* fullmessage;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ namespace gourou
|
|||||||
char* tmp = new char[_length*2+1];
|
char* tmp = new char[_length*2+1];
|
||||||
|
|
||||||
for(int i=0; i<(int)_length; i++)
|
for(int i=0; i<(int)_length; i++)
|
||||||
sprintf(&tmp[i*2], "%02x", _data[i]);
|
snprintf(&tmp[i*2], (_length-i)*2+1, "%02x", _data[i]);
|
||||||
|
|
||||||
tmp[_length*2] = 0;
|
tmp[_length*2] = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user