Skip to content

Commit

Permalink
DESTDIR support and standard install variables
Browse files Browse the repository at this point in the history
  • Loading branch information
attipaci committed Nov 17, 2024
1 parent 0b6c416 commit 3bb173d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 29 deletions.
21 changes: 11 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,20 @@ Release candidate for the next feature release, expected around 1 February 2025.
/ `solarsystem_hp()` type custom planet ephemeris provider functions currently configured, so they may be used
directly, outside of `ephemeris()` calls.

- #93: Now supporting `make install` with prefix support (e.g. `make prefix=/opt install` to install under `/opt`).
You can also set other standard directory variables, as prescribed in the
- #93: Now supporting `make install` with prefix and DESTDIR support (e.g. `make prefix=/opt install` to install under
`/opt`, or `make DESTDIR="/tmp/stage" install` to stage install under `/tmp/stage`). You can also set other
standard directory variables, as prescribed in the
[GNU standard](https://www.gnu.org/prep/standards/html_node/Directory-Variables.html) to further customize the
install locations.

- #95, #98: Added support for using orbital elements. `object.type` can now be set to `NOVAS_ORBITAL_OBJECT`, whose orbit
can be defined by the set of `novas_orbital_elements`, relative to a `novas_orbital_system`. You can initialize an
`object` with a set of orbital elements using `make_orbital_object()`, and for planetary satellite orbits you might
use `novas_set_orbsys_pole()`. For orbital objects, `ephemeris()` will call on the new `novas_orbit_posvel()` to
calculate positions. While orbital elements do not always yield precise positions, they can for shorter periods,
provided that the orbital elements are up-to-date. For example, the Minor Planer Center (MPC) publishes accurate
orbital elements for all known asteroids and comets regularly. For newly discovered objects, this may be the only
and/or most accurate information available anywhere.
- #95, #98: Added support for using orbital elements. `object.type` can now be set to `NOVAS_ORBITAL_OBJECT`, whose
orbit can be defined by the set of `novas_orbital_elements`, relative to a `novas_orbital_system`. You can
initialize an `object` with a set of orbital elements using `make_orbital_object()`, and for planetary satellite
orbits you might use `novas_set_orbsys_pole()`. For orbital objects, `ephemeris()` will call on the new
`novas_orbit_posvel()` to calculate positions. While orbital elements do not always yield precise positions, they
can for shorter periods, provided that the orbital elements are up-to-date. For example, the Minor Planer Center
(MPC) publishes accurate orbital elements for all known asteroids and comets regularly. For newly discovered
objects, this may be the only and/or most accurate information available anywhere.

- #97: Added `NOVAS_EMB` (Earth-Moon Barycenter) and `NOVAS_PLUTO_BARYCENTER` to `enum novas_planets` to distinguish
from the planet center in calculations.
Expand Down
42 changes: 23 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -196,50 +196,54 @@ mydatadir ?= $(datadir)/supernovas
docdir ?= $(datarootdir)/doc/supernovas
htmldir ?= $(docdir)/html

# Standard install commands
INSTALL_PROGRAM ?= install
INSTALL_DATA ?= install -m 644

.PHONY: install
install: install-libs install-cio-data install-headers install-apidoc install-examples

.PHONY: install-libs
install-libs:
ifneq ($(wildcard $(LIB)/*),)
@echo "installing libraries to $(libdir)"
install -d $(libdir)
install -m 755 -D $(LIB)/lib*.so* $(libdir)/
@echo "installing libraries to $(DESTDIR)$(libdir)"
install -d $(DESTDIR)$(libdir)
$(INSTALL_PROGRAM) -D $(LIB)/lib*.so* $(DESTDIR)$(libdir)/
else
@echo "WARNING! Skipping libs install: needs 'shared' and/or 'static'"
endif

.PHONY: install-cio-data
install-cio-data:
@echo "installing CIO locator data to $(mydatadir)"
install -d $(mydatadir)
install -m 644 data/CIO_RA.TXT $(mydatadir)/CIO_RA.TXT
@echo "installing CIO locator data to $(DESTDIR)$(mydatadir)"
install -d $(DESTDIR)$(mydatadir)
$(INSTALL_DATA) data/CIO_RA.TXT $(DESTDIR)$(mydatadir)/CIO_RA.TXT

.PHONY: install-headers
install-headers:
@echo "installing headers to $(includedir)"
install -d $(includedir)
install -m 644 -D include/* $(includedir)/
@echo "installing headers to $(DESTDIR)$(includedir)"
install -d $(DESTDIR)$(includedir)
$(INSTALL_DATA) -D include/* $(DESTDIR)$(includedir)/

.PHONY: install-apidoc
install-apidoc:
ifneq ($(wildcard apidoc/html/search/*),)
@echo "installing API documentation to $(htmldir)"
install -d $(htmldir)/search
install -m 644 -D apidoc/html/search/* $(htmldir)/search/
install -m 644 -D apidoc/html/*.* $(htmldir)/
@echo "installing Doxygen tag file to $(docdir)"
install -d $(docdir)
install -m 644 apidoc/supernovas.tag $(docdir)/supernovas.tag
@echo "installing API documentation to $(DESTDIR)$(htmldir)"
install -d $(DESTDIR)$(htmldir)/search
$(INSTALL_DATA) -D apidoc/html/search/* $(DESTDIR)$(htmldir)/search/
$(INSTALL_DATA) -D apidoc/html/*.* $(DESTDIR)$(htmldir)/
@echo "installing Doxygen tag file to $(DESTDIR)$(docdir)"
install -d $(DESTDIR)$(docdir)
$(INSTALL_DATA) apidoc/supernovas.tag $(DESTDIR)$(docdir)/supernovas.tag
else
@echo "WARNING! Skipping apidoc install: needs doxygen and 'local-dox'"
endif

.PHONY: install-examples
install-examples:
@echo "installing examples to $(docdir)"
install -d $(docdir)
install -m 644 -D examples/* $(docdir)
@echo "installing examples to $(DESTDIR)$(docdir)"
install -d $(DESTDIR)$(docdir)
$(INSTALL_DATA) -D examples/* $(DESTDIR)$(docdir)


# Built-in help screen for `make help`
Expand Down

0 comments on commit 3bb173d

Please sign in to comment.