forked from northern-bites/nao-man
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
126 lines (103 loc) · 2.96 KB
/
Makefile
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
CUR_DIR = $(shell pwd)
BUILD_DIR = build
INSTALL_DIR = install
INSTALL_SCRIPT = ./upload.sh
CMAKE_DIR = cmake.man
CMAKE_DEPEND = $(BUILD_DIR)/Makefile
CMAKE_SRCS = \
CMakeLists.txt \
buildconfig.cmake \
manconfig.in
CMAKE_SRCS := $(addprefix $(CMAKE_DIR),$(CMAKE_SRCS))
CONFIG_FILE = manconfig.h
CROSS_FILE = $(BUILD_DIR)/cross
STRAIGHT_FILE = $(BUILD_DIR)/straight
WEBOTS_FILE = $(BUILD_DIR)/webots
PYC_FILES = $(shell find . -name "*.pyc")
CROSS_TOOLCHAIN = $(abspath $(CURDIR)/cmake/geode.cmake)
CMAKE_DEFS = -DOE_CROSS_BUILD=OFF -DSTRAIGHT=ON
CMAKE_CROSS_DEFS = -DCMAKE_TOOLCHAIN_FILE=$(CROSS_TOOLCHAIN) -DOE_CROSS_BUILD=ON
CMAKE_WEBOTS_DEFS = -DOE_CROSS_BUILD=OFF -DMAN_IS_REMOTE_=ON -DWEBOTS_BACKEND=ON -DCOLOR_TABLE=tables/webots.mtb
CCMAKE_CROSS_OPT = -DCMAKE_SHARED_LINKER_FLAGS:STRING="" -DCMAKE_MODULE_LINKER_FLAGS:STRING=""
CD=cd
CMAKE=cmake
CCMAKE=ccmake
MKDIR=mkdir
TOUCH=touch
MAKE_OPTIONS=--no-print-directory
.PHONY: default_target all straight cross cclean clean install noconfig
.PHONY: clean_install
default_target: all
all: $(CMAKE_DEPEND)
@#echo $(TRUNK_REVISION)
@$(MAKE) $(MAKE_OPTIONS) -C $(BUILD_DIR)
straight: $(STRAIGHT_FILE)
@set -e; \
$(CD) $(BUILD_DIR); \
$(CCMAKE) .
$(CMAKE_DEPEND):
@if [ -f $(WEBOTS_FILE) ]; then \
$(MAKE) $(MAKE_OPTIONS) webots; \
elif [ -f $(STRAIGHT_FILE) ]; then \
$(MAKE) $(MAKE_OPTIONS) straight; \
else \
$(MAKE) $(MAKE_OPTIONS) cross; \
fi
$(STRAIGHT_FILE):
@if [ -e $(CROSS_FILE) ] || [ -f $(WEBOTS_FILE) ]; then \
$(MAKE) $(MAKE_OPTIONS) clean; \
fi
@set -e; \
$(MKDIR) -p $(BUILD_DIR); \
$(TOUCH) $(STRAIGHT_FILE); \
$(CD) $(BUILD_DIR); \
$(CMAKE) $(CMAKE_DEFS) $(CURDIR)/$(CMAKE_DIR)
cross: $(CROSS_FILE)
@set -e ; \
$(CD) $(BUILD_DIR); \
$(CCMAKE) $(CCMAKE_CROSS_OPT) .
$(CROSS_FILE):
@if [ -e $(STRAIGHT_FILE) ] || [ -e $(WEBOTS_FILE) ]; then \
$(MAKE) clean; \
fi
@set -e; \
$(MKDIR) -p $(BUILD_DIR); \
$(TOUCH) $(CROSS_FILE); \
$(CD) $(BUILD_DIR); \
$(CMAKE) $(CMAKE_CROSS_DEFS) $(CURDIR)/$(CMAKE_DIR)
webots: $(WEBOTS_FILE)
@set -e;
$(CD) $(BUILD_DIR); \
$(CCMAKE) .
$(WEBOTS_FILE):
@if [ -e $(STRAIGHT_FILE) ] || [ -e $(CROSS_FILE) ]; then \
$(MAKE) clean; \
fi
@set -e; \
$(MKDIR) -p $(BUILD_DIR); \
$(TOUCH) $(WEBOTS_FILE); \
$(CD) $(BUILD_DIR); \
$(CMAKE) $(CMAKE_WEBOTS_DEFS) $(CURDIR)/$(CMAKE_DIR)
install: $(CMAKE_DEPEND)
@$(MAKE) $(MAKE_OPTIONS) -C $(BUILD_DIR) install
$(INSTALL_SCRIPT)
clean_install:
$(RM) -r $(INSTALL_DIR)/*
cclean: $(CMAKE_DEPEND)
@$(MAKE) $(MAKE_OPTIONS) -C $(BUILD_DIR) clean
clean:
$(RM) -r $(BUILD_DIR) $(CONFIG_FILE) $(INSTALL_SCRIPT)
@$(MAKE) -C corpus clean
@$(MAKE) -C motion clean
@$(MAKE) -C noggin clean
@$(MAKE) -C vision clean
@$(MAKE) -C comm clean
$(RM) -r install/* $(PYC_FILES)
check:
@if [ -e $(CROSS_FILE) ]; then \
echo "Making for CROSS"; \
elif [ -e $(STRAIGHT_FILE) ]; then \
echo "Making for STRAIGHT"; \
elif [ -e $(WEBOTS_FILE) ]; then \
echo "Making for WEBOTS"; \
fi