-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
105 lines (83 loc) · 2.85 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
include Mk/default.mk
#######################################################################################################################
# Explanation
#######################################################################################################################
# Of course you can have a for-loop in a Makefile, however, such a loop is a SHELL
# loop. This means, that an error will not be automatically propagate back to this
# Makefile and it will continue building the other folders. It can be hard to see
# errors in that way. Manually catching the error does not respect "make -k".
# Moreover, with a for-loop the make cannot be executed in parallel.
#added for possible autoupload function, just uncoment IP for automatic upload,
#note that rcp from net-kit is needed
#IP=192.168.1.65
#IP=192.168.52.65
#IP=192.168.1.69
#IP=192.168.52.69
#IP=192.168.1.72
#IP=192.168.52.72
#IP=192.168.52.154
#IP=192.168.52.128
#IP=192.168.52.203
#IP=192.168.52.204
#IP=192.168.52.205
CFG=jockeys/actionselection/conf/mapping.cfg
CFG+=jockeys/actionselection/conf/mapping_docking.cfg
CFG+=jockeys/actionselection/conf/killallJ.sh
CFG+=jockeys/actionselection/conf/autoStartJ.sh
#CFG+=jockeys/actionselection/conf/mapping_docking.cfg
CAMCFG=jockeys/cameradetection/cameraCalibration
# These are the default jockeys
JOCKEYS=
#JOCKEYS+=jockeys/docking
#JOCKEYS+=jockeys/movetoposition
#JOCKEYS+=jockeys/mapping
#JOCKEYS+=jockeys/ubiposition
#JOCKEYS+=jockeys/actionselection
#JOCKEYS+=jockeys/cameradetection
#JOCKEYS+=jockeys/motorcalibration
#JOCKEYS+=jockeys/zigbeemsg
#JOCKEYS+=jockeys/remotecontrol
#JOCKEYS+=jockeys/organismcontrol
#JOCKEYS+=managers/remotecontrolPC
# Use the file enable_jockeys to disable/enable jockeys, do not commit that one to the SVN
-include enable_jockeys.mk
CLEANJOCKEYS=$(addsuffix .clean,$(JOCKEYS))
JOCKEYNAMESONLY=$(subst jockeys/,,$(JOCKEYS))
jockeys: $(JOCKEYS) result
$(JOCKEYS):
$(MAKE) -C $@
all: check-env jockeys upload
result:
@echo "Compiled the jockeys:"
@echo "$(JOCKEYS)"
$(CLEANJOCKEYS): %.clean:
$(MAKE) -C $* clean
clean-jockeys: $(CLEANJOCKEYS)
clean: check-env clean-jockeys
#test:
# @echo "Certain tests, feel free to remove if they are unneccessary"
# @file $(IROBOT_PATH)/bin/robotest
# #$(warning Warning: irobot binary is 64-bit, seems not to be meant for robot)
upload:
ifdef IP
@echo "upload"
@echo "uploading $(CAMCFG)"
rcp -rp $(CAMCFG) root@$(IP):/flash/
@for i in $(CFG) ;\
do \
echo "uploading $$i..."; \
rcp $$i root@$(IP):/flash/ ; \
done
@for i in $(JOCKEYNAMESONLY) ;\
do \
echo "uploading jockeys/$$i..."; \
echo "rcp jockeys/$$i/bin/$$i root@$(IP):/flash/$$i" ; \
rcp jockeys/$$i/bin/$$i root@$(IP):/flash/$$i ; \
done
endif
check-env:
ifndef EQUID_PATH
export EQUID_PATH:=$(CURDIR)
endif
# List all the phony targets
.PHONY: jockeys $(JOCKEYS) all clean-jockeys $(CLEANJOCKEYS) clean result upload