All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Makefile 2.64 KB
Newer Older
Timothy Stack's avatar
Timothy Stack committed
1 2 3 4 5 6
#
# EMULAB-COPYRIGHT
# Copyright (c) 2005 University of Utah and the Flux Group.
# All rights reserved.
#

7 8 9 10 11
# Makefile for Garcia robot applications
#
# Dan Flickinger
#
# 2004/10/04
Daniel Flickinger's avatar
 
Daniel Flickinger committed
12
# 2004/12/15
13 14 15 16


HOSTPATH=/z/garcia/brainstem

Daniel Flickinger's avatar
Daniel Flickinger committed
17
# Build for Stargate:
18
ARCH=ARM
Timothy Stack's avatar
 
Timothy Stack committed
19 20 21
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
22

Daniel Flickinger's avatar
Daniel Flickinger committed
23
# Build for i386:
24 25
#ARCH=i686
#CC=g++
Daniel Flickinger's avatar
Daniel Flickinger committed
26 27
#CXX=g++
#CXXFLAGS=-DaUNIX -g
Daniel Flickinger's avatar
Daniel Flickinger committed
28

29

Timothy Stack's avatar
 
Timothy Stack committed
30
CXXFLAGS += -I$(HOSTPATH)/aCommon \
31 32 33 34 35 36 37 38 39 40
	 -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
41
	 -I../mtp \
42 43
	 -I./

Timothy Stack's avatar
 
Timothy Stack committed
44
LIBRARIES =\
45 46 47 48 49
	-laGarcia \
	-laStem \
	-laIO \
	-laUI \
	-lpthread \
Timothy Stack's avatar
 
Timothy Stack committed
50
	-lm
51

Timothy Stack's avatar
 
Timothy Stack committed
52 53 54
VPATH=$(HOSTPATH)/aCommon:$(HOSTPATH)/aUnix:dgrobot:../mtp

LDFLAGS += -L$(HOSTPATH)/aRelease/aUnix/$(ARCH)/
55 56

OBJECTSREQ=grobot gcallbacks gbehaviors simplepath
Timothy Stack's avatar
 
Timothy Stack committed
57
OBJECTS=grobot.o gcallbacks.o gbehaviors.o simplepath.o mtp.o
Daniel Flickinger's avatar
Daniel Flickinger committed
58
OBJECTS_GOROBOTC=grobot.o gcallbacks.o gbehaviors.o simplepath.o
59

Daniel Flickinger's avatar
Daniel Flickinger committed
60
all: commotion pathmotion circle gorobot gorobotc
61 62 63


commotion: $(OBJECTSREQ)
Daniel Flickinger's avatar
 
Daniel Flickinger committed
64
	$(CC) -o commotion $(OBJECTS) $(CXXFLAGS) $(LDFLAGS) commotion.cc $(LIBRARIES)
65 66

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

69
circle: $(OBJECTSREQ)
Daniel Flickinger's avatar
 
Daniel Flickinger committed
70
	$(CC) -o circle $(OBJECTS) $(CXXFLAGS) $(LDFLAGS) circle.cc $(LIBRARIES)
Timothy Stack's avatar
 
Timothy Stack committed
71 72 73 74 75 76 77

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
78
gorobotc: $(OBJECTSREQ)
Daniel Flickinger's avatar
Daniel Flickinger committed
79
	$(CC) -o gorobotc $(OBJECTS_GOROBOTC) $(CXXFLAGS) $(LDFLAGS) gorobotc.cc $(LIBRARIES)
Daniel Flickinger's avatar
Daniel Flickinger committed
80

81 82 83 84 85 86 87
# %.o : %.c
# 	$(CC) $(CFLAGS) -c -o $@ $< $(INCLUDES)
# 
# %.oo : %.cpp
# 	$(CC) $(CFLAGS) -c -o $@ $< $(INCLUDES)

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

90
gcallbacks:
Daniel Flickinger's avatar
 
Daniel Flickinger committed
91
	$(CC) -c $(CXXFLAGS) dgrobot/gcallbacks.cc
92 93

gbehaviors:
Daniel Flickinger's avatar
 
Daniel Flickinger committed
94
	$(CC) -c $(CXXFLAGS) dgrobot/gbehaviors.cc
95 96

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

Timothy Stack's avatar
 
Timothy Stack committed
99 100 101 102 103 104 105 106 107 108 109 110 111
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
112
			scp -o "Protocol 2" $^ root@$$host:apps/; \
Timothy Stack's avatar
 
Timothy Stack committed
113 114 115 116
		else \
			echo "down"; \
		fi \
	done
117 118 119 120 121 122 123 124 125 126 127

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
128
	rm -f gorobotc