Commit 19847ba8 authored by Ophélie Gagnard's avatar Ophélie Gagnard

WIP: installation/metadata-collect-agent/Makefile: Add generic management for...

WIP: installation/metadata-collect-agent/Makefile: Add generic management for fmtlib and openssl includes paths, in order to support buildouts.
parent f7e28377
......@@ -3,29 +3,29 @@ ifneq ($(PYTHON_PATH),) # this is for buildouts
endif
ifeq ($(INCLUDE_PYTHON),) # default behavior to get python includes path
INCLUDE_PYTHON = $(shell pkg-config --cflags python3 | cut -f 1 -d " ")
else
# INCLUDE_PYTHON = /test/test
#INCLUDE_PYTHON = -I/srv/slapgrid/slappart6/srv/runner/shared/python3/2e435adf7e2cb7d97668da52532ac7f3/include/python3.7m
#OPENSSL_PATH = /srv/slapgrid/slappart6/srv/runner/shared/openssl/24bd61db512fe6e4e0d214ae77943d75
#INCLUDE_OPENSSL = -I$(OPENSSL_PATH)/include
#LIBRARY_OPENSSL = -L$(OPENSSL_PATH)/lib
#RUNPATH_OPENSSL = -Wl,-rpath=$(OPENSSL_PATH)/lib
#FMTLIB_PATH = /srv/slapgrid/slappart6/srv/runner/shared/fmtlib/d524cc3d1a798a140778558556ec6d0c
#INCLUDE_FMTLIB = -I$(FMTLIB_PATH)/include
#LIBRARY_FMTLIB = -L$(FMTLIB_PATH)/lib
#RUNPATH_FMTLIB = -Wl,-rpath=$(FMTLIB_PATH)/lib
#INCLUDE_DIRS = $(INCLUDE_PYTHON) $(INCLUDE_OPENSSL) $(INCLUDE_FMTLIB)
#LIBPATHS = $(LIBRARY_OPENSSL) $(LIBRARY_FMTLIB)
#RUNPATHS = $(RUNPATH_OPENSSL) $(RUNPATH_FMTLIB)
endif
#LDFLAGS = $(LIBPATHS) $(RUNPATHS)
ifneq ($(FMTLIB_PATH),)
INCLUDE_FMTLIB = -I$(FMTLIB_PATH)/include
LIBRARY_FMTLIB = -L$(FMTLIB_PATH)/lib
RUNPATH_FMTLIB = -Wl,-rpath=$(FMTLIB_PATH)/lib
endif
ifeq ($(LIBRARY_FMTLIB),)
LIBRARY_FMTLIB = -lfmt
endif
ifneq ($(OPENSSL_PATH),)
INCLUDE_OPENSSL = -I$(OPENSSL_PATH)/include
LIBRARY_OPENSSL = -L$(OPENSSL_PATH)/lib
RUNPATH_FMTLIB = -Wl,-rpath=$(OPENSSL_PATH)/lib
endif
ifeq ($(LIBRARY_OPENSSL),)
LIBRARY_OPENSSL = -lcrypto
endif
INCLUDE_DIRS = $(INCLUDE_PYTHON) $(INCLUDE_FMTLIB) $(INCLUDE_OPENSSL)
LIBRARY_DIRS = $(LIBRARY_FMTLIB) $(LIBRARY_OPENSSL)
RUNPATHS = $(RUNPATH_FMTLIB) $(RUNPATH_OPENSSL)
#EXE = main
#CXX = g++
......@@ -39,10 +39,10 @@ EXT = $(EXE)$(EXT_SUFFIX)
all: main.cpp#$(EXE)
mkdir -p logs
# Error expected here, writing a C program using the error messages
-g++ -O2 -g -Wno-unused-result -Wsign-compare -pthread $(INCLUDE_PYTHON) main.cpp -lcrypto -lfmt -o main 2> logs/link_errors
-g++ -O2 -g -Wno-unused-result -Wsign-compare -pthread $(INCLUDE_DIRS) main.cpp -o main 2> logs/link_errors
./parse_link_errors.py < logs/link_errors
make fake_python.o
g++ -O2 -g -Wno-unused-result -Wsign-compare -pthread $(INCLUDE_PYTHON) main.cpp fake_python.o -lcrypto -lfmt -o metadata-collect-agent
g++ -O2 -g -Wno-unused-result -Wsign-compare -pthread $(INCLUDE_DIRS) main.cpp fake_python.o -o metadata-collect-agent
#-ln -f ../../metadata-collect-agent metadata-collect-agent
#-ln -f metadata-collect-agent ../../dracut.module/90metadata-collect/metadata-collect-agent
#-ln -f metadata-collect-agent ../../debian.package.unsafe/unsafe-boot-metadata-collect-agent/sbin/metadata-collect-agent
......@@ -54,6 +54,11 @@ all: main.cpp#$(EXE)
%: %.cpp
@echo "[C++ Compiling $^ -> $@]"
$(info LINK.cpp = $(LINK.cpp))
$(info ^ = $^)
$(info LOADLIBES = $(LOADLIBES))
$(info LDLIBS = $(LDLIBS))
$(info @ = $@)
$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@
.PHONY: all
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment