forked from Ericsson/codechecker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
123 lines (95 loc) · 3.7 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
-include Makefile.local
CURRENT_DIR = $(shell pwd)
BUILD_DIR ?= $(CURRENT_DIR)/build
CC_BUILD_DIR = $(BUILD_DIR)/CodeChecker
CC_BUILD_LIB_DIR = $(CC_BUILD_DIR)/lib/python2.7
# Root of the repository.
ROOT = $(CURRENT_DIR)/..
CC_TOOLS = $(ROOT)/tools
ACTIVATE_DEV_VENV ?= . venv_dev/bin/activate
VENV_DEV_REQ_FILE ?= requirements_py/dev/requirements.txt
include tests/Makefile
pip_dev_deps:
pip install -r $(VENV_DEV_REQ_FILE)
venv_dev:
# Create a virtual environment for development.
virtualenv -p python2 venv_dev && \
$(ACTIVATE_DEV_VENV) && pip install -r $(VENV_DEV_REQ_FILE)
clean_venv_dev:
rm -rf venv_dev
package_dir_structure:
mkdir -p $(BUILD_DIR) && \
mkdir -p $(CC_BUILD_DIR)/bin && \
mkdir -p $(CC_BUILD_LIB_DIR)
build_plist_to_html:
$(MAKE) -C $(ROOT)/tools/plist_to_html build
package_plist_to_html: build_plist_to_html package_dir_structure
# Copy plist-to-html files.
cp -r $(CC_TOOLS)/plist_to_html/build/plist_to_html/plist_to_html $(CC_BUILD_LIB_DIR)
build_tu_collector:
$(MAKE) -C $(ROOT)/tools/tu_collector build
package_tu_collector: build_tu_collector package_dir_structure
# Copy tu_collector files.
cp -r $(CC_TOOLS)/tu_collector/build/tu_collector/tu_collector $(CC_BUILD_LIB_DIR)
# This target should be used from the top level Makefile to build the package
# together with the web part. This way we will not build plist-to-html
# multiple times.
package_analyzer: package_dir_structure
package: package_plist_to_html package_tu_collector package_analyzer
# Copy libraries.
cp -r $(ROOT)/codechecker_common $(CC_BUILD_LIB_DIR) && \
cp -r $(CURRENT_DIR)/codechecker_analyzer $(CC_BUILD_LIB_DIR)
# Copy config files and extend 'version.json' file with git information.
cp -r $(ROOT)/config $(CC_BUILD_DIR) && \
cp -r $(CURRENT_DIR)/config/* $(CC_BUILD_DIR)/config && \
$(ROOT)/scripts/build/extend_version_file.py -r $(ROOT) \
$(CC_BUILD_DIR)/config/analyzer_version.json \
# Copy CodeChecker entry point sub-commands.
mkdir -p $(CC_BUILD_DIR)/cc_bin && \
$(ROOT)/scripts/build/create_commands.py -b $(BUILD_DIR) \
$(ROOT)/bin:codechecker_common/cmd \
$(CURRENT_DIR)/bin:codechecker_analyzer/cmd
# Copy license file.
cp $(ROOT)/LICENSE.TXT $(CC_BUILD_DIR)
package_ld_logger:
mkdir -p $(CC_BUILD_DIR)/ld_logger && \
mkdir -p $(CC_BUILD_DIR)/bin && \
cp -r $(CURRENT_DIR)/tools/build-logger/build/* $(CC_BUILD_DIR)/ld_logger && \
ln -sf $(CC_BUILD_DIR)/ld_logger/bin/ldlogger $(CC_BUILD_DIR)/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
# NOTE: extra spaces are allowed and ignored at the beginning of the
# conditional directive line, but a tab is not allowed.
ifeq ($(OS),Windows_NT)
$(info Skipping ld logger from package)
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
else ifeq ($(UNAME_S),Darwin)
ifeq (, $(shell which intercept-build))
$(info "No intercept-build (scan-build-py) in $(PATH).")
endif
endif
endif
clean_package: clean_plist_to_html clean_tu_collector
rm -rf $(BUILD_DIR)
find . -name "*.pyc" -delete
clean_plist_to_html:
rm -rf $(ROOT)/tools/plist_to_html/build
clean_tu_collector:
rm -rf $(ROOT)/tools/tu_collector/build