From 32f0fc5bdc1c57585c3d6261a6c9ce9ad7895501 Mon Sep 17 00:00:00 2001 From: Attila Kovacs Date: Wed, 27 Nov 2024 13:15:49 +0100 Subject: [PATCH] Conform closer to GNU Makefile standard --- .github/workflows/{check.yml => analyze.yml} | 6 ++-- Makefile | 29 ++++++++++++++++---- README.md | 6 ++-- build.mk | 6 ++-- config.mk | 2 +- 5 files changed, 34 insertions(+), 15 deletions(-) rename .github/workflows/{check.yml => analyze.yml} (83%) diff --git a/.github/workflows/check.yml b/.github/workflows/analyze.yml similarity index 83% rename from .github/workflows/check.yml rename to .github/workflows/analyze.yml index 80a90cc9..d58fb3d8 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/analyze.yml @@ -9,7 +9,7 @@ on: - 'include/**' - 'Makefile' - '*.mk' - - '.github/workflows/check.yml' + - '.github/workflows/analyze.yml' pull_request: paths: @@ -17,7 +17,7 @@ on: - 'include/**' - 'Makefile' - '*.mk' - - '.github/workflows/check.yml' + - '.github/workflows/analyze.yml' jobs: @@ -35,4 +35,4 @@ jobs: run: sudo apt-get install -y cppcheck - name: Run cppcheck - run: make check + run: make analyze diff --git a/Makefile b/Makefile index 2c957520..9670680b 100644 --- a/Makefile +++ b/Makefile @@ -85,13 +85,17 @@ solsys: $(SOLSYS_TARGETS) # All of the above .PHONY: all -all: distro static test coverage check +all: distro static test coverage analyze # Run regression tests .PHONY: test test: make -C test run +# Perform checks (test + analyze) +.PHONY: check +check: test analyze + # Measure test coverage (on test set of files only) .PHONY: coverage coverage: @@ -201,7 +205,7 @@ INSTALL_PROGRAM ?= install INSTALL_DATA ?= install -m 644 .PHONY: install -install: install-libs install-cio-data install-headers install-apidoc install-examples +install: install-libs install-cio-data install-headers install-html install-examples .PHONY: install-libs install-libs: @@ -225,8 +229,8 @@ install-headers: install -d $(DESTDIR)$(includedir) $(INSTALL_DATA) -D include/* $(DESTDIR)$(includedir)/ -.PHONY: install-apidoc -install-apidoc: +.PHONY: install-html +install-html: ifneq ($(wildcard apidoc/html/search/*),) @echo "installing API documentation to $(DESTDIR)$(htmldir)" install -d $(DESTDIR)$(htmldir)/search @@ -246,6 +250,20 @@ install-examples: $(INSTALL_DATA) -D examples/* $(DESTDIR)$(docdir) +# Some standard GNU targets, that should always exist... +.PHONY: html +html: local-dox + +.PHONY: dvi +dvi: + +.PHONY: ps +ps: + +.PHONY: pdf +pdf: + + # Built-in help screen for `make help` .PHONY: help help: @@ -265,8 +283,9 @@ help: @echo " call implentations (e.g. 'solsys1.o', 'eph_manager.o'...)." @echo " cio_ra.bin Generates a platform-specific binary CIO locator lookup data file" @echo " 'cio_ra.bin' from the ASCII 'data/CIO_RA.TXT'." - @echo " check Performs static analysis with 'cppcheck'." @echo " test Runs regression tests." + @echo " analyze Performs static code analysis with 'cppcheck'." + @echo " check Same as 'test' and then 'analyze'." @echo " coverage Runs 'gcov' to analyze regression test coverage." @echo " all All of the above." @echo " install Install components (e.g. 'make prefix= install')" diff --git a/README.md b/README.md index 3d2c342d..5b3ea032 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![Build Status](https://github.com/Smithsonian/SuperNOVAS/actions/workflows/build.yml/badge.svg) ![Test](https://github.com/Smithsonian/SuperNOVAS/actions/workflows/test.yml/badge.svg) -![Static Analysis](https://github.com/Smithsonian/SuperNOVAS/actions/workflows/check.yml/badge.svg) +![Static Analysis](https://github.com/Smithsonian/SuperNOVAS/actions/workflows/analyze.yml/badge.svg) ![API documentation](https://github.com/Smithsonian/SuperNOVAS/actions/workflows/dox.yml/badge.svg) @@ -1103,7 +1103,7 @@ all known solar systems bodies, down to the tiniest rocks. ### Optional CALCEPH integration -The [CALCEPH](https://www.imcce.fr/recherche/equipes/asd/calceph/) library provides an easy-to-use access to JPL and +The [CALCEPH](https://www.imcce.fr/recherche/equipes/asd/calceph/) library provides easy-to-use access to JPL and INPOP ephemeris files from C/C++. As of version 1.2, we provide optional support for interfacing SuperNOVAS with the the CALCEPH C library for handling Solar-system objects. @@ -1130,7 +1130,7 @@ code: } // ----------------------------------------------------------------------- - // Optionally you may use a separate ephemeris data for major planets + // Optionally you may use a separate ephemeris dataset for major planets // (or if planet ephemeris was included in 'eph' above, you don't have to) t_calcephbin *pleph = calceph_open(...); int status = novas_use_calceph(pleph); diff --git a/build.mk b/build.mk index 7136d787..e0dfa8e2 100644 --- a/build.mk +++ b/build.mk @@ -50,9 +50,9 @@ clean: clean-local distclean: distclean-local # Static code analysis using 'cppcheck' -.PHONY: check -check: - @echo " [check]" +.PHONY: analyze +analyze: + @echo " [analyze]" @cppcheck $(CPPFLAGS) $(CHECKOPTS) $(SRC) # Doxygen documentation (HTML and man pages) under apidocs/ diff --git a/config.mk b/config.mk index 8324f941..94fa46c4 100644 --- a/config.mk +++ b/config.mk @@ -22,7 +22,7 @@ CPPFLAGS += -I$(INC) # Base compiler options (if not defined externally...) # -std=c99 may not be supported by some very old compilers... -CFLAGS ?= -Os -Wall -std=c99 +CFLAGS ?= -g -Os -Wall -std=c99 # Extra warnings (not supported on all compilers) #CFLAGS += -Wextra