From e4a7874cfb09886fd46cc6fbc7dd84438ae0f7db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Mon, 5 Jul 2021 20:23:25 +0200 Subject: [PATCH] Add STATIC_UTILS option to Makefile --- Makefile | 2 +- README.md | 4 +++- utils/Makefile | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) 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