Add STATIC_UTILS option to Makefile

This commit is contained in:
Grégory Soutadé 2021-07-05 20:23:25 +02:00
parent 46a31b3fd9
commit e4a7874cfb
3 changed files with 8 additions and 2 deletions

View File

@ -44,7 +44,7 @@ libgourou.so: libgourou.a
$(CXX) obj/*.o $(LDFLAGS) -o $@ -shared $(CXX) obj/*.o $(LDFLAGS) -o $@ -shared
utils: 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: clean:
rm -rf libgourou.a libgourou.so obj rm -rf libgourou.a libgourou.so obj

View File

@ -47,12 +47,14 @@ Compilation
Use _make_ command 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-) CROSS can define a cross compiler prefix (ie arm-linux-gnueabihf-)
DEBUG can be set to compile in DEBUG mode 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 Utils
----- -----

View File

@ -2,7 +2,11 @@
TARGETS=acsmdownloader activate TARGETS=acsmdownloader activate
CXXFLAGS=-Wall `pkg-config --cflags Qt5Core Qt5Network` -fPIC -I$(ROOT)/include -I$(ROOT)/lib/pugixml/src/ 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 LDFLAGS=`pkg-config --libs Qt5Core Qt5Network` -L$(ROOT) -lgourou -lcrypto -lzip
endif
ifneq ($(DEBUG),) ifneq ($(DEBUG),)
CXXFLAGS += -ggdb -O0 CXXFLAGS += -ggdb -O0