forked from plexil-group/plexil
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
245 lines (183 loc) · 7.49 KB
/
Makefile
File metadata and controls
245 lines (183 loc) · 7.49 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
# Top level Makefile for Plexil
# Copyright (c) 2006-2021, Universities Space Research Association (USRA).
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the Universities Space Research Association nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY USRA ``AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL USRA BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SHELL = /bin/sh
# Check environment
# N.B.: dir leaves a trailing /
MAKEFILE_DIR := $(realpath $(join $(dir $(firstword $(MAKEFILE_LIST))),.))
ifeq ($(PLEXIL_HOME),)
PLEXIL_HOME := $(MAKEFILE_DIR)
$(info Setting PLEXIL_HOME to $(PLEXIL_HOME))
else
ifneq ($(PLEXIL_HOME),$(MAKEFILE_DIR))
$(error Environment variable PLEXIL_HOME is in error. It must be set to $(MAKEFILE_DIR) before proceeding)
endif
endif
export PLEXIL_HOME
include $(PLEXIL_HOME)/makeinclude/standard-defs.make
#
# Locations for prerequisites
#
# Have to do it this way because 'command' is a shell builtin; the
# straightforward '$(shell command -v autoreconf)' fails with the message
# 'sh: command: not found'.
AUTORECONF := $(shell echo 'command -v autoreconf' | /bin/sh)
# Primary target
plexil-default: tools
# The whole shooting match
everything: universalExec TestExec IpcAdapter UdpAdapter plexil-compiler plexilscript checker plexilsim pv robosim sample checkpoint
# Just the tools without the examples
tools: universalExec TestExec IpcAdapter UdpAdapter plexil-compiler plexilscript checker plexilsim pv
# Core facilities
essentials: universalExec TestExec IpcAdapter UdpAdapter plexil-compiler plexilscript checker plexilsim
#
# Standalone targets
#
checker: checker/global-decl-checker.jar
checker/global-decl-checker.jar:
(cd checker && ant jar)
pv: viewers/pv/luv.jar
viewers/pv/luv.jar:
(cd viewers/pv && ant jar)
plexil-compiler: jars/PlexilCompiler.jar
jars/PlexilCompiler.jar:
(cd compilers/plexil && ant install)
plexilscript: jars/plexilscript.jar
jars/plexilscript.jar:
(cd compilers/plexilscript && ant install)
.PHONY: checker/global-decl-checker.jar viewers/pv/luv.jar
.PHONY: jars/PlexilCompiler.jar jars/plexilscript.jar
#
# Targets which depend on the Automake targets below
#
checkpoint: utils
$(MAKE) -C examples/checkpoint
robosim: ipc utils
$(MAKE) -C examples/robosim
sample: universalExec
$(MAKE) -C examples/sample-app
#
# Targets under the Automake build system
#
# Dependencies may be too messy to capture here
#
app-framework: lib/libPlexilAppFramework.$(SUFSHARE)
exec-core: lib/libPlexilExec.$(SUFSHARE)
ipc: lib/libipc.a bin/central
IpcUtils: lib/libIpcUtils.$(SUFSHARE)
IpcAdapter: lib/libIpcAdapter.$(SUFSHARE)
Launcher: lib/libLauncher.$(SUFSHARE)
LuvListener: lib/libLuvListener.$(SUFSHARE)
PlanDebugListener: lib/libPlanDebugListener.$(SUFSHARE)
plexilsim: bin/simulator
pugixml: lib/libpugixml.$(SUFSHARE)
sockets: lib/libPlexilSockets.$(SUFSHARE)
TestExec: bin/TestExec
UdpAdapter: lib/libUdpAdapter.$(SUFSHARE)
universalExec: bin/universalExec
utils: lib/libPlexilUtils.$(SUFSHARE)
value: lib/libPlexilValue.$(SUFSHARE)
bin/central lib/libIpc.a : most
bin/simulator : most
bin/TestExec : most
bin/universalExec : most
lib/libipc.a : most
lib/libIpcAdapter.$(SUFSHARE) : most
lib/libIpcUtils.$(SUFSHARE) : most
lib/libLuvListener.$(SUFSHARE) : most
lib/libLauncher.$(SUFSHARE) : most
lib/libPlanDebugListener.$(SUFSHARE) : most
lib/libPlexilAppFramework.$(SUFSHARE) : most
lib/libPlexilExec.$(SUFSHARE) : most
lib/libPlexilExpr.$(SUFSHARE) : most
lib/libPlexilIntfc.$(SUFSHARE) : most
lib/libPlexilSockets.$(SUFSHARE) : most
lib/libPlexilUtils.$(SUFSHARE) : most
lib/libPlexilValue.$(SUFSHARE) : most
lib/libpugixml.$(SUFSHARE) : most
lib/libUdpAdapter.$(SUFSHARE) : most
most: most-build most-install
most-build: src/Makefile
$(MAKE) -C src
most-install: most-build src/Makefile
$(MAKE) -C src install
# At bootstrap time, values of these variables come from makeinclude/standard-defs.make
src/Makefile: src/configure
cd ./src && ./configure --prefix="$(PREFIX)" --exec-prefix="$(EXEC_PREFIX)" \
--bindir="$(BINDIR)" --includedir="$(INCLUDEDIR)" --libdir="$(LIBDIR)" \
CC="$(CC)" CXX="$(CXX)" \
CPPFLAGS="$(INITIAL_CPPFLAGS)" CFLAGS="$(INITIAL_CFLAGS)" CXXFLAGS="$(INITIAL_CXXFLAGS)" \
--disable-static --enable-ipc --enable-sas --enable-test-exec --enable-udp
#
# Bootstrapping autobuild files
#
# Must recreate configure if any of the Makefile.am files changes
MAKEFILE_AMS = $(wildcard src/**/Makefile.am)
# Create m4 directory - some older versions of autotools won't do it for us
src/configure: src/configure.ac $(MAKEFILE_AMS)
cd ./src && mkdir -p m4 && $(AUTORECONF) -f -i
#
# End Automake targets
#
clean:: clean-examples
-@$(MAKE) -C src $@ > /dev/null 2>&1
-@$(MAKE) -C compilers/plexil $@ > /dev/null 2>&1
@(cd compilers/plexilscript && ant $@)
@(cd checker && ant $@)
@(cd jars && $(RM) plexilscript.jar)
@(cd viewers/pv && ant $@)
@$(RM) lib/lib* bin/* include/*
@$(RM) examples/checkpoint/saves/*.xml
@ echo Done.
clean-examples:
# -@$(MAKE) -C examples $@
# Clean up after autotools
distclean squeaky-clean: | clean
@(cd src && $(RM) */Makefile */Makefile.in)
@(cd src/apps && $(RM) */Makefile */Makefile.in)
@(cd src/interfaces && $(RM) */Makefile */Makefile.in)
@(cd src/third-party/ipc && $(RM) Makefile Makefile.in)
@(cd src/third-party/pugixml/src && $(RM) Makefile Makefile.in)
@(cd src && $(RM) Makefile Makefile.in aclocal.m4 \
compile configure configure~ configure.env config.guess config.guess~ \
config.log config.status config.sub config.sub~ \
cppcheck.sh depcomp INSTALL install-sh libtool ltmain.sh missing \
plexil-config.h plexil-config.h.in plexil-config.h.in~ stamp-h1)
@(cd src && $(RM) -rf m4 autom4te.cache)
# *** TODO: release target(s) ***
# Convenience targets
# Create an Emacs tags file capturing most relevant file types
# Note: The indirection forces recreation of TAGS file in
# MacOS, which is case-insensitive.
#
tags: alltags
ctags:
@ find . \( -name "*.cc" -or -name "*.cpp" -or -name "*.hh" -or -name "*.hpp" -or -name Makefile \) | etags -
jtags:
@ find . \( -name "*.java" \) | etags -
alltags:
@ find . \( -name "*.cc" -or -name "*.cpp" -or -name "*.hh" -or -name "*.hpp" -or -name "*.java" -or -name "*.xml" -or -name Makefile \) | etags -
.PHONY: app-framework exec-core ipc IpcAdapter IpcUtils
.PHONY: alltags clean ctags jtags most most-build most-install plexil-default squeaky-clean tags