Makefile 2.45 KB
Newer Older
1
2
3
4
5
# Makefile for Garcia robot applications
#
# Dan Flickinger
#
# 2004/10/04
Daniel Flickinger's avatar
   
Daniel Flickinger committed
6
# 2004/12/15
7
8
9
10


HOSTPATH=/z/garcia/brainstem

Daniel Flickinger's avatar
Daniel Flickinger committed
11
# Build for Stargate:
12
ARCH=ARM
Timothy Stack's avatar
   
Timothy Stack committed
13
14
15
CC=/usr/local/arm/3.4.1/bin/arm-linux-gcc
CXX=/usr/local/arm/3.4.1/bin/arm-linux-g++
CXXFLAGS = -DaUNIX -s -static
16

Daniel Flickinger's avatar
Daniel Flickinger committed
17
# Build for i386:
18
19
#ARCH=i686
#CC=g++
Daniel Flickinger's avatar
Daniel Flickinger committed
20
21
#CFLAGS=-DaUNIX -g

22

Timothy Stack's avatar
   
Timothy Stack committed
23
CXXFLAGS += -I$(HOSTPATH)/aCommon \
24
25
26
27
28
29
30
31
32
33
	 -I$(HOSTPATH)/aUnix \
	 -I$(HOSTPATH)/aIO/aCommon \
	 -I$(HOSTPATH)/aIO/aUnix \
	 -I$(HOSTPATH)/aUI/aCommon \
	 -I$(HOSTPATH)/aUI/aUnix \
	 -I$(HOSTPATH)/aStem/aCommon \
	 -I$(HOSTPATH)/aStem/aUnix \
	 -I$(HOSTPATH)/aGarcia/aGarcia \
	 -I$(HOSTPATH)/aGarcia/aUnix \
	 -I$(HOSTPATH)/aGarcia/aCommon \
Timothy Stack's avatar
   
Timothy Stack committed
34
	 -I../mtp \
35
36
	 -I./

Timothy Stack's avatar
   
Timothy Stack committed
37
LIBRARIES =\
38
39
40
41
42
	-laGarcia \
	-laStem \
	-laIO \
	-laUI \
	-lpthread \
Timothy Stack's avatar
   
Timothy Stack committed
43
	-lm
44

Timothy Stack's avatar
   
Timothy Stack committed
45
46
47
VPATH=$(HOSTPATH)/aCommon:$(HOSTPATH)/aUnix:dgrobot:../mtp

LDFLAGS += -L$(HOSTPATH)/aRelease/aUnix/$(ARCH)/
48
49

OBJECTSREQ=grobot gcallbacks gbehaviors simplepath
Timothy Stack's avatar
   
Timothy Stack committed
50
OBJECTS=grobot.o gcallbacks.o gbehaviors.o simplepath.o mtp.o
51

Daniel Flickinger's avatar
Daniel Flickinger committed
52
all: commotion pathmotion circle gorobot gorobotc
53
54
55


commotion: $(OBJECTSREQ)
Daniel Flickinger's avatar
   
Daniel Flickinger committed
56
	$(CC) -o commotion $(OBJECTS) $(CXXFLAGS) $(LDFLAGS) commotion.cc $(LIBRARIES)
57
58

pathmotion: $(OBJECTSREQ)
Daniel Flickinger's avatar
   
Daniel Flickinger committed
59
	$(CC) -o pathmotion $(OBJECTS) $(CXXFLAGS) $(LDFLAGS) pathmotion.cc $(LIBRARIES)
Timothy Stack's avatar
   
Timothy Stack committed
60

61
circle: $(OBJECTSREQ)
Daniel Flickinger's avatar
   
Daniel Flickinger committed
62
	$(CC) -o circle $(OBJECTS) $(CXXFLAGS) $(LDFLAGS) circle.cc $(LIBRARIES)
Timothy Stack's avatar
   
Timothy Stack committed
63
64
65
66
67
68
69

gorobot: $(OBJECTS)
	$(CXX) -o gorobot $(OBJECTS) $(CXXFLAGS) $(LDFLAGS) gorobot.cc $(LIBRARIES)

mtp_send: mtp.o
	$(CC) -o mtp_send $(CXXFLAGS) $(LDFLAGS) ../mtp/mtp_send.c $<

Daniel Flickinger's avatar
Daniel Flickinger committed
70
gorobotc: $(OBJECTSREQ)
Daniel Flickinger's avatar
   
Daniel Flickinger committed
71
	$(CC) -o gorobotc $(OBJECTS) $(CXXFLAGS) $(LDFLAGS) gorobotc.cc $(LIBRARIES)
Daniel Flickinger's avatar
Daniel Flickinger committed
72

73
74
75
76
77
78
79
# %.o : %.c
# 	$(CC) $(CFLAGS) -c -o $@ $< $(INCLUDES)
# 
# %.oo : %.cpp
# 	$(CC) $(CFLAGS) -c -o $@ $< $(INCLUDES)

grobot:
Daniel Flickinger's avatar
   
Daniel Flickinger committed
80
	$(CC) -c $(CXXFLAGS) dgrobot/grobot.cc
Timothy Stack's avatar
   
Timothy Stack committed
81

82
gcallbacks:
Daniel Flickinger's avatar
   
Daniel Flickinger committed
83
	$(CC) -c $(CXXFLAGS) dgrobot/gcallbacks.cc
84
85

gbehaviors:
Daniel Flickinger's avatar
   
Daniel Flickinger committed
86
	$(CC) -c $(CXXFLAGS) dgrobot/gbehaviors.cc
87
88

simplepath:
Daniel Flickinger's avatar
   
Daniel Flickinger committed
89
	$(CC) -c $(CXXFLAGS) dgrobot/simplepath.cc
90

Timothy Stack's avatar
   
Timothy Stack committed
91
92
93
94
95
96
97
98
99
100
101
102
103
ROBOTS = \
	garcia1.emulab.net \
	garcia2.emulab.net \
	garcia3.emulab.net \
	garcia4.emulab.net \
	garcia5.emulab.net \
	garcia6.emulab.net

install: gorobot mtp_send
	@for host in ${ROBOTS}; do \
		echo -n "Checking $$host: "; \
		if ping -W 1 -c 1 $$host > /dev/null 2>&1; then \
			echo "up"; \
Daniel Flickinger's avatar
   
Daniel Flickinger committed
104
			scp -o "Protocol 2" $^ root@$$host:apps/; \
Timothy Stack's avatar
   
Timothy Stack committed
105
106
107
108
		else \
			echo "down"; \
		fi \
	done
109
110
111
112
113
114
115
116
117
118
119

clean : 
	rm -f *.o
	rm -f primotion
	rm -f square
	rm -f commotion
	rm -f shell
	rm -f pathmotion
	rm -f circle
	rm -f batt
	rm -f gorobot
Daniel Flickinger's avatar
Daniel Flickinger committed
120
	rm -f gorobotc