This repository was archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (49 loc) · 1.52 KB
/
Makefile
File metadata and controls
63 lines (49 loc) · 1.52 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
#
# Include paths
INCLUDES=-I./
INCLUDES+=-I./bld
INCLUDES+=-I$(OSPL_HOME)/include/dcps/C++/SACPP
INCLUDES+=-I$(OSPL_HOME)/include
INCLUDES+=-I$(OSPL_HOME)/include/sys
# C++ Compiler settings.
CXX=g++
CXXFLAGS=-g -c -m32
CPPFLAGS=$(INCLUDES)
# Linker settings.
LD_SO=$(CXX)
LD_FLAGS=-m32
LD_LIBS=-lstdc++
#OpenSplice idl preprocessor
OSPLICE_COMP=$(OSPL_HOME)/bin/idlpp -S -l cpp -d bld
OSPLICE_LIBS=-lddsdatabase -ldcpsgapi -ldcpssacpp -lddsos
DCPS_SRC_FILES = bld/Chat.cpp bld/ChatDcps.cpp bld/ChatDcps_impl.cpp bld/ChatSplDcps.cpp
DCPS_OBJ_FILES = $(patsubst %.cpp, %.o, $(DCPS_SRC_FILES))
.cpp.o :
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $< -o $@
all : dirs exec/Chatter exec/MessageBoard exec/UserLoad
@echo ">>>> all done"
dirs :
@mkdir -p bld
@mkdir -p exec
$(DCPS_SRC_FILES) : Chat.idl
@echo "Compiling IDL with SPLICE IDL compiler"
@mkdir -p bld
$(OSPLICE_COMP) $(INCLUDES) $<
exec/Chatter : $(DCPS_OBJ_FILES) Chatter.o CheckStatus.o multitopic.o
@echo "Linking Chatter"
@mkdir -p exec
$(LD_SO) $(LD_FLAGS) -L$(OSPL_HOME)/lib -o $@ $^ $(OSPLICE_LIBS) $(LD_LIBS)
exec/MessageBoard : $(DCPS_OBJ_FILES) MessageBoard.o CheckStatus.o multitopic.o
@echo "Linking MessageBoard"
@mkdir -p exec
$(LD_SO) $(LD_FLAGS) -L$(OSPL_HOME)/lib -o $@ $^ $(OSPLICE_LIBS) $(LD_LIBS)
exec/UserLoad : $(DCPS_OBJ_FILES) UserLoad.o CheckStatus.o multitopic.o
@echo "Linking UserLoad"
@mkdir -p exec
$(LD_SO) $(LD_FLAGS) -L$(OSPL_HOME)/lib -o $@ $^ $(OSPLICE_LIBS) $(LD_LIBS)
clean :
@rm -f *.o
@rm -f bld/*
@rm -f exec/*
@rmdir bld
@rmdir exec