-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (30 loc) · 1.1 KB
/
Makefile
File metadata and controls
39 lines (30 loc) · 1.1 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
SHELL = /bin/bash
# Use the same detection logic as CMakeLists.txt
ROS_VERSION := $(shell echo $$ROS_VERSION)
#acceptable build_types: Release/Debug/Profile
build_type=Release
# build_type=Debug
.SILENT:
all: build-only install
# Install target - handles ROS version differences
install: build/CMakeLists.txt.copy
if [ "$(ROS_VERSION)" = "1" ]; then \
echo "ROS1 detected, no install needed (use ROS_PACKAGE_PATH)"; \
elif [ "$(ROS_VERSION)" = "2" ]; then \
echo "ROS2 detected, installing to ./install ..."; \
$(MAKE) --no-print-directory -C build install; \
else \
echo "Warning: ROS_VERSION not set, assuming ROS2"; \
$(MAKE) --no-print-directory -C build install; \
fi
# Build-only target (no install)
build-only: build build/CMakeLists.txt.copy
$(info Build_type is [${build_type}])
$(MAKE) --no-print-directory -C build
clean:
rm -rf build lib msg_gen src/amrl_msgs install
build/CMakeLists.txt.copy: build CMakeLists.txt Makefile msg
cd build && cmake -DCMAKE_BUILD_TYPE=$(build_type) -DCMAKE_INSTALL_PREFIX=../install ..
cp CMakeLists.txt build/CMakeLists.txt.copy
build:
mkdir -p build