diff --git a/Doxyfile b/Doxyfile index 9ec94018..8f051123 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.9.7 +# Doxyfile 1.10.0 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -63,6 +63,12 @@ PROJECT_BRIEF = "The NOVAS C library, made better" PROJECT_LOGO = resources/smithsonian-logo-55x55.png +# With the PROJECT_ICON tag one can specify an icon that is included in the tabs +# when the HTML document is shown. Doxygen will copy the logo to the output +# directory. + +PROJECT_ICON = + # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If @@ -366,9 +372,9 @@ TOC_INCLUDE_HEADINGS = 5 # The MARKDOWN_ID_STYLE tag can be used to specify the algorithm used to # generate identifiers for the Markdown headings. Note: Every identifier is # unique. -# Possible values are: DOXYGEN Use a fixed 'autotoc_md' string followed by a -# sequence number starting at 0. and GITHUB Use the lower case version of title -# with any whitespace replaced by '-' and punctations characters removed.. +# Possible values are: DOXYGEN use a fixed 'autotoc_md' string followed by a +# sequence number starting at 0 and GITHUB use the lower case version of title +# with any whitespace replaced by '-' and punctuation characters removed. # The default value is: DOXYGEN. # This tag requires that the tag MARKDOWN_SUPPORT is set to YES. @@ -978,12 +984,12 @@ INPUT_FILE_ENCODING = # Note the list of default checked file patterns might differ from the list of # default file extension mappings. # -# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, -# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, -# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, -# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C -# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, -# *.vhdl, *.ucf, *.qsf and *.ice. +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cxxm, +# *.cpp, *.cppm, *.ccm, *.c++, *.c++m, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, +# *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, *.h++, *.ixx, *.l, *.cs, *.d, +# *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to +# be provided as doxygen C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f18, *.f, *.for, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice. FILE_PATTERNS = *.c \ *.cc \ @@ -1167,7 +1173,7 @@ FILTER_SOURCE_PATTERNS = # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = README-headless.md +USE_MDFILE_AS_MAINPAGE = README-orig.md # The Fortran standard specifies that for fixed formatted Fortran code all # characters from position 72 are to be considered as comment. A common @@ -1192,7 +1198,8 @@ FORTRAN_COMMENT_AFTER = 72 SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. +# multi-line macros, enums or list initialized variables directly into the +# documentation. # The default value is: NO. INLINE_SOURCES = NO @@ -1264,46 +1271,6 @@ USE_HTAGS = NO VERBATIM_HEADERS = NO -# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the -# clang parser (see: -# http://clang.llvm.org/) for more accurate parsing at the cost of reduced -# performance. This can be particularly helpful with template rich C++ code for -# which doxygen's built-in parser lacks the necessary type information. -# Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse_libclang=ON option for CMake. -# The default value is: NO. - -CLANG_ASSISTED_PARSING = NO - -# If the CLANG_ASSISTED_PARSING tag is set to YES and the CLANG_ADD_INC_PATHS -# tag is set to YES then doxygen will add the directory of each input to the -# include path. -# The default value is: YES. -# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. - -CLANG_ADD_INC_PATHS = YES - -# If clang assisted parsing is enabled you can provide the compiler with command -# line options that you would normally use when invoking the compiler. Note that -# the include paths will already be set by doxygen for the files and directories -# specified with INPUT and INCLUDE_PATH. -# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. - -CLANG_OPTIONS = - -# If clang assisted parsing is enabled you can provide the clang parser with the -# path to the directory containing a file called compile_commands.json. This -# file is the compilation database (see: -# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the -# options used when the source files were built. This is equivalent to -# specifying the -p option to a clang tool, such as clang-check. These options -# will then be passed to the parser. Any options specified with CLANG_OPTIONS -# will be added as well. -# Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse_libclang=ON option for CMake. - -CLANG_DATABASE_PATH = - #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -1480,6 +1447,33 @@ HTML_DYNAMIC_MENUS = YES HTML_DYNAMIC_SECTIONS = YES +# If the HTML_CODE_FOLDING tag is set to YES then classes and functions can be +# dynamically folded and expanded in the generated HTML source code. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_CODE_FOLDING = YES + +# If the HTML_COPY_CLIPBOARD tag is set to YES then doxygen will show an icon in +# the top right corner of code and text fragments that allows the user to copy +# its content to the clipboard. Note this only works if supported by the browser +# and the web page is served via a secure context (see: +# https://www.w3.org/TR/secure-contexts/), i.e. using the https: or file: +# protocol. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COPY_CLIPBOARD = YES + +# Doxygen stores a couple of settings persistently in the browser (via e.g. +# cookies). By default these settings apply to all HTML pages generated by +# doxygen across all projects. The HTML_PROJECT_COOKIE tag can be used to store +# the settings under a project specific key, such that the user preferences will +# be stored separately. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_PROJECT_COOKIE = + # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to @@ -1702,7 +1696,7 @@ GENERATE_ECLIPSEHELP = YES # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. -ECLIPSE_DOC_ID = edu.harvard.cfa.SuperNOVAS +ECLIPSE_DOC_ID = edu.harvard.cfa.supernovas # If you want full control over the layout of the generated HTML pages it might # be necessary to disable the index and replace it with your own. The @@ -1951,7 +1945,7 @@ SEARCHDATA_FILE = searchdata.xml # projects and redirect the results back to the right project. # This tag requires that the tag SEARCHENGINE is set to YES. -EXTERNAL_SEARCH_ID = novas +EXTERNAL_SEARCH_ID = supernovas # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen # projects other than the one defined by this configuration file, but that are @@ -2108,7 +2102,7 @@ PDF_HYPERLINKS = YES USE_PDFLATEX = YES -# The LATEX_BATCHMODE tag ignals the behavior of LaTeX in case of an error. +# The LATEX_BATCHMODE tag signals the behavior of LaTeX in case of an error. # Possible values are: NO same as ERROR_STOP, YES same as BATCH, BATCH In batch # mode nothing is printed on the terminal, errors are scrolled as if is # hit at every error; missing files that TeX tries to input or request from @@ -2314,6 +2308,28 @@ GENERATE_AUTOGEN_DEF = NO # Configuration options related to Sqlite3 output #--------------------------------------------------------------------------- +# If the GENERATE_SQLITE3 tag is set to YES doxygen will generate a Sqlite3 +# database with symbols found by doxygen stored in tables. +# The default value is: NO. + +GENERATE_SQLITE3 = NO + +# The SQLITE3_OUTPUT tag is used to specify where the Sqlite3 database will be +# put. If a relative path is entered the value of OUTPUT_DIRECTORY will be put +# in front of it. +# The default directory is: sqlite3. +# This tag requires that the tag GENERATE_SQLITE3 is set to YES. + +SQLITE3_OUTPUT = sqlite3 + +# The SQLITE3_RECREATE_DB tag is set to YES, the existing doxygen_sqlite3.db +# database file will be recreated with each doxygen run. If set to NO, doxygen +# will warn if a database file is already found and not modify it. +# The default value is: YES. +# This tag requires that the tag GENERATE_SQLITE3 is set to YES. + +SQLITE3_RECREATE_DB = YES + #--------------------------------------------------------------------------- # Configuration options related to the Perl module output #--------------------------------------------------------------------------- @@ -2456,15 +2472,15 @@ TAGFILES = GENERATE_TAGFILE = apidoc/novas.tag -# If the ALLEXTERNALS tag is set to YES, all external class will be listed in -# the class index. If set to NO, only the inherited external classes will be -# listed. +# If the ALLEXTERNALS tag is set to YES, all external classes and namespaces +# will be listed in the class and namespace index. If set to NO, only the +# inherited external classes will be listed. # The default value is: NO. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will be +# in the topic index. If set to NO, only the current project's groups will be # listed. # The default value is: YES. @@ -2549,7 +2565,11 @@ DOT_FONTPATH = # the CLASS_GRAPH tag is set to YES and HAVE_DOT is disabled or if the # CLASS_GRAPH tag is set to BUILTIN, then the built-in generator will be used. # If the CLASS_GRAPH tag is set to TEXT the direct and indirect inheritance -# relations will be shown as texts / links. +# relations will be shown as texts / links. Explicit enabling an inheritance +# graph or choosing a different representation for an inheritance graph of a +# specific class, can be accomplished by means of the command \inheritancegraph. +# Disabling an inheritance graph can be accomplished by means of the command +# \hideinheritancegraph. # Possible values are: NO, YES, TEXT, GRAPH and BUILTIN. # The default value is: YES. @@ -2558,15 +2578,21 @@ CLASS_GRAPH = YES # If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a # graph for each documented class showing the direct and indirect implementation # dependencies (inheritance, containment, and class references variables) of the -# class with other documented classes. +# class with other documented classes. Explicit enabling a collaboration graph, +# when COLLABORATION_GRAPH is set to NO, can be accomplished by means of the +# command \collaborationgraph. Disabling a collaboration graph can be +# accomplished by means of the command \hidecollaborationgraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for -# groups, showing the direct groups dependencies. See also the chapter Grouping -# in the manual. +# groups, showing the direct groups dependencies. Explicit enabling a group +# dependency graph, when GROUP_GRAPHS is set to NO, can be accomplished by means +# of the command \groupgraph. Disabling a directory graph can be accomplished by +# means of the command \hidegroupgraph. See also the chapter Grouping in the +# manual. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2608,8 +2634,8 @@ DOT_UML_DETAILS = NO # The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters # to display on a single line. If the actual line length exceeds this threshold -# significantly it will wrapped across multiple lines. Some heuristics are apply -# to avoid ugly line breaks. +# significantly it will be wrapped across multiple lines. Some heuristics are +# applied to avoid ugly line breaks. # Minimum value: 0, maximum value: 1000, default value: 17. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2626,7 +2652,9 @@ TEMPLATE_RELATIONS = NO # If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to # YES then doxygen will generate a graph for each documented file showing the # direct and indirect include dependencies of the file with other documented -# files. +# files. Explicit enabling an include graph, when INCLUDE_GRAPH is is set to NO, +# can be accomplished by means of the command \includegraph. Disabling an +# include graph can be accomplished by means of the command \hideincludegraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2635,7 +2663,10 @@ INCLUDE_GRAPH = YES # If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are # set to YES then doxygen will generate a graph for each documented file showing # the direct and indirect include dependencies of the file with other documented -# files. +# files. Explicit enabling an included by graph, when INCLUDED_BY_GRAPH is set +# to NO, can be accomplished by means of the command \includedbygraph. Disabling +# an included by graph can be accomplished by means of the command +# \hideincludedbygraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2675,7 +2706,10 @@ GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the # dependencies a directory has on other directories in a graphical way. The # dependency relations are determined by the #include relations between the -# files in the directories. +# files in the directories. Explicit enabling a directory graph, when +# DIRECTORY_GRAPH is set to NO, can be accomplished by means of the command +# \directorygraph. Disabling a directory graph can be accomplished by means of +# the command \hidedirectorygraph. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. diff --git a/Makefile b/Makefile index 15881a49..58d859df 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,11 @@ include config.mk # Specific build targets and recipes below... # =============================================================================== -# The targets to build by default if not otherwise specified to 'make' -DEFAULT_TARGETS := static shared cio_ra.bin +# The version of the shared .so libraries +SO_VERSION := 1 + +# The documentation components to build +DOC_TARGETS := README-orig.md # Check if there is a doxygen we can run ifndef DOXYGEN @@ -22,107 +25,125 @@ endif # If there is doxygen, build the API documentation also by default ifeq ($(.SHELLSTATUS),0) - DEFAULT_TARGETS += dox + DOC_TARGETS += dox else $(info WARNING! Doxygen is not available. Will skip 'dox' target) endif SOLSYS_TARGETS := -SHARED_TARGETS := lib/novas.so +SHARED_TARGETS := lib/libsupernovas.so lib/libnovas.so ifneq ($(BUILTIN_SOLSYS1),1) SOLSYS_TARGETS += obj/solsys1.o obj/eph_manager.o - SHARED_TARGETS += lib/solsys1.so + SHARED_TARGETS += lib/libsolsys1.so endif ifneq ($(BUILTIN_SOLSYS2),1) SOLSYS_TARGETS += obj/solsys2.o obj/jplint.o - SHARED_TARGETS += lib/solsys2.so + SHARED_TARGETS += lib/libsolsys2.so endif ifneq ($(BUILTIN_SOLSYS3),1) SOLSYS_TARGETS += obj/solsys3.o - SHARED_TARGETS += lib/solsys3.so + SHARED_TARGETS += lib/libsolsys3.so endif ifneq ($(BUILTIN_SOLSYS_EPHEM),1) SOLSYS_TARGETS += obj/solsys-ephem.o - SHARED_TARGETS += lib/solsys-ephem.so + SHARED_TARGETS += lib/libsolsys-ephem.so endif +# Default target for packaging with Linux distributions +.PHONY: distro +distro: $(SHARED_TARGETS) cio_ra.bin $(DOC_TARGETS) - -.PHONY: api -api: $(DEFAULT_TARGETS) - -.PHONY: static -static: lib/novas.a solsys - +# Shared libraries (versioned and unversioned) .PHONY: shared shared: $(SHARED_TARGETS) +# Legacy static libraries (locally built) +.PHONY: static +static: lib/libnovas.a solsys + +# solarsystem() call handler objects .PHONY: solsys solsys: $(SOLSYS_TARGETS) +# All of the above +.PHONY: all +all: distro static test coverage check + +# Run regression tests .PHONY: test test: make -C test run +# Measure test coverage (on test set of files only) .PHONY: coverage coverage: make -C test coverage -.PHONY: all -all: api solsys obj/novascon.o test coverage check - +# Remove intermediates .PHONY: clean clean: - rm -f obj VERSION README-headless.md bin/cio_file + rm -f obj README-orig.md bin/cio_file make -C test clean +# Remove all generated files .PHONY: distclean distclean: clean rm -f lib cio_ra.bin -# Static library: novas.a -lib/novas.a: $(OBJECTS) | lib - ar -rc $@ $^ - ranlib $@ -# Shared library: novas.so -- same as supernovas.so except the builtin SONAME -lib/novas.so: LIBNAME := novas -lib/novas.so: $(SOURCES) +# ---------------------------------------------------------------------------- +# The nitty-gritty stuff below +# ---------------------------------------------------------------------------- + +# Unversioned shared libs (for linking against) +lib/lib%.so: + ln -sr $< $@ + +lib/libsupernovas.so: lib/libsupernovas.so.$(SO_VERSION) + +lib/libsolsys1.so: lib/libsolsys1.so.$(SO_VERSION) + +lib/libsolsys2.so: lib/libsolsys2.so.$(SO_VERSION) + +lib/libnovas.so: lib/libsupernovas.so + +# Share librarry recipe +lib/%.so.$(SO_VERSION) : | lib + $(CC) -o $@ $(CFLAGS) $^ -shared -fPIC -Wl,-soname,lib$(LIBNAME).so.$(SO_VERSION) # Shared library: supernovas.so -- same as novas.so except the builtin SONAME -lib/supernovas.so: LIBNAME := supernovas -lib/supernovas.so: $(SOURCES) +lib/libsupernovas.so.$(SO_VERSION): LIBNAME := supernovas +lib/libsupernovas.so.$(SO_VERSION): $(SOURCES) # Shared library: solsys1.so (standalone solsys1.c functionality) -lib/solsys1.so: BUILTIN_SOLSYS1 := 0 -lib/solsys1.so: LIBNAME := solsys1 -lib/solsys1.so: $(SRC)/solsys1.c $(SRC)/eph_manager.c +lib/libsolsys1.so.$(SO_VERSION): BUILTIN_SOLSYS1 := 0 +lib/libsolsys1.so.$(SO_VERSION): LIBNAME := solsys1 +lib/libsolsys1.so.$(SO_VERSION): $(SRC)/solsys1.c $(SRC)/eph_manager.c # Shared library: solsys2.so (standalone solsys2.c functionality) -lib/solsys2.so: BUILTIN_SOLSYS2 := 0 -lib/solsys2.so: LIBNAME := solsys2 -lib/solsys2.so: $(SRC)/solsys2.c $(SRC)/jplint.f +lib/libsolsys2.so.$(SO_VERSION): BUILTIN_SOLSYS2 := 0 +lib/libsolsys2.so.$(SO_VERSION): LIBNAME := solsys2 +lib/libsolsys2.so.$(SO_VERSION): $(SRC)/solsys2.c $(SRC)/jplint.f # Shared library: solsys1.so (standalone solsys1.c functionality) -lib/solsys3.so: BUILTIN_SOLSYS3 := 0 -lib/solsys3.so: LIBNAME := solsys3 -lib/solsys3.so: $(SRC)/solsys3.c +lib/libsolsys3.so.$(SO_VERSION): BUILTIN_SOLSYS3 := 0 +lib/libsolsys3.so.$(SO_VERSION): LIBNAME := solsys3 +lib/libsolsys3.so.$(SO_VERSION): $(SRC)/solsys3.c # Shared library: solsys2.so (standalone solsys2.c functionality) -lib/solsys-ephem.so: BUILTIN_SOLSYS_EPHEM := 0 -lib/solsys-ephem.so: LIBNAME := solsys-ephem -lib/solsys-ephem.so: $(SRC)/solsys-ephem.c +lib/libsolsys-ephem.so.$(SO_VERSION): BUILTIN_SOLSYS_EPHEM := 0 +lib/libsolsys-ephem.so.$(SO_VERSION): LIBNAME := solsys-ephem +lib/libsolsys-ephem.so.$(SO_VERSION): $(SRC)/solsys-ephem.c -lib/%.so: | lib bin/version - $(CC) -o $@ $(CFLAGS) $^ -shared -fPIC -Wl,-soname,lib$(LIBNAME).so.$(shell bin/version major) $(LDFLAGS) -.INTERMEDIATE: bin/version -bin/version: $(SRC)/version.c | bin - $(CC) -o $@ -I$(INC) $< +# Static library: novas.a +lib/libnovas.a: $(OBJECTS) | lib + ar -rc $@ $^ + ranlib $@ # CIO locator data .PHONY: cio_ra.bin @@ -136,10 +157,10 @@ bin/cio_file: obj/cio_file.o | bin obj/jplint.o: $(SRC)/jplint.f gfortran -c -o $@ $< -README-headless.md: README.md +README-orig.md: README.md LINE=`sed -n '/\# /{=;q;}' $<` && tail -n +$$((LINE+2)) $< > $@ -dox: README-headless.md +dox: README-orig.md .PHONY: help help: @@ -148,9 +169,9 @@ help: @echo @echo "The following targets are available:" @echo - @echo " api (default) 'static', 'shared', 'cio_ra.bin' targets, and also" - @echo " 'dox' if 'doxygen' is available, or was specified via the" - @echo " DOXYGEN variable (e.g. in 'config.mk')." + @echo " distro (default) 'shared', 'cio_ra.bin' targets, and also 'dox'" + @echo " if 'doxygen' is available, or was specified via the DOXYGEN" + @echo " variable (e.g. in 'config.mk')." @echo " static Builds the static 'lib/novas.a' library." @echo " shared Builds the shared 'novas.so', 'solsys1.so', and 'solsys2.so'." @echo " cio_ra.bin Generates the CIO locator lookup data file 'cio_ra.bin', in the" diff --git a/config.mk b/config.mk index bc3f65d8..09c4db6a 100644 --- a/config.mk +++ b/config.mk @@ -5,10 +5,11 @@ # You can include this snipplet in your Makefile also. # ============================================================================ -# Folders in which sources and headers are located, respectively -SRC = src -INC = include +# Compiler: use gcc by default +CC ?= gcc +# Root directory in which files are to be installed +DESTDIR ?= /usr # Base compiler options (if not defined externally...) CFLAGS ?= -Os -Wall @@ -17,6 +18,10 @@ CFLAGS ?= -Os -Wall CFLAGS += -I$(INC) +# Folders in which sources and headers are located, respectively +SRC ?= src +INC ?= include + # Specific Doxygen to use if not the default one #DOXYGEN ?= /opt/bin/doxygen @@ -49,7 +54,7 @@ CFLAGS += -I$(INC) # availability, or in '$(HOME)/.local/share/novas' for user-specific # installation. # -#CIO_LOCATOR_FILE ?= /usr/share/novas/cio_ra.bin +#CIO_LOCATOR_FILE ?= $(DESTDIR)/share/novas/cio_ra.bin # Whether to build into the library planet_eph_manager() routines provided in diff --git a/src/version.c b/src/version.c deleted file mode 100644 index 7e55be94..00000000 --- a/src/version.c +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Utility probgram that simply prints the version to the standard output - * - * @author: Attila Kovacs - * @since 1.0.2 - */ - -#include -#include - -#include "novas.h" - -int main(int argc, const char *argv[]) { - if (argc > 1) { - const char *arg = argv[1]; - if (strcmp("major", arg) == 0) printf("%d\n", SUPERNOVAS_MAJOR_VERSION); - else if (strcmp("minor", arg) == 0) printf("%d\n", SUPERNOVAS_MINOR_VERSION); - else if (strcmp("patch", arg) == 0) printf("%d\n", SUPERNOVAS_PATCHLEVEL); - else if (strcmp("release", arg) == 0) printf("%s\n", SUPERNOVAS_RELEASE_STRING); - else return 1; - return 0; - } - - printf("%s\n", SUPERNOVAS_VERSION_STRING); - return 0; -}