diff --git a/Makefile b/Makefile index d4ee6dd..e6426f0 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ libgourou.so: libgourou.a $(CXX) obj/*.o $(LDFLAGS) -o $@ -shared utils: - make -C utils ROOT=$(PWD) CXX=$(CXX) AR=$(AR) DEBUG=$(DEBUG) + make -C utils ROOT=$(PWD) CXX=$(CXX) AR=$(AR) DEBUG=$(DEBUG) STATIC_UTILS=$(STATIC_UTILS) clean: rm -rf libgourou.a libgourou.so obj diff --git a/README.md b/README.md index 50efcc4..9549eeb 100644 --- a/README.md +++ b/README.md @@ -47,12 +47,14 @@ Compilation Use _make_ command - make [CROSS=XXX] [DEBUG=1] + make [CROSS=XXX] [DEBUG=1] [STATIC_UTILS=1] CROSS can define a cross compiler prefix (ie arm-linux-gnueabihf-) DEBUG can be set to compile in DEBUG mode +STATIC_UTILS to build utils with static library (libgourou.a) instead of default dynamic one (libgourou.so) + Utils ----- diff --git a/utils/Makefile b/utils/Makefile index 14c7c4a..a260e2d 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -2,7 +2,11 @@ TARGETS=acsmdownloader activate CXXFLAGS=-Wall `pkg-config --cflags Qt5Core Qt5Network` -fPIC -I$(ROOT)/include -I$(ROOT)/lib/pugixml/src/ +ifneq ($(STATIC_UTILS),) +LDFLAGS=`pkg-config --libs Qt5Core Qt5Network` -L$(ROOT) $(ROOT)/libgourou.a -lcrypto -lzip +else LDFLAGS=`pkg-config --libs Qt5Core Qt5Network` -L$(ROOT) -lgourou -lcrypto -lzip +endif ifneq ($(DEBUG),) CXXFLAGS += -ggdb -O0