-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMakefile
More file actions
279 lines (228 loc) · 6.67 KB
/
Copy pathMakefile
File metadata and controls
279 lines (228 loc) · 6.67 KB
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# Copyright 2007-2025 United States Government as represented by the
# Administrator of The National Aeronautics and Space Administration.
# No copyright is claimed in the United States under Title 17, U.S. Code.
# All Rights Reserved.
ifndef GMSEC_PLATFORM
default check_support build library mw_wrappers tools env_val java_api csharp_api nodejs_api perl_api python3_api ruby_api patch-mac api_docs clean install:
@ echo "Error: GMSEC_PLATFORM is not defined."
@ echo
@ echo "Please refer to the 'INSTALL.txt' file for reference"
@ echo "on how to setup your build environment."
@ echo
@ false
else
GMSEC_API_HOME = .
RELEASE_DIR = ../release
GMSEC_API_DEST := $(RELEASE_DIR)/GMSEC_API
include $(GMSEC_API_HOME)/config/$(GMSEC_PLATFORM)
.PHONY: check_support build library env_val api_docs mw_wrapper clean install tools
default: check_support build library mw_wrappers tools env_val java_api csharp_api nodejs_api perl_api python3_api ruby_api patch-mac
check_support:
@ if [ -d $$SUPPORT ]; then \
echo "Found $$SUPPORT directory..." ; \
fi
mkdir -p $(BINDIR)
build:
ifneq (, $(shell which perl))
CXX="$(CXX)" perl buildscript.pl
else
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# perl not found"
@echo "# Exiting build of the GMSEC API"
@echo "#"
@echo "###########################################################"
endif
library:
$(MAKE) -C framework
java_api:
ifdef JDK_HOME
$(MAKE) -C java
else
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# JDK_HOME is not defined"
@echo "# Skipping build of Java binding for GMSEC API 5.x"
@echo "#"
@echo "###########################################################"
endif
csharp_api:
ifdef SWIG_HOME
ifneq (, $(shell which mcs))
$(MAKE) -C csharp/gmsec5
else
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# mcs (from Mono Development package) not found"
@echo "# Skipping build of C# binding for GMSEC API 5.x"
@echo "#"
@echo "###########################################################"
endif
else
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# SWIG_HOME is not defined"
@echo "# Skipping build of C# binding for GMSEC API 5.x"
@echo "#"
@echo "###########################################################"
endif
nodejs_api:
ifdef SWIG_HOME
ifneq (, $(shell which node))
$(MAKE) -C nodejs/gmsec5
else
@echo
@echo
@echo "#################################################################"
@echo "#"
@echo "# node not found"
@echo "# Skipping build of NodeJS/Javascript binding for GMSEC API 5.x"
@echo "#"
@echo "#################################################################"
endif
else
@echo
@echo
@echo "#################################################################"
@echo "#"
@echo "# SWIG_HOME is not defined"
@echo "# Skipping build of NodeJS/Javascript binding for GMSEC API 5.x"
@echo "#"
@echo "#################################################################"
endif
perl_api:
ifdef SWIG_HOME
ifdef PERL5_LIB
ifdef PERL5_INC
$(MAKE) -C perl/gmsec5
else
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# PERL5_INC is not defined, or Perl tools not available"
@echo "# Skipping build of Perl binding for GMSEC API 5.x"
@echo "#"
@echo "###########################################################"
endif
else
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# PERL5_LIB is not defined, or Perl tools not available"
@echo "# Skipping build of Perl binding for GMSEC API 5.x"
@echo "#"
@echo "###########################################################"
endif
else
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# SWIG_HOME is not defined"
@echo "# Skipping build of Perl binding for GMSEC API 5.x"
@echo "#"
@echo "###########################################################"
endif
python3_api:
ifdef SWIG_HOME
ifdef PYTHON3_HOME
$(MAKE) -C python3/gmsec5
else
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# PYTHON3_HOME is not defined"
@echo "# Skipping build of Python3 binding for GMSEC API 5.x"
@echo "#"
@echo "###########################################################"
endif
else
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# SWIG_HOME is not defined"
@echo "# Skipping build of Python3 binding for GMSEC API 5.x"
@echo "#"
@echo "###########################################################"
endif
ruby_api:
ifdef SWIG_HOME
@cd ruby/gmsec5 && $(MAKE) -f MakeRuby
else
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# SWIG_HOME is not defined"
@echo "# Skipping build of Ruby binding for GMSEC API 5.x"
@echo "#"
@echo "###########################################################"
endif
env_val:
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# Setting up GMSEC API Validator"
@echo "#"
@echo "###########################################################"
mkdir -p ./bin/validator
cp validator/env_validator.sh ./bin/validator
cp validator/perl_ver.pl ./bin/validator
cp validator/python_ver.py ./bin/validator
cp validator/*.env ./bin/validator
tools:
$(MAKE) -C tools
patch-mac:
@$(GMSEC_API_HOME)/fix-loader-path.sh
api_docs:
$(MAKE) -C doxygen
mw_wrappers:
$(MAKE) -C wrapper
all_examples:
$(MAKE) -C examples
all_tests:
$(MAKE) -C tests
clean: clean-gcov
ifneq (, $(shell which perl))
CXX="$(CXX)" perl buildscript.pl $@
endif
$(RM) -r $(BINDIR)/lib
$(RM) -r $(BINDIR)/validator
@ for dir in framework examples wrapper java csharp/gmsec5 nodejs/gmsec5 perl/gmsec5 python3/gmsec5 doxygen tests tools; do \
$(MAKE) -C $$dir $@ ; \
done
@ cd ruby/gmsec5 && $(MAKE) -f MakeRuby $@
$(RM) $(BINDIR)/*
$(RM) c.ver os.ver java.ver
clean-gcov:
@ for dir in framework examples tests wrapper; do \
find $$dir \( -name '*.gcno' -o -name '*.gcda' \) -exec rm -rf {} \; ; \
done
install:
@ echo
@ echo
@ echo "###########################################################"
@ echo "#"
@ echo "# Installing GMSEC API"
@ echo "#"
@ echo "###########################################################"
mkdir -p $(RELEASE_DIR)
$(RM) -r $(GMSEC_API_DEST) && mkdir $(GMSEC_API_DEST)
cp -a README.txt CHANGE-LOG.txt bin config templates examples framework/include $(GMSEC_API_DEST)
$(RM) -r $(GMSEC_API_DEST)/include/gmsec5/internal
install_docs:
$(MAKE) install -C doxygen
endif