-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.mk
202 lines (154 loc) · 6.4 KB
/
config.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# ===========================================================================
# Generic configuration options for building the SuperNOVAS libraries (both
# static and shared).
#
# You can include this snipplet in your Makefile also.
# ============================================================================
# Folders in which sources and headers are located, respectively
SRC ?= src
INC ?= include
# Folders for compiled objects, libraries, and binaries, respectively
OBJ ?= obj
LIB ?= lib
BIN ?= bin
# Compiler: use gcc by default
CC ?= gcc
# Add include directory
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
# Extra warnings (not supported on all compilers)
#CFLAGS += -Wextra
# Specific Doxygen to use if not the default one
#DOXYGEN ?= /opt/bin/doxygen
# For maximum compatibility with NOVAS C 3.1, uncomment the line below
#COMPAT ?= 1
# To make SuperNOVAS thread-safe, we use thread-local storage modifier
# keywords. These were not standardized prior to C11. So while we automatically
# recognize C11 or GCC >= 3.3 to use the correct thread-local modifier keyword,
# for other compilers (e.g. Intel C, LLVM) you may need to specify it
# explicitly here by passing the keyword via the THREAD_LOCAL definition
#
# E.g.
#THREAD_LOCAL ?= __thread
#or
#THREAD_LOCAL ?= __declspec(thread)
# You can set the default CIO locator file to use depending on where you
# installed it. By default, the library will assume
# '/usr/share/novas/cio_ra.bin', or else 'cio_ra.bin' if the COMPAT flag is
# set to a nonzero value (above). Some other good locations for this file may
# be in '/usr/local/share/novas', or '/opt/share/novas' for system-wide
# availability, or in '$(HOME)/.local/share/novas' for user-specific
# installation.
#
#CIO_LOCATOR_FILE ?= $(DESTDIR)/share/novas/cio_ra.bin
# Whether to build into the library planet_eph_manager() routines provided in
# solsys1.c. Because the default readeph implementation (readeph0.c) does not
# provide useful functionality, we do not include solsys1.c in the build
# by default.
#BUILTIN_SOLSYS1 ?= 1
# Compile library with a default readeph() implementation for solsys1.c, which
# will be used only if the application does not define another implementation
# via calls to the to set_ephem_reader() function.
DEFAULT_READEPH ?= $(SRC)/readeph0.c
# Whether to build into the library planet_jplint() routines provided in
# solsys2.c. Note, that if you choose to build in the functionality of
# solsys2.c you will need to provide a jplint_() implementation and its
# dependencies such as pleph_() as well when linking your application.
# Therefore, we do not include solsys2.c by default...
#BUILTIN_SOLSYS2 ?= 1
# Whether to build into the library earth_sun_calc() routines provided in
# solsys3.c
BUILTIN_SOLSYS3 ?= 1
# Whether to build into the library planet_ephem_reader() routines provided in
# solsys3.c
BUILTIN_SOLSYS_EPHEM ?= 1
# Compile library with a default solarsystem() implementation. If you want to
# use your library with your own solarsystem() implementation, you should
# not set this option. In that case you must always provide a solarsystem()
# implementation when linking your application against this library.
DEFAULT_SOLSYS ?= 3
# Whether or not to build solsys-calceph libraries. You need the calceph
# development libraries (libcalceph.so and/or libcaclceph.a) installed in
# LD_LIBRARY_PATH, and calceph.h in /usr/include or some other accessible
# location (you may also set an appropriate -I<path> option to CPPFLAGS
# prior to calling make).
CALCEPH_SUPPORT ?= 0
# Whether or not to build solsys-cspice libraries. You need the CSPICE
# development libraries (libcspice.so and/or libcspice.a) installed in
# LD_LIBRARY_PATH, and CSPICE header files in /usr/include/cspice or some
# other accessible location (you may also set an appropriate -I<path>
# option to CPPFLAGS prior to calling make).
CSPICE_SUPPORT ?= 0
# cppcheck options for 'check' target. You can add additional options by
# setting the CHECKEXTRA variable (e.g. in shell) prior to invoking 'make'.
CHECKOPTS ?= --enable=performance,warning,portability,style --language=c \
--error-exitcode=1 --std=c99 $(CHECKEXTRA)
# Exhaustive checking for newer cppcheck...
#CHECKOPTS += --check-level=exhaustive
# ============================================================================
# END of user config section.
#
# Below are some generated constants based on the one that were set above
# ============================================================================
# If the COMPAT variable is set to one, then force set compatibility mode
ifeq ($(COMPAT),1)
CPPFLAGS += -DCOMPAT=1
endif
# If the CIO_LOCATOR_FILE variable is defined, the use its definition
ifdef CIO_LOCATOR_FILE
CPPFLAGS += -DDEFAULT_CIO_LOCATOR_FILE=\"$(CIO_LOCATOR_FILE)\"
else
$(info WARNING! No default CIO_LOCATOR_FILE defined.)
$(info . Will use local 'cio_ra.bin' if present.)
endif
# If the THREAD_LOCAL variable was defined externally, use that definition to
# specify the thread local keyword to use.
ifdef THREAD_LOCAL
CPPFLAGS += -DTHREAD_LOCAL=\"$(THREAD_LOCAL)"
endif
ifeq ($(DEFAULT_SOLSYS), 1)
BUILTIN_SOLSYS1 = 1
CPPFLAGS += -DDEFAULT_SOLSYS=1
endif
ifeq ($(DEFAULT_SOLSYS), 2)
BUILTIN_SOLSYS2 = 1
CPPFLAGS += -DDEFAULT_SOLSYS=2
endif
ifeq ($(DEFAULT_SOLSYS), 3)
BUILTIN_SOLSYS3 = 1
CPPFLAGS += -DDEFAULT_SOLSYS=3
endif
SOURCES = $(SRC)/novas.c $(SRC)/nutation.c $(SRC)/super.c $(SRC)/timescale.c $(SRC)/frames.c $(SRC)/refract.c $(SRC)/naif.c
ifeq ($(BUILTIN_SOLSYS1), 1)
SOURCES += $(SRC)/solsys1.c $(SRC)/eph_manager.c
CPPFLAGS += -DBUILTIN_SOLSYS1=1
endif
ifeq ($(BUILTIN_SOLSYS2), 1)
SOURCES += $(SRC)/solsys2.c
CPPFLAGS += -DBUILTIN_SOLSYS2=1
endif
ifeq ($(BUILTIN_SOLSYS3), 1)
SOURCES += $(SRC)/solsys3.c
CPPFLAGS += -DBUILTIN_SOLSYS3=1
endif
ifeq ($(BUILTIN_SOLSYS_EPHEM), 1)
SOURCES += $(SRC)/solsys-ephem.c
endif
ifdef (DEFAULT_READEPH)
SOURCES += $(DEFAULT_READEPH)
CPPFLAGS += -DDEFAULT_READEPH=1
endif
# Compiler and linker options etc.
ifeq ($(BUILD_MODE),debug)
CFLAGS += -g
endif
# Generate a list of object (obj/*.o) files from the input sources
OBJECTS := $(subst $(SRC),$(OBJ),$(SOURCES))
OBJECTS := $(subst .c,.o,$(OBJECTS))
# Search for files in the designated locations
vpath %.h $(INCLUDE)
vpath %.c $(SRC)
vpath %.o $(OBJ)
vpath %.d dep