htrdr

Solving radiative transfer in heterogeneous media
git clone git://git.meso-star.fr/htrdr.git
Log | Files | Refs | README | LICENSE

Makefile (3294B)


      1 # Copyright (C) 2018-2019, 2022-2025 Centre National de la Recherche Scientifique
      2 # Copyright (C) 2020-2022 Institut Mines Télécom Albi-Carmaux
      3 # Copyright (C) 2022-2025 Institut Pierre-Simon Laplace
      4 # Copyright (C) 2022-2025 Institut de Physique du Globe de Paris
      5 # Copyright (C) 2018-2025 |Méso|Star> (contact@meso-star.com)
      6 # Copyright (C) 2022-2025 Observatoire de Paris
      7 # Copyright (C) 2022-2025 Université de Reims Champagne-Ardenne
      8 # Copyright (C) 2022-2025 Université de Versaille Saint-Quentin
      9 # Copyright (C) 2018-2019, 2022-2025 Université Paul Sabatier
     10 #
     11 # This program is free software: you can redistribute it and/or modify
     12 # it under the terms of the GNU General Public License as published by
     13 # the Free Software Foundation, either version 3 of the License, or
     14 # (at your option) any later version.
     15 #
     16 # This program is distributed in the hope that it will be useful,
     17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
     18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     19 # GNU General Public License for more details.
     20 #
     21 # You should have received a copy of the GNU General Public License
     22 # along with this program. If not, see <http://www.gnu.org/licenses/>.
     23 
     24 .POSIX:
     25 .SUFFIXES: # Clean up default inference rules
     26 
     27 include config.mk
     28 
     29 default install uninstall lint clean:
     30 	@$(MAKE) -fMakefile.core $@
     31 	@if [ "$(ATMOSPHERE)" = "ENABLE" ]; then $(MAKE) -fMakefile.atmosphere $@; fi
     32 	@if [ "$(COMBUSTION)" = "ENABLE" ]; then $(MAKE) -fMakefile.combustion $@; fi
     33 	@if [ "$(PLANETS)" = ENABLE ]; then $(MAKE) -fMakefile.planets $@; fi
     34 
     35 test:
     36 	@if [ "$(COMBUSTION)" = "ENABLE" ]; then $(MAKE) -fMakefile.combustion $@; fi
     37 	@if [ "$(PLANETS)" = ENABLE ]; then $(MAKE) -fMakefile.planets $@; fi
     38 
     39 default: htrdr
     40 install: install_common
     41 uninstall: uninstall_common
     42 lint: lint_common
     43 clean: clean_common
     44 
     45 htrdr: src/htrdr.in config.mk
     46 	sed -e "s/@MAJOR@/$(VERSION_MAJOR)/" \
     47 	    -e "s/@MINOR@/$(VERSION_MINOR)/" \
     48 	    -e "s/@PATCH@/$(VERSION_PATCH)/" \
     49 	    src/htrdr.in > $@
     50 
     51 install_common: htrdr
     52 	@$(SHELL) install.sh 755 "$(DESTDIR)$(BINPREFIX)" htrdr
     53 	@$(SHELL) install.sh 644 "$(DESTDIR)$(DOCPREFIX)/htrdr" COPYING README.md
     54 	@$(SHELL) install.sh 644 "$(DESTDIR)$(MANPREFIX)/man1" doc/htrdr.1
     55 	@$(SHELL) install.sh 644 "$(DESTDIR)$(MANPREFIX)/man5" doc/htrdr-image.5
     56 	@$(SHELL) install.sh 644 "$(DESTDIR)$(MANPREFIX)/man5" doc/htrdr-materials.5
     57 	@$(SHELL) install.sh 644 "$(DESTDIR)$(MANPREFIX)/man5" doc/htrdr-obj.5
     58 	@$(SHELL) install.sh 644 "$(DESTDIR)$(MANPREFIX)/man5" doc/rnrl.5
     59 
     60 uninstall_common:
     61 	rm -f "$(DESTDIR)$(BINPREFIX)/htrdr"
     62 	rm -f "$(DESTDIR)$(DOCPREFIX)/htrdr/COPYING"
     63 	rm -f "$(DESTDIR)$(DOCPREFIX)/htrdr/README.md"
     64 	rm -f "$(DESTDIR)$(MANPREFIX)/man1/htrdr.1"
     65 	rm -f "$(DESTDIR)$(MANPREFIX)/man5/htrdr-image.5"
     66 	rm -f "$(DESTDIR)$(MANPREFIX)/man5/htrdr-materials.5"
     67 	rm -f "$(DESTDIR)$(MANPREFIX)/man5/htrdr-obj.5"
     68 	rm -f "$(DESTDIR)$(MANPREFIX)/man5/rnrl.5"
     69 
     70 clean_common:
     71 	rm -f htrdr
     72 
     73 lint_common: htrdr
     74 	shellcheck -o all install.sh
     75 	shellcheck -o all htrdr
     76 	mandoc -Tlint -Wall doc/htrdr.1 || [ $$? -le 1 ]
     77 	mandoc -Tlint -Wall doc/htrdr-image.5 || [ $$? -le 1 ]
     78 	mandoc -Tlint -Wall doc/htrdr-materials.5 || [ $$? -le 1 ]
     79 	mandoc -Tlint -Wall doc/htrdr-obj.5 || [ $$? -le 1 ]
     80 	mandoc -Tlint -Wall doc/rnrl.5 || [ $$? -le 1 ]