Makefile (1683B)
1 # Copyright (C) 2026 Centre National de la Recherche Scientifique 2 # Copyright (C) 2026 |Méso|Star> (contact@meso-star.com) 3 # 4 # This program is free software: you can redistribute it and/or modify 5 # it under the terms of the GNU General Public License as published by 6 # the Free Software Foundation, either version 3 of the License, or 7 # (at your option) any later version. 8 # 9 # This program is distributed in the hope that it will be useful, 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 # GNU General Public License for more details. 13 # 14 # You should have received a copy of the GNU General Public License 15 # along with this program. If not, see <http://www.gnu.org/licenses/>. */ 16 17 .POSIX: 18 .SUFFIXES: # Clean-up default inference rules 19 20 # Default install directories 21 PREFIX = /usr/local 22 BINPREFIX = $(PREFIX)/bin 23 MANPREFIX = $(PREFIX)/share/man 24 25 # Nothing to do 26 default: 27 28 install: 29 install() { mode="$$1"; prefix="$$2"; shift 2; \ 30 mkdir -p "$${prefix}"; \ 31 cp "$$@" "$${prefix}"; \ 32 printf '%s\n' "$${@}" | while read -r i; do \ 33 chmod "$${mode}" "$${prefix}/$${i##*/}"; \ 34 done; \ 35 }; \ 36 install 755 "$(DESTDIR)$(BINPREFIX)" obj2vtk; \ 37 install 644 "$(DESTDIR)$(MANPREFIX)/man1" obj2vtk.1; \ 38 install 644 "$(DESTDIR)$(PREFIX)/share/doc/obj2vtk" COPYING; \ 39 install 644 "$(DESTDIR)$(PREFIX)/share/doc/obj2vtk" README.md 40 41 uninstall: 42 rm -f "$(DESTDIR)$(BINPREFIX)/obj2vtk" 43 rm -f "$(DESTDIR)$(MANPREFIX)/man1/obj2vtk.1" 44 rm -f "$(DESTDIR)$(PREFIX)/share/doc/obj2vtk/COPYING" 45 rm -f "$(DESTDIR)$(PREFIX)/share/doc/obj2vtk/README.md" 46 47 lint: 48 shellcheck -o all obj2vtk 49 mandoc -Tlint obj2vtk.1