Skip to content

Commit

Permalink
Merge pull request Ericsson#2114 from csordasmarton/build-multiple-ld…
Browse files Browse the repository at this point in the history
…logger

[makefile] Build logger libraries for multiple targets
  • Loading branch information
Gyorgy Orban authored Jul 2, 2019
2 parents 8f14113 + cb612fd commit 813e3d4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ CC_TOOLS = $(CURRENT_DIR)/tools
# Root of the repository.
ROOT = $(CURRENT_DIR)

# Set it to YES if you would like to build and package 64 bit only shared
# objects and ldlogger binary.
BUILD_LOGGER_64_BIT_ONLY ?= NO

ACTIVATE_RUNTIME_VENV ?= . venv/bin/activate
ACTIVATE_DEV_VENV ?= . venv_dev/bin/activate

Expand Down Expand Up @@ -50,7 +54,7 @@ package_tu_collector: build_tu_collector package_dir_structure
ln -sf ../lib/python2.7/tu_collector/tu_collector.py bin/tu_collector

package: package_dir_structure package_plist_to_html package_tu_collector
BUILD_DIR=$(BUILD_DIR) $(MAKE) -C $(CC_ANALYZER) package_analyzer
BUILD_DIR=$(BUILD_DIR) BUILD_LOGGER_64_BIT_ONLY=$(BUILD_LOGGER_64_BIT_ONLY) $(MAKE) -C $(CC_ANALYZER) package_analyzer
BUILD_DIR=$(BUILD_DIR) $(MAKE) -C $(CC_WEB) package_web

# Copy libraries.
Expand Down
29 changes: 11 additions & 18 deletions analyzer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ ACTIVATE_DEV_VENV ?= . venv_dev/bin/activate

VENV_DEV_REQ_FILE ?= requirements_py/dev/requirements.txt

# Set it to YES if you would like to build and package 64 bit only shared
# objects and ldlogger binary.
BUILD_LOGGER_64_BIT_ONLY ?= NO

include tests/Makefile

pip_dev_deps:
Expand Down Expand Up @@ -83,13 +87,11 @@ package_ld_logger:
ln -sf ../ld_logger/bin/ldlogger bin/ldlogger

build_ld_logger:
$(MAKE) -C tools/build-logger -f Makefile.manual 2> /dev/null

build_ld_logger_x86:
$(MAKE) -C tools/build-logger -f Makefile.manual pack32bit 2> /dev/null

build_ld_logger_x64:
$(MAKE) -C tools/build-logger -f Makefile.manual pack64bit 2> /dev/null
ifeq ($(BUILD_LOGGER_64_BIT_ONLY),YES)
$(MAKE) -C tools/build-logger -f Makefile.manual pack64bit 2> /dev/null
else
$(MAKE) -C tools/build-logger -f Makefile.manual 2> /dev/null
endif

# NOTE: extra spaces are allowed and ignored at the beginning of the
# conditional directive line, but a tab is not allowed.
Expand All @@ -98,17 +100,8 @@ ifeq ($(OS),Windows_NT)
else
UNAME_S ?= $(shell uname -s)
ifeq ($(UNAME_S),Linux)
UNAME_P ?= $(shell uname -p)
ifeq ($(UNAME_P),x86_64)
package_ld_logger: build_ld_logger_x64
package_analyzer: package_ld_logger
else ifneq ($(filter %86,$(UNAME_P)),)
package_ld_logger: build_ld_logger_x86
package_analyzer: package_ld_logger
else
package_ld_logger: build_ld_logger
package_analyzer: package_ld_logger
endif
package_ld_logger: build_ld_logger
package_analyzer: package_ld_logger
else ifeq ($(UNAME_S),Darwin)
ifeq (, $(shell which intercept-build))
$(info "No intercept-build (scan-build-py) in $(PATH).")
Expand Down
6 changes: 6 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ export PATH="$PWD/build/CodeChecker/bin:$PATH"
cd ..
```

**Note**: By default `make package` will build ldlogger shared objects for
`32bit` and `64bit` too. If you would like to build and package `64 bit only`
shared objects and ldlogger binary you can set `BUILD_LOGGER_64_BIT_ONLY`
environment variable to `YES` before the package build:
`BUILD_LOGGER_64_BIT_ONLY=YES make package`.

### Upgrading environment after system or Python upgrade

If you have upgraded your system's Python to a newer version (e.g. from
Expand Down

0 comments on commit 813e3d4

Please sign in to comment.