atrri

Refractive indices varying with wavelength
git clone git://git.meso-star.fr/atrri.git
Log | Files | Refs | README | LICENSE

commit ea6b2fed369cdfeb3aacd3c33ad0b9cbfcf0b8de
parent a95f6a7e3dd73eb0527ed5091966c81efc1a1cf2
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Tue, 31 Oct 2023 09:26:27 +0100

Merge branch 'feature_posix_make' into develop

Diffstat:
M.gitignore | 14+++++++-------
AMakefile | 150+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MREADME.md | 37+++++++++++++++++--------------------
Aatrri.5 | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aatrri.pc.in | 10++++++++++
Dcmake/CMakeLists.txt | 119-------------------------------------------------------------------------------
Aconfig.mk | 77+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ddoc/atrri.5.scd | 65-----------------------------------------------------------------
Amake.sh | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msrc/atrri.c | 2+-
Msrc/atrri.h | 2+-
Msrc/atrri_c.h | 2+-
Msrc/atrri_log.c | 2+-
Msrc/atrri_log.h | 2+-
Msrc/test_atrri.c | 2+-
Msrc/test_atrri_load.c | 2+-
16 files changed, 409 insertions(+), 218 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -1,12 +1,12 @@ .gitignore -CMakeCache.txt -CMakeFiles -Makefile -tmp [Bb]uild* *.sw[po] -*.[ao] -*.orig +*.[aod] +*.so *~ +test* +!test*.[ch] +.config +.test tags - +*.pc diff --git a/Makefile b/Makefile @@ -0,0 +1,150 @@ +# Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) +# Copyright (C) 2021 Centre National de la Recherche Scientifique +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +.POSIX: +.SUFFIXES: # Clean up default inference rules + +include config.mk + +LIBNAME_STATIC = libatrri.a +LIBNAME_SHARED = libatrri.so +LIBNAME = $(LIBNAME_$(LIB_TYPE)) + +################################################################################ +# Library building +################################################################################ +SRC = src/atrri.c src/atrri_log.c +OBJ = $(SRC:.c=.o) +DEP = $(SRC:.c=.d) + +build_library: .config $(DEP) + @$(MAKE) -fMakefile $$(for i in $(DEP); do echo -f $${i}; done) \ + $$(if [ -n "$(LIBNAME)" ]; then \ + echo "$(LIBNAME)"; \ + else \ + echo "$(LIBNAME_SHARED)"; \ + fi) + +$(DEP) $(OBJ): config.mk + +$(LIBNAME_SHARED): $(OBJ) + $(CC) $(CFLAGS_SO) $(RSYS_CFLAGS) -o $@ $(OBJ) $(LDFLAGS_SO) $(RSYS_LIBS) + +$(LIBNAME_STATIC): libatrri.o + $(AR) -rc $@ $? + $(RANLIB) $@ + +libatrri.o: $(OBJ) + $(LD) -r $(OBJ) -o $@ + $(OBJCOPY) $(OCPFLAGS) $@ + +.config: config.mk + @if ! $(PKG_CONFIG) --atleast-version $(RSYS_VERSION) rsys; then \ + echo "rsys $(RSYS_VERSION) not found" >&2; exit 1; fi + @echo "config done" > $@ + +.SUFFIXES: .c .d .o +.c.d: + @$(CC) $(CFLAGS_SO) $(RSYS_CFLAGS) -MM -MT "$(@:.d=.o) $@" $< -MF $@ + +.c.o: + $(CC) $(CFLAGS_SO) $(RSYS_CFLAGS) -DATRRI_SHARED_BUILD -c $< -o $@ + +################################################################################ +# Installation +################################################################################ +pkg: + sed -e 's#@PREFIX@#$(PREFIX)#g'\ + -e 's#@VERSION@#$(VERSION)#g'\ + -e 's#@RSYS_VERSION@#$(RSYS_VERSION)#g'\ + atrri.pc.in > atrri.pc + +atrri-local.pc: atrri.pc.in + sed -e '1d'\ + -e 's#^includedir=.*#includedir=./src/#'\ + -e 's#^libdir=.*#libdir=./#'\ + -e 's#@VERSION@#$(VERSION)#g'\ + -e 's#@RSYS_VERSION@#$(RSYS_VERSION)#g'\ + atrri.pc.in > $@ + +install: build_library pkg + @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/lib" $(LIBNAME) + @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/lib/pkgconfig" atrri.pc + @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/include/astoria" src/atrri.h + @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/share/doc/atrri" COPYING README.md + @$(SHELL) make.sh install "$(DESTDIR)$(PREFIX)/share/man/man5" atrri.5 + +uninstall: + rm -f "$(DESTDIR)$(PREFIX)/lib/$(LIBNAME)" + rm -f "$(DESTDIR)$(PREFIX)/lib/pkgconfig/atrri.pc" + rm -f "$(DESTDIR)$(PREFIX)/share/doc/atrri/COPYING" + rm -f "$(DESTDIR)$(PREFIX)/share/doc/atrri/README.md" + rm -f "$(DESTDIR)$(PREFIX)/include/astoria/atrri.h" + rm -f "$(DESTDIR)$(PREFIX)/share/man/man5/atrri.5" + +################################################################################ +# Miscellaneous targets +################################################################################ +all: build_library build_tests + +clean: clean_test + rm -f $(OBJ) $(TEST_OBJ) $(LIBNAME) + rm -f .config .test libatrri.o atrri.pc atrri-local.pc + +distclean: clean + rm -f $(DEP) $(TEST_DEP) + +lint: + shellcheck -o all make.sh + mandoc -Tlint -Wall atrri.5 + +################################################################################ +# Tests +################################################################################ +TEST_SRC =\ + src/test_atrri.c\ + src/test_atrri_load.c +TEST_OBJ = $(TEST_SRC:.c=.o) +TEST_DEP = $(TEST_SRC:.c=.d) + +PKG_CONFIG_LOCAL = PKG_CONFIG_PATH="./:$${PKG_CONFIG_PATH}" $(PKG_CONFIG) +ATRRI_CFLAGS = $$($(PKG_CONFIG_LOCAL) $(PCFLAGS) --cflags atrri-local.pc) +ATRRI_LIBS = $$($(PKG_CONFIG_LOCAL) $(PCFLAGS) --libs atrri-local.pc) + +test: build_tests + @$(SHELL) make.sh run_test $(TEST_SRC) + +build_tests: build_library $(TEST_DEP) .test + @$(MAKE) -fMakefile -f.test $$(for i in $(TEST_DEP); do echo -f"$${i}"; done) test_bin + +.test: Makefile make.sh + @$(SHELL) make.sh config_test $(TEST_SRC) > $@ + +clean_test: + $(SHELL) make.sh clean_test $(TEST_SRC) + rm -f test_file.atrri + +$(TEST_DEP): config.mk atrri-local.pc + @$(CC) $(CFLAGS_EXE) $(ATRRI_CFLAGS) $(RSYS_CFLAGS) \ + -MM -MT "$(@:.d=.o) $@" $(@:.d=.c) -MF $@ + +$(TEST_OBJ): config.mk atrri-local.pc + $(CC) $(CFLAGS_EXE) $(ATRRI_CFLAGS) $(RSYS_CFLAGS) -c $(@:.o=.c) -o $@ + +test_atrri \ +test_atrri_load \ +: config.mk atrri-local.pc $(LIBNAME) + $(CC) $(CFLAGS_EXE) -o $@ src/$@.o $(LDFLAGS_EXE) $(ATRRI_LIBS) $(RSYS_LIBS) -lm diff --git a/README.md b/README.md @@ -1,24 +1,21 @@ # AsToRia: Refractive Index -This C library loads the per wavelength refraction index wrt the AtrRI -fileformat. - -## How to build - -This library is compatible GNU/Linux 64-bits. It relies the -[CMake](http://www.cmake.org) and the -[RCMake](https://gitlab.com/vaplv/rcmake/) packages to build. It also depends -on the [RSys](https://gitlab.com/vaplv/rsys/) library. It optionally depends on -[scdoc](https://sr.ht/~sircmpwn/scdoc/) which, if available, is used to -generate the man pages. - -First ensure that CMake is installed on your system. Then install the RCMake -package as well as the aforementioned prerequisites. Finally generate the -project from the `cmake/CMakeLists.txt` file by appending to the -`CMAKE_PREFIX_PATH` variable the install directories of its dependencies. The -resulting project can be edited, built, tested and installed as any CMake -project. Refer to the [CMake documentation](https://cmake.org/documentation) -for further informations on CMake. +This C library loads the refractive index by wavelength stored in atrri format. +See `atrri.5` for format specification. + +## Requirements + +- C compiler +- POSIX make +- pkg-config +- [RSys](https://gitlab.com/vaplv/rsys) +- [mandoc](https://mandoc.bsd.lv) + +## Installation + +Edit config.mk as needed, then run: + + make clean install ## Release notes @@ -34,7 +31,7 @@ obsolete version 2.8. ## Copyright -Copyright (C) 2022, 2023 [|Méso|Star](http://www.meso-star.com) (<contact@meso-star.com>) +Copyright (C) 2022, 2023 |Méso|Star (contact@meso-star.com) Copyright (C) 2021 Centre National de la Recherche Scientifique (CNRS) ## License diff --git a/atrri.5 b/atrri.5 @@ -0,0 +1,70 @@ +.\" Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) +.\" Copyright (C) 2021 Centre National de la Recherche Scientifique +.\" +.\" This program is free software: you can redistribute it and/or modify +.\" it under the terms of the GNU General Public License as published by +.\" the Free Software Foundation, either version 3 of the License, or +.\" (at your option) any later version. +.\" +.\" This program is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this program. If not, see <http://www.gnu.org/licenses/>. +.Dd August 30, 2023 +.Dt ATRRI 5 +.Os +.Sh NAME +.Nm atrri +.Nd AsToRia: Refractive Index +.Sh DESCRIPTION +.Nm +is a plain text file format for storing a list of refractive indices +that vary spectrally. +Each refractive index is defined by 3 double precision +floating point numbers: the wavelength in nanometers at which the index is +set, followed by the real part and the imaginary part of the refractive index +itself. +Note that the listed refractive indices should be sorted in ascending +order relative to their wavelength. +.Pp +Characters behind the pound sign +.Pq Li # +are considered comments and are therefore +ignored. +Empty lines, that is, lines without characters or consisting solely of +spaces and tabs, are simply ignored. +.Pp +The file format is as follows: +.Bl -column (refractive-index) (::=) () +.It Ao Va atrri Ac Ta ::= Ta Ao Va refractive-index Ac +.It Ta Ta Va ... +.It Ao Va refractive-index Ac Ta ::= Ta +.Aq Va wavelength +.Aq Va n +.Aq Va kappa +.It Ao Va wavelength Ac Ta ::= Ta Ao Va real Ac +# In nm +.It Ao Va n Ac Ta ::= Ta Ao Va real Ac +# Real part +.It Ao Va kappa Ac Ta ::= Ta Ao Va real Ac +# Imaginary part +.El +.Sh EXAMPLES +.Bd -literal +# Wavelength in nm real part imaginary part + +300.000011921 1.740000010 0.469999999 +310.000002384 1.741990328 0.469004273 +319.999992847 1.743917465 0.468010038 +329.999983311 1.745785475 0.467014253 +339.999973774 1.748130083 0.465993971 +349.999964237 1.750000000 0.464985400 +359.999954700 1.750000000 0.463959038 +369.999945164 1.750000000 0.462961257 +379.999935627 1.750000000 0.461990029 +389.999926090 1.750000000 0.460981935 +399.999916553 1.750000000 0.459957659 +.Ed diff --git a/atrri.pc.in b/atrri.pc.in @@ -0,0 +1,10 @@ +prefix=@PREFIX@ +includedir=${prefix}/include +libdir=${prefix}/lib + +Requires: rsys >= @RSYS_VERSION@ +Name: atrri +Description: AsToRia Refractive Index library +Version: @VERSION@ +Libs: -L${libdir} -latrri +CFlags: -I${includedir} diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -1,119 +0,0 @@ -# Copyright (C) 2022-2023 |Méso|Star> (contact@meso-star.com) -# Copyright (C) 2021 CNRS -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -cmake_minimum_required(VERSION 3.1) -project(atrri C) -enable_testing() - -set(ATRRI_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../src) -option(NO_TEST "Do not build tests" OFF) - -################################################################################ -# Check dependencies -################################################################################ -find_package(RCMake 0.4 REQUIRED) -find_package(RSys 0.10 REQUIRED) - -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${RCMAKE_SOURCE_DIR}) -include(rcmake) -include(rcmake_runtime) - -include_directories(${RSys_INCLUDE_DIR}) - -################################################################################ -# Configure and define targets -################################################################################ -set(VERSION_MAJOR 0) -set(VERSION_MINOR 0) -set(VERSION_PATCH 2) -set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) - -set(ATRRI_FILES_SRC - atrri.c - atrri_log.c) -set(ATRRI_FILES_INC - atrri_c.h - atrri_log.h) -set(ATRRI_FILES_INC_API - atrri.h) - -set(ATRRI_FILES_DOC COPYING README.md) - -# Prepend each file in the `ATRRI_FILES_<SRC|INC>' list by `ATRRI_SOURCE_DIR' -rcmake_prepend_path(ATRRI_FILES_SRC ${ATRRI_SOURCE_DIR}) -rcmake_prepend_path(ATRRI_FILES_INC ${ATRRI_SOURCE_DIR}) -rcmake_prepend_path(ATRRI_FILES_INC_API ${ATRRI_SOURCE_DIR}) -rcmake_prepend_path(ATRRI_FILES_DOC ${PROJECT_SOURCE_DIR}/../) - -add_library(atrri SHARED ${ATRRI_FILES_SRC} ${ATRRI_FILES_INC} ${ATRRI_FILES_INC_API}) -target_link_libraries(atrri RSys) - -set_target_properties(atrri PROPERTIES - DEFINE_SYMBOL ATRRI_SHARED_BUILD - VERSION ${VERSION} - SOVERSION ${VERSION_MAJOR}) - -rcmake_setup_devel(atrri AtrRI ${VERSION} astoria/atrri_version.h) - -################################################################################ -# Add tests -################################################################################ -if(NOT NO_TEST) - function(build_test _name) - add_executable(${_name} ${ATRRI_SOURCE_DIR}/${_name}.c) - target_link_libraries(${_name} atrri RSys ${ARGN}) - endfunction() - - function(new_test _name) - build_test(${_name} ${ARGN}) - add_test(${_name} ${_name}) - endfunction() - - new_test(test_atrri) - new_test(test_atrri_load m) -endif() - -################################################################################ -# Man page -############################################################################### -find_program(SCDOC NAMES scdoc) -if(NOT SCDOC) - message(WARNING - "The `scdoc' program is missing. " - "The Astoria Refractive Index man page cannot be generated.") -else() - set(_src ${PROJECT_SOURCE_DIR}/../doc/atrri.5.scd) - add_custom_command( - OUTPUT atrri.5 - COMMAND ${SCDOC} < ${_src} > atrri.5 - DEPENDS ${_src} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Buid ROFF man page atrri.5" - VERBATIM) - add_custom_target(man-roff ALL DEPENDS atrri.5) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/atrri.5 DESTINATION share/man/man5) -endif() - -################################################################################ -# Define output & install directories -################################################################################ -install(TARGETS atrri - ARCHIVE DESTINATION bin - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin) -install(FILES ${ATRRI_FILES_INC_API} DESTINATION include/astoria) -install(FILES ${ATRRI_FILES_DOC} DESTINATION share/doc/atrri) - diff --git a/config.mk b/config.mk @@ -0,0 +1,77 @@ +VERSION = 0.0.2 +PREFIX = /usr/local + +LIB_TYPE = SHARED +#LIB_TYPE = STATIC + +BUILD_TYPE = RELEASE +#BUILD_TYPE = DEBUG + +################################################################################ +# Tools +################################################################################ +AR = ar +CC = cc +LD = ld +OBJCOPY = objcopy +PKG_CONFIG = pkg-config +RANLIB = ranlib + +################################################################################ +# Dependencies +################################################################################ +PCFLAGS_SHARED = +PCFLAGS_STATIC = --static +PCFLAGS = $(PCFLAGS_$(LIB_TYPE)) + +RSYS_VERSION = 0.14 +RSYS_CFLAGS = $$($(PKG_CONFIG) $(PCFLAGS) --cflags rsys) +RSYS_LIBS = $$($(PKG_CONFIG) $(PCFLAGS) --libs rsys) + +################################################################################ +# Compilation options +################################################################################ +WFLAGS =\ + -Wall\ + -Wcast-align\ + -Wconversion\ + -Wextra\ + -Wmissing-declarations\ + -Wmissing-prototypes\ + -Wshadow + +CFLAGS_HARDENED =\ + -D_FORTIFY_SOURCES=2\ + -fcf-protection=full\ + -fstack-clash-protection\ + -fstack-protector-strong + +CFLAGS_COMMON =\ + -std=c89\ + -pedantic\ + -fvisibility=hidden\ + -fstrict-aliasing\ + $(CFLAGS_HARDENED)\ + $(WFLAGS) + +CFLAGS_DEBUG = -g $(CFLAGS_COMMON) +CFLAGS_RELEASE = -O2 -DNDEBUG $(CFLAGS_COMMON) +CFLAGS = $(CFLAGS_$(BUILD_TYPE)) + +CFLAGS_SO = $(CFLAGS) -fPIC +CFLAGS_EXE = $(CFLAGS) -fPIE + +################################################################################ +# Linker options +################################################################################ +LDFLAGS_HARDENED = -Wl,-z,relro,-z,now +LDFLAGS_DEBUG = $(LDFLAGS_HARDENED) +LDFLAGS_RELEASE = -s $(LDFLAGS_HARDENED) +LDFLAGS = $(LDFLAGS_$(BUILD_TYPE)) + +LDFLAGS_SO = $(LDFLAGS) -shared -Wl,--no-undefined +LDFLAGS_EXE = $(LDFLAGS) -pie + +OCPFLAGS_DEBUG = --localize-hidden +OCPFLAGS_RELEASE = --localize-hidden --strip-unneeded +OCPFLAGS = $(OCPFLAGS_$(BUILD_TYPE)) diff --git a/doc/atrri.5.scd b/doc/atrri.5.scd @@ -1,65 +0,0 @@ -atrri(5) - -; Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) -; Copyright (C) 2021 CNRS -; -; This program is free software: you can redistribute it and/or modify -; it under the terms of the GNU General Public License as published by -; the Free Software Foundation, either version 3 of the License, or -; (at your option) any later version. -; -; This program is distributed in the hope that it will be useful, -; but WITHOUT ANY WARRANTY; without even the implied warranty of -; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -; GNU General Public License for more details. -; -; You should have received a copy of the GNU General Public License -; along with this program. If not, see <http://www.gnu.org/licenses/>. - -# NAME - -atrri - AsToRia: Refractive Index - -# DESCRIPTION - -*atrri* is a plain text file format for storing a list of refractive indices -that vary spectrally. Each refractive index is defined by 3 double precision -floating point numbers: the wavelength in nanometers at which the index is -set, followed by the real part and the imaginary part of the refractive index -itself. Note that the listed refractive indices should be sorted in ascending -order relative to their wavelength. - -Characters behind the pound sign (#) are considered comments and are therefore -ignored. Empty lines, that is, lines without characters or consisting only of -spaces and tabs, are simply skipped. - -# GRAMMAR - -``` -<atrri> ::= <refractive-index> - [ <refractive-index> ... ] - -<refractive-index> ::= <wavelength> <n> <kappa> - -<wavelength> ::= <double> # In nm -<n> ::= <double> # Real part -<kappa> ::= <double> # Imaginary part -``` - -# EXAMPLE - -``` -# Wavelength in nm real part imaginary part - - 300.000011921 1.740000010 0.469999999 - 310.000002384 1.741990328 0.469004273 - 319.999992847 1.743917465 0.468010038 - 329.999983311 1.745785475 0.467014253 - 339.999973774 1.748130083 0.465993971 - 349.999964237 1.750000000 0.464985400 - 359.999954700 1.750000000 0.463959038 - 369.999945164 1.750000000 0.462961257 - 379.999935627 1.750000000 0.461990029 - 389.999926090 1.750000000 0.460981935 - 399.999916553 1.750000000 0.459957659 -``` diff --git a/make.sh b/make.sh @@ -0,0 +1,71 @@ +#!/bin/sh + +# Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) +# Copyright (C) 2021 Centre National de la Recherche Scientifique +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +set -e + +config_test() +{ + for i in "$@"; do + test=$(basename "${i}" ".c") + test_list="${test_list} ${test}" + printf "%s: %s\n" "${test}" "src/${test}.o" + done + printf "test_bin: %s\n" "${test_list}" +} + +run_test() +{ + for i in "$@"; do + test=$(basename "${i}" ".c") + + printf "%s " "${test}" + if "./${test}" > /dev/null 2>&1; then + printf "\033[1;32mOK\033[m\n" + else + printf "\033[1;31mError\033[m\n" + fi + done 2> /dev/null +} + +clean_test() +{ + for i in "$@"; do + rm -f "$(basename "${i}" ".c")" + done +} + +install() +{ + prefix=$1 + shift 1 + + mkdir -p "${prefix}" + + for i in "$@"; do + dst="${prefix}/${i##*/}" + + if cmp -s "${i}" "${dst}"; then + printf "Up to date %s\n" "${dst}" + else + printf "Installing %s\n" "${dst}" + cp "${i}" "${prefix}" + fi + done +} + +"$@" diff --git a/src/atrri.c b/src/atrri.c @@ -1,5 +1,5 @@ /* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) - * Copyright (C) 2021 CNRS + * Copyright (C) 2021 Centre National de la Recherche Scientifique * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/atrri.h b/src/atrri.h @@ -1,5 +1,5 @@ /* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) - * Copyright (C) 2021 CNRS + * Copyright (C) 2021 Centre National de la Recherche Scientifique * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/atrri_c.h b/src/atrri_c.h @@ -1,5 +1,5 @@ /* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) - * Copyright (C) 2021 CNRS + * Copyright (C) 2021 Centre National de la Recherche Scientifique * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/atrri_log.c b/src/atrri_log.c @@ -1,5 +1,5 @@ /* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) - * Copyright (C) 2021 CNRS + * Copyright (C) 2021 Centre National de la Recherche Scientifique * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/atrri_log.h b/src/atrri_log.h @@ -1,5 +1,5 @@ /* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) - * Copyright (C) 2021 CNRS + * Copyright (C) 2021 Centre National de la Recherche Scientifique * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_atrri.c b/src/test_atrri.c @@ -1,5 +1,5 @@ /* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) - * Copyright (C) 2021 CNRS + * Copyright (C) 2021 Centre National de la Recherche Scientifique * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_atrri_load.c b/src/test_atrri_load.c @@ -1,5 +1,5 @@ /* Copyright (C) 2022, 2023 |Méso|Star> (contact@meso-star.com) - * Copyright (C) 2021 CNRS + * Copyright (C) 2021 Centre National de la Recherche Scientifique * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by