|
| 1 | +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. |
| 2 | +# |
| 3 | +# NVIDIA CORPORATION and its licensors retain all intellectual property |
| 4 | +# and proprietary rights in and to this software, related documentation |
| 5 | +# and any modifications thereto. Any use, reproduction, disclosure or |
| 6 | +# distribution of this software and related documentation without an express |
| 7 | +# license agreement from NVIDIA CORPORATION is strictly prohibited. |
| 8 | + |
| 9 | +# Simple packaging utility for isaac-ros-cli |
| 10 | + |
| 11 | +PACKAGE_NAME := isaac-ros-cli |
| 12 | + |
| 13 | +DISTRIBUTION ?= noble |
| 14 | +COMPONENT ?= main |
| 15 | +ARCHITECTURE ?= all |
| 16 | + |
| 17 | +# Convenience variable for the built .deb (lives one dir up when using dpkg-buildpackage) |
| 18 | +DEB_GLOB := ../$(PACKAGE_NAME)_*.deb |
| 19 | + |
| 20 | +.PHONY: help all build upload clean distclean release print-deb |
| 21 | + |
| 22 | +help: |
| 23 | + @echo "Targets:" |
| 24 | + @echo " make build - Build Debian package (.deb)" |
| 25 | + @echo " make clean - Remove staged packaging artifacts inside debian/" |
| 26 | + @echo " make distclean - Clean and remove built files in parent dir" |
| 27 | + @echo " make print-deb - Print the path to the built .deb (expects exactly one)" |
| 28 | + @echo "" |
| 29 | + @echo "Variables (override with VAR=value):" |
| 30 | + @echo " DISTRIBUTION=$(DISTRIBUTION) COMPONENT=$(COMPONENT) ARCHITECTURE=$(ARCHITECTURE)" |
| 31 | + |
| 32 | +all: build |
| 33 | + |
| 34 | +build: |
| 35 | + @echo "Building Debian package for $(PACKAGE_NAME)..." |
| 36 | + DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc -b |
| 37 | + @echo "Build complete. Use 'make print-deb' to locate the .deb file." |
| 38 | + |
| 39 | +print-deb: |
| 40 | + @set -e; \ |
| 41 | + count=$$(ls -1 $(DEB_GLOB) 2>/dev/null | wc -l | tr -d ' '); \ |
| 42 | + if [ "$$count" -ne 1 ]; then \ |
| 43 | + echo "Error: expected exactly one .deb matching $(DEB_GLOB), found $$count" 1>&2; \ |
| 44 | + exit 1; \ |
| 45 | + fi; \ |
| 46 | + ls -1 $(DEB_GLOB) |
| 47 | + |
| 48 | +clean: |
| 49 | + @echo "Removing staged packaging artifacts under debian/..." |
| 50 | + rm -rf debian/$(PACKAGE_NAME) debian/.debhelper debian/debhelper-build-stamp debian/files |
| 51 | + |
| 52 | +distclean: clean |
| 53 | + @echo "Removing built artifacts in parent directory (if any)..." |
| 54 | + rm -f ../$(PACKAGE_NAME)_*.deb ../$(PACKAGE_NAME)_*.buildinfo ../$(PACKAGE_NAME)_*.changes |
0 commit comments