forked from nasa/GMSEC_API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
319 lines (262 loc) · 7.79 KB
/
Copy pathMakefile
File metadata and controls
319 lines (262 loc) · 7.79 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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
# Copyright 2007-2021 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
%:
@ 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_HOME = .
RELEASE_DIR = ../release
GMSEC_API_DEST := $(RELEASE_DIR)/GMSEC_API
include $(GMSEC_HOME)/config/$(GMSEC_PLATFORM)
.PHONY: check_support build library csharp_api csharp_api_4x perl_api perl_api_3x perl_api_4x python3_api python3_api_4x ruby_api env_val api_docs mw_wrapper clean install tools
default: check_support build library mw_wrappers csharp_api java_api perl_api python3_api ruby_api env_val tools 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
csharp_api:
# Note: C# binding for API 4.x is currently only supported on Linux and macOS distros.
ifeq ($(findstring linux,$(GMSEC_PLATFORM)), linux)
$(MAKE) csharp_api_4x
endif
ifeq ($(findstring macosx,$(GMSEC_PLATFORM)), macosx)
$(MAKE) csharp_api_4x
endif
csharp_api_4x:
ifdef SWIG_HOME
ifneq (, $(shell which mcs))
$(MAKE) -C csharp/gmsec4
else
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# mcs (from Mono Development package) not found"
@echo "# Skipping build of C# binding of the GMSEC API 4.x"
@echo "#"
@echo "###########################################################"
endif
else
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# SWIG_HOME is not defined"
@echo "# Skipping build of C# binding of the GMSEC API 4.x"
@echo "#"
@echo "###########################################################"
endif
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 of the GMSEC API"
@echo "#"
@echo "###########################################################"
endif
perl_api: perl_api_3x
# Note: Perl binding for API 4.x is currently only supported on Linux and macOS distros.
ifeq ($(findstring linux,$(GMSEC_PLATFORM)), linux)
$(MAKE) perl_api_4x
endif
ifeq ($(findstring macosx,$(GMSEC_PLATFORM)), macosx)
$(MAKE) perl_api_4x
endif
perl_api_3x:
ifdef PERL5_LIB
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# Building Perl 3.x binding of the GMSEC API"
@echo "#"
@echo "###########################################################"
cd ./perl/gmsec; \
PERL_CC=$(PERL_CC) perl -Iextra Makefile.PL PREFIX=../../bin ; \
$(MAKE) ; $(MAKE) install;
else
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# PERL5_LIB is not defined."
@echo "# Skipping build of Perl 3.x binding of the GMSEC API"
@echo "#"
@echo "###########################################################"
endif
perl_api_4x:
ifdef SWIG_HOME
ifdef PERL5_LIB
ifdef PERL5_INC
$(MAKE) -C perl/gmsec4
else
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# PERL5_INC is not defined, or Perl tools not available"
@echo "# Skipping build of Perl binding of the GMSEC API 4.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 of the GMSEC API 4.x"
@echo "#"
@echo "###########################################################"
endif
else
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# SWIG_HOME is not defined"
@echo "# Skipping build of Perl binding of the GMSEC API 4.x"
@echo "#"
@echo "###########################################################"
endif
python3_api:
# Note: Python3 binding for API 4.x is currently only supported on Linux and macOS distros.
ifeq ($(findstring linux,$(GMSEC_PLATFORM)), linux)
$(MAKE) python3_api_4x
endif
ifeq ($(findstring macosx,$(GMSEC_PLATFORM)), macosx)
$(MAKE) python3_api_4x
endif
python3_api_4x:
ifdef SWIG_HOME
ifdef PYTHON3_HOME
$(MAKE) -C python3/gmsec4
else
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# PYTHON3_HOME is not defined"
@echo "# Skipping build of Python3 binding of the GMSEC API 4.x"
@echo "#"
@echo "###########################################################"
endif
else
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# SWIG_HOME is not defined"
@echo "# Skipping build of Python3 binding of the GMSEC API 4.x"
@echo "#"
@echo "###########################################################"
endif
ruby_api:
# Note: Ruby binding for API 4.x is currently only supported on Linux and macOS distros.
ifeq ($(findstring linux,$(GMSEC_PLATFORM)), linux)
$(MAKE) ruby_api_4x
endif
ifeq ($(findstring macosx,$(GMSEC_PLATFORM)), macosx)
$(MAKE) ruby_api_4x
endif
ruby_api_4x:
ifdef SWIG_HOME
@cd ruby/gmsec4 && $(MAKE) -f MakeRuby
else
@echo
@echo
@echo "###########################################################"
@echo "#"
@echo "# SWIG_HOME is not defined"
@echo "# Skipping build of C# binding of the GMSEC API 4.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/*.env ./bin/validator
tools:
$(MAKE) -C tools
patch-mac:
@$(GMSEC_HOME)/fix-loader-path.sh
api_docs:
$(MAKE) -C doxygen
mw_wrappers:
$(MAKE) -C wrapper
all_examples:
$(MAKE) -C examples INTERNAL=1
clean: clean-gcov
ifneq (, $(shell which perl))
CXX="$(CXX)" perl buildscript.pl $@
endif
$(RM) -r $(BINDIR)/amqp
$(RM) -r $(BINDIR)/lib
$(RM) -r $(BINDIR)/validator
@ for dir in framework examples wrapper java doxygen tools; do \
$(MAKE) -C $$dir $@ ; \
done
- @ [ -f perl/gmsec/Makefile ] && $(MAKE) -C perl/gmsec veryclean
- @ $(MAKE) -C csharp/gmsec4 clean
- @ $(MAKE) -C perl/gmsec4 clean
- @ $(MAKE) -C python3/gmsec4 clean
- @ $(MAKE) -C ruby/gmsec4 clean
$(RM) -r $(BINDIR)/*
$(RM) c.ver os.ver java.ver
clean-gcov:
@ for dir in framework examples wrapper; do \
echo $(RM) -r $$dir/*.gcno $$dir/*.gcda ; \
done
install:
@ echo
@ echo
@ echo "###########################################################"
@ echo "#"
@ echo "# Installing the GMSEC API"
@ echo "#"
@ echo "###########################################################"
mkdir -p $(RELEASE_DIR)
$(RM) -r $(GMSEC_API_DEST) && mkdir $(GMSEC_API_DEST)
find . -type d -name '\?' | xargs -n 20 rm -rf # remove oracle_jre_usage info (if any)
cp -a README.txt bin config templates examples framework/include $(GMSEC_API_DEST)
$(RM) -r $(GMSEC_API_DEST)/include/gmsec/internal
$(RM) -r $(GMSEC_API_DEST)/include/gmsec4/internal
install_docs:
$(MAKE) install -C doxygen
endif