make.sh (1431B)
1 #!/bin/sh 2 3 # Copyright (C) 2022, 2023 Centre National de la Recherche Scientifique 4 # Copyright (C) 2022, 2023 Institut Pierre-Simon Laplace 5 # Copyright (C) 2022, 2023 Institut de Physique du Globe de Paris 6 # Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) 7 # Copyright (C) 2022, 2023 Observatoire de Paris 8 # Copyright (C) 2022, 2023 Université de Reims Champagne-Ardenne 9 # Copyright (C) 2022, 2023 Université de Versaille Saint-Quentin 10 # Copyright (C) 2022, 2023 Université Paul Sabatier 11 # 12 # This program is free software: you can redistribute it and/or modify 13 # it under the terms of the GNU General Public License as published by 14 # the Free Software Foundation, either version 3 of the License, or 15 # (at your option) any later version. 16 # 17 # This program is distributed in the hope that it will be useful, 18 # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 # GNU General Public License for more details. 21 # 22 # You should have received a copy of the GNU General Public License 23 # along with this program. If not, see <http://www.gnu.org/licenses/>. 24 25 set -e 26 27 install() 28 { 29 prefix=$1 30 shift 1 31 32 mkdir -p "${prefix}" 33 34 for i in "$@"; do 35 dst="${prefix}/${i##*/}" 36 37 if cmp -s "${i}" "${dst}"; then 38 printf "Up to date %s\n" "${dst}" 39 else 40 printf "Installing %s\n" "${dst}" 41 cp "${i}" "${prefix}" 42 fi 43 done 44 } 45 46 "$@"