forked from ClusterM/open-bamboo-networking
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (54 loc) · 2.4 KB
/
Makefile
File metadata and controls
68 lines (54 loc) · 2.4 KB
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
# Thin wrapper around CMake so the usual './configure && make && make install'
# dance works. Every target here just shells out to cmake -- there is nothing
# else going on.
#
# If you run 'make' before ./configure, we auto-configure with default flags.
# Customise the build by running ./configure yourself with the options
# printed by './configure --help'.
-include config.mk
BUILD_DIR ?= build
NPROC := $(shell command -v nproc >/dev/null 2>&1 && nproc || echo 2)
# Everything forwards to cmake; no file-based rules.
.PHONY: all build configure reconfigure install uninstall test clean distclean help
all: build
# Auto-run ./configure if the build tree is missing. Users that want a
# specific prefix / flags should run ./configure themselves.
$(BUILD_DIR)/CMakeCache.txt:
@echo "Makefile: no build tree at $(BUILD_DIR), running ./configure with defaults"
@./configure
configure reconfigure:
@./configure $(CONFIGURE_ARGS)
build: $(BUILD_DIR)/CMakeCache.txt
@cmake --build $(BUILD_DIR) -j$(NPROC)
install: build
@cmake --install $(BUILD_DIR)
uninstall:
@if [ -f $(BUILD_DIR)/install_manifest.txt ]; then \
echo "Makefile: removing files listed in $(BUILD_DIR)/install_manifest.txt"; \
xargs -r rm -fv < $(BUILD_DIR)/install_manifest.txt; \
else \
echo "Makefile: no install manifest at $(BUILD_DIR)/install_manifest.txt -- run 'make install' first"; \
fi
test: build
@ctest --test-dir $(BUILD_DIR) --output-on-failure
clean:
@if [ -d $(BUILD_DIR) ]; then \
cmake --build $(BUILD_DIR) --target clean; \
fi
distclean:
@rm -rf $(BUILD_DIR) config.mk
help:
@echo 'Targets:'
@echo ' make Configure (if needed) and build the plugin'
@echo ' make install Install into the configured prefix and patch'
@echo ' BambuStudio.conf (when installing to the'
@echo ' default BambuStudio dir)'
@echo ' make test Run the smoke tests via ctest'
@echo ' make clean Remove compiled artefacts, keep the cache'
@echo ' make distclean Remove the build directory entirely'
@echo " make uninstall Remove every file 'make install' put down"
@echo ' make reconfigure Re-run ./configure (forward flags via CONFIGURE_ARGS)'
@echo ''
@echo 'Customise the build:'
@echo ' ./configure --help Full list of configure options'
@echo ' make reconfigure CONFIGURE_ARGS="--prefix=/opt/my-bambu --build-type=Debug"'