-
Notifications
You must be signed in to change notification settings - Fork 2
/
GNUmakefile.custom_controller
218 lines (182 loc) · 7.2 KB
/
GNUmakefile.custom_controller
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
# -*- Makefile -*-
#----------------------------------------------------------------------------
# GNU Makefile
#
# @file GNUmakefile.custom_controller
#
# $Id: gnu.mpd 97944 2014-10-29 20:57:47Z shuston $
#
# This file was automatically generated by MPC. Any changes made directly to
# this file will be lost the next time it is generated.
#
#----------------------------------------------------------------------------
MAKEFILE = GNUmakefile.custom_controller
DEPENDENCY_FILE = .depend.custom_controller
BIN_UNCHECKED = custom_controller
LIB_PREFIX ?= lib
FILES = \
src/controller.cpp \
src/algorithms/ZigZagCoverage.cpp \
src/algorithms/square_patrol.cpp \
src/platforms/turtlebot_platform.cpp \
src/platforms/turtleGenericFrame.cpp \
src/platforms/MoveBasePlatform.cpp \
src/platforms/threads/TopicListener.cpp \
src/platforms/threads/TopicPublisher.cpp \
src/platforms/threads/TopicListener2.cpp
VPATH = .:src/algorithms:src/platforms/threads:src/platforms:src
#----------------------------------------------------------------------------
# Include macros and targets
#----------------------------------------------------------------------------
LDLIBS = -lACE -lMADARA -lGAMS -lroscpp_serialization -ltf -lboost_thread -lboost_system -lrostime -lactionlib -lrosconsole -lroscpp
PRJ_TYPE = rtp
COLLAPSE_SLASHES = $(if $(findstring //,$(1)),$(call COLLAPSE_SLASHES,$(subst //,/,$(1))),$(1))
INSBIN ?= $(call COLLAPSE_SLASHES,bin)
ifeq ($(INSBIN),.)
ifeq ($(CURDIR),)
ifeq ($(PWD),)
PWD=$(shell pwd)
endif
else
PWD=$(CURDIR)
endif
INSBIN = $(PWD)
endif
OUTPUT_DIRECTORY = $(if $(ARCH),$(if $(INSBIN),$(INSBIN)/$(ARCH)),$(INSBIN))
include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
GNUACE_PROJECT_VERSION ?= $(ACE_VERSION)
# To build multiple targets in the same directory on AIX, it works
# best to have a template directory per project.
# The compiler/linker isn't too smart about instantiating templates...
ifdef TEMPINCDIR
TEMPINCDIR := $(TEMPINCDIR)/custom_controller
all: $(TEMPINCDIR)
endif
ifneq ($(OUTPUT_DIRECTORY),)
.PHONY: create_output_directory.local
all: create_output_directory.local
create_output_directory.local:
-@$(MKDIR) "$(OUTPUT_DIRECTORY)" $(ACE_NUL_STDERR)
endif
# turn off libcheck if doing a dry run
ifeq ($(findstring n, $(MAKEFLAGS)),n)
LIBCHECK = 1
else
# turn off libcheck if keep going was passed too
ifeq ($(findstring k, $(MAKEFLAGS)),k)
LIBCHECK = 1
else
ifeq ($(LIBCHECK_PREFIX),)
# If the user hasn't specified a place to look for installed libraries, let's set
# a reasonable default
LIBCHECK_PREFIX = /usr
endif
LIBCHECK ?= $(filter-out $(foreach lib,ACE MADARA GAMS roscpp_serialization tf boost_thread boost_system rostime actionlib rosconsole roscpp,$(findstring $(lib),$(foreach libpath,. $(if $(ARCH),./$(ARCH)) $(GAMS_ROOT)/lib $(if $(ARCH),$(GAMS_ROOT)/lib/$(ARCH)) $(ROS_ROOT)/../../lib $(if $(ARCH),$(ROS_ROOT)/../../lib/$(ARCH)) $(VREP_ROOT) $(if $(ARCH),$(VREP_ROOT)/$(ARCH)) $(MADARA_ROOT)/lib $(if $(ARCH),$(MADARA_ROOT)/lib/$(ARCH)) $(ACE_ROOT)/lib $(if $(ARCH),$(ACE_ROOT)/lib/$(ARCH)) $(LIBCHECK_PREFIX)/lib $(LIBCHECK_PREFIX)/lib64 $(LIBCHECK_EXTRA_PATHS) $(INSLIB),$(wildcard $(libpath)/$(LIB_PREFIX)$(lib).* $(libpath)/$(lib).lib)))),ACE MADARA GAMS roscpp_serialization tf boost_thread boost_system rostime actionlib rosconsole roscpp)
ifeq ($(LIBCHECK),)
LIBCHECK = 1
endif
endif
endif
ifeq ($(LIBCHECK), 1)
BIN = $(BIN_UNCHECKED)$(EXEEXT)
ifdef ARCH
ARCH_BIN = $(ARCH)/$(BIN)
endif #ARCH
else
all: lib_warning
endif
# If it contains ../ at all use notdir.
OBJS = $(foreach var, $(addsuffix .$(OBJEXT), $(basename $(FILES)) $(RESOURCES)), $(if $(findstring ../,$(var)),$(notdir $(var)),$(var)))
SRC = $(FILES)
include $(ACE_ROOT)/include/makeinclude/macros.GNU
include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
ifneq ($(INSBIN),)
ifneq ($(INSBIN),.)
INSTALL = $(VBIN:%=$(INSBIN)/%)
CLEANUP_INSTALL += $(CLEANUP_BIN:%=$(INSBIN)/$(if $(ARCH),$(ARCH)/)%$(VAR)$(EXEEXT))
endif
endif
include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
ifeq ($(VXWORKSLINK),1)
include $(TGT_DIR)/h/make/rules.$(PRJ_TYPE)
endif
ifeq ($(VXWORKSLINK),1)
LDLIBPATH = -L. -L$(GAMS_ROOT)/lib -L$(ROS_ROOT)/../../lib -L$(VREP_ROOT) -L$(MADARA_ROOT)/lib -L$(ACE_ROOT)/lib
else
LDFLAGS += -L. $(if $(ARCH),-L./$(ARCH)) -L$(GAMS_ROOT)/lib $(if $(ARCH),-L$(GAMS_ROOT)/lib/$(ARCH)) -L$(ROS_ROOT)/../../lib $(if $(ARCH),-L$(ROS_ROOT)/../../lib/$(ARCH)) -L$(VREP_ROOT) $(if $(ARCH),-L$(VREP_ROOT)/$(ARCH)) -L$(MADARA_ROOT)/lib $(if $(ARCH),-L$(MADARA_ROOT)/lib/$(ARCH)) -L$(ACE_ROOT)/lib $(if $(ARCH),-L$(ACE_ROOT)/lib/$(ARCH))
endif
CPPFLAGS += -I$(GAMS_ROOT)/src -I$(ROS_ROOT)/../../include -I$(MADARA_ROOT)/include -I$(ACE_ROOT)
CPPFLAGS += -D_USE_MATH_DEFINES
CPPFLAGS += -std=c++11 -g -Og -Wextra -pedantic
ifeq ($(static_libs),1)
CPPFLAGS += -DACE_AS_STATIC_LIBS
ifeq ($(link_groups), 1)
LDLIBS := -Wl,--start-group $(LDLIBS) -Wl,--end-group
endif
endif
#----------------------------------------------------------------------------
# Local targets
#----------------------------------------------------------------------------
CPPFLAGS += -w
CPPFLAGS += -D_GAMS_ROS_
lib_warning:
@echo custom_controller will not be built due to the following missing library: $(LIBCHECK) >&2
## Some OS's have /bin/test others only have /usr/bin/test
ifeq ($(wildcard /bin/test), /bin/test)
TEST_EXE = /bin/test
else
ifeq ($(wildcard /usr/bin/test), /usr/bin/test)
TEST_EXE = /usr/bin/test
endif
endif
SPACE = $(should_be_unset) $(should_be_unset)
ifneq ($(GENERATED_DIRTY),)
.PRECIOUS: $(GENERATED_DIRTY)
## If the generated files are anything but source files, we need to
## ensure that those files are generated before we attempt to build anything
## else.
ifeq ($(OBJS_DEPEND_ON_GENERATED),1)
$(VDIR)$(ACE_PCH_FILE) $(addprefix $(VDIR), $(OBJS)): $(GENERATED_DIRTY)
$(VSHDIR)$(ACE_PCH_FILE) $(VSHOBJS): $(GENERATED_DIRTY)
endif
endif
ifneq ($(VXWORKSLINK),1)
ifeq ($(static_libs_only), 1)
ifeq ($(use_dep_libs), 1)
DEPLIBS = $(foreach lib, ACE MADARA GAMS roscpp_serialization tf boost_thread boost_system rostime actionlib rosconsole roscpp , $(foreach libpath, . $(GAMS_ROOT)/lib $(ROS_ROOT)/../../lib $(VREP_ROOT) $(MADARA_ROOT)/lib $(ACE_ROOT)/lib, $(wildcard $(libpath)/$(LIB_PREFIX)$(lib).$(LIBEXT))))
endif
endif
$(VBIN): $(addprefix $(VDIR), $(OBJS)) $(DEPLIBS)
ifneq (,$(LINK.cc.override))
$(LINK.cc.override)
else
$(LINK.cc) $(LDFLAGS) $(CC_OUTPUT_FLAG) $@ $(filter-out %.a,$^) $(VLDLIBS) $(POSTLINK)
endif
endif
realclean: clean
ifneq ($(GENERATED_DIRTY),)
-$(RM) -r $(GENERATED_DIRTY)
endif
__prebuild__:
@-:
.PHONY: install
install: all
INSTALL_LIB ?= lib
ifneq ($(INSTALL_PREFIX),)
ifneq ($(install_rpath),0)
UNAME := $(shell uname)
ifeq ($(UNAME), HP-UX)
LDFLAGS += -Wl,+s,+b,$(INSTALL_PREFIX)/$(INSTALL_LIB) $(LD_RPATH_FLAGS)
else
LDFLAGS += -Wl,-R$(INSTALL_PREFIX)/$(INSTALL_LIB) $(LD_RPATH_FLAGS)
endif
endif
endif
DEPFILES=$(patsubst %.cpp,%.d,$(filter %.cpp,$(FILES)))
%.d : %.cpp
$(CXX) $(CPPFLAGS) -MM -MG -MT .obj/$(@:.d=.o) -o $@ $<
cleandep :
rm -f $(DEPFILES)
clean : cleandep
-include $(DEPFILES)