Merge branch 'master' of ssh://plrg.eecs.uci.edu/home/git/iot2
[iot2.git] / benchmarks / drivers / Java / Makefile
1 BASE = ../../..
2
3 include $(BASE)/common.mk
4
5 BOOFDIR := ../libs/boofcv_libs
6 BOOFJARS := $(BOOFDIR)/BoofCV-feature-0.21.jar:$(BOOFDIR)/BoofCV-io-0.21.jar:$(BOOFDIR)/BoofCV-visualize-0.21.jar:$(BOOFDIR)/BoofCV-ip-0.21.jar
7 JLAYERDIR := ../libs/jlayer_libs
8 JLAYERJARS := $(JLAYERDIR)/jl1.0.1.jar
9 JFLAGS = -d $(BIN_DIR) -cp $(BIN_DIR):$(PHONEJARS):$(BOOFJARS):$(JLAYERJARS):$(CHECKERJARS)
10 JARFLAGS = cf
11 INTFACE_DIR = iotcode/interfaces
12
13 # checker option
14 #
15 CHECKER_OPT = -processor iotchecker.IoTJavaChecker -AprintErrorStack
16
17 ASTUBS = -Astubs=../../../checker/astubs/ 
18
19 all: light camera labroom greenlawn sprinkler moisture weathergateway audioroom gpsgateway ihome homeroom alarm motion multipurpose waterleak
20 check-all: check-light check-camera check-labroom check-greenlawn check-sprinkler check-moisture check-weathergateway check-audioroom check-gpsgateway check-ihome check-homeroom check-alarm check-motion check-multipurpose check-waterleak
21
22 # Compile - without checker
23 #
24 PHONY += light
25 light:
26         $(JAVAC) $(JFLAGS) LifxLightBulb/*.java
27         cp LifxLightBulb/LifxLightBulb.config $(BIN_DIR)/iotcode/LifxLightBulb
28         cd $(BIN_DIR)/iotcode/LifxLightBulb; $(JAR) $(JARFLAGS) LifxLightBulb.jar ../../iotcode/LifxLightBulb/*.class ../../iotcode/interfaces/LightBulb*.class
29
30 PHONY += camera
31 camera:
32         $(JAVAC) $(JFLAGS) AmcrestCamera/*.java
33         cp AmcrestCamera/AmcrestCamera.config $(BIN_DIR)/iotcode/AmcrestCamera
34         cd $(BIN_DIR)/iotcode/AmcrestCamera; $(JAR) $(JARFLAGS) AmcrestCamera.jar ../../iotcode/AmcrestCamera/*.class ../../iotcode/interfaces/Camera*.class ../../iotcode/interfaces/Resolution*.class
35
36 PHONY += labroom
37 labroom:
38         $(JAVAC) $(JFLAGS) LabRoom/*.java
39         cp LabRoom/LabRoom.config $(BIN_DIR)/iotcode/LabRoom
40         cd $(BIN_DIR)/iotcode/LabRoom; $(JAR) $(JARFLAGS) LabRoom.jar ../../iotcode/LabRoom/*.class ../../iotcode/interfaces/Room*.class
41
42 PHONY += greenlawn
43 greenlawn:
44         $(JAVAC) $(JFLAGS) GreenLawn/*.java
45         cp GreenLawn/GreenLawn.config $(BIN_DIR)/iotcode/GreenLawn
46         cd $(BIN_DIR)/iotcode/GreenLawn; $(JAR) $(JARFLAGS) GreenLawn.jar ../../iotcode/GreenLawn/*.class ../../iotcode/interfaces/Lawn*.class
47
48 PHONY += sprinkler
49 sprinkler:
50         $(JAVAC) $(JFLAGS) EspSprinkler/*.java
51         cp EspSprinkler/EspSprinkler.config $(BIN_DIR)/iotcode/EspSprinkler
52         cd $(BIN_DIR)/iotcode/EspSprinkler; $(JAR) $(JARFLAGS) EspSprinkler.jar ../../iotcode/EspSprinkler/*.class ../../iotcode/interfaces/Sprinkler*.class ../../iotcode/interfaces/ZoneState*.class
53
54 PHONY += moisture
55 moisture:
56         $(JAVAC) $(JFLAGS) SpruceSensor/*.java
57         cp SpruceSensor/SpruceSensor.config $(BIN_DIR)/iotcode/SpruceSensor
58         #cd $(BIN_DIR)/iotcode/SpruceSensor; $(JAR) $(JARFLAGS) SpruceSensor.jar ../../iotcode/SpruceSensor/*.class ../../iotcode/interfaces/MoistureSensor*.class ../../iotcode/interfaces/Camera*.class ../../IrrigationController/MotionDetection*.class
59         cd $(BIN_DIR)/iotcode/SpruceSensor; $(JAR) $(JARFLAGS) SpruceSensor.jar ../../iotcode/SpruceSensor/*.class ../../iotcode/interfaces/MoistureSensor*.class ../../iotcode/interfaces/Camera*.class
60
61 PHONY += weathergateway
62 weathergateway:
63         $(JAVAC) $(JFLAGS) WeatherPhoneGateway/*.java
64         cp WeatherPhoneGateway/WeatherPhoneGateway.config $(BIN_DIR)/iotcode/WeatherPhoneGateway
65         cd $(BIN_DIR)/iotcode/WeatherPhoneGateway; $(JAR) $(JARFLAGS) WeatherPhoneGateway.jar ../../iotcode/WeatherPhoneGateway/*.class ../../iotcode/interfaces/WeatherGateway*.class
66
67 PHONY += audioroom
68 audioroom:
69         $(JAVAC) $(JFLAGS) AudioRoom/*.java
70         cp AudioRoom/AudioRoom.config $(BIN_DIR)/iotcode/AudioRoom
71         cd $(BIN_DIR)/iotcode/AudioRoom; $(JAR) $(JARFLAGS) AudioRoom.jar ../../iotcode/AudioRoom/*.class ../../iotcode/interfaces/Room*.class
72
73 PHONY += gpsgateway
74 gpsgateway:
75         $(JAVAC) $(JFLAGS) GPSPhoneGateway/*.java
76         cp GPSPhoneGateway/GPSPhoneGateway.config $(BIN_DIR)/iotcode/GPSPhoneGateway
77         cd $(BIN_DIR)/iotcode/GPSPhoneGateway; $(JAR) $(JARFLAGS) GPSPhoneGateway.jar ../../iotcode/GPSPhoneGateway/*.class ../../iotcode/interfaces/GPSGateway*.class
78
79 PHONY += ihome
80 ihome:
81         $(JAVAC) $(JFLAGS) IHome/*.java
82         cp IHome/IHome.config $(BIN_DIR)/iotcode/IHome
83         cd $(BIN_DIR)/iotcode/IHome; $(JAR) $(JARFLAGS) IHome.jar ../../iotcode/IHome/*.class ../../iotcode/interfaces/Speaker*.class
84
85 PHONY += homeroom
86 homeroom:
87         $(JAVAC) $(JFLAGS) HomeRoom/*.java
88         cp HomeRoom/HomeRoom.config $(BIN_DIR)/iotcode/HomeRoom
89         cd $(BIN_DIR)/iotcode/HomeRoom; $(JAR) $(JARFLAGS) HomeRoom.jar ../../iotcode/HomeRoom/*.class ../../iotcode/interfaces/Room*.class
90
91 PHONY += alarm
92 alarm:
93         $(JAVAC) $(JFLAGS) EspAlarm/*.java
94         cp EspAlarm/EspAlarm.config $(BIN_DIR)/iotcode/EspAlarm
95         cd $(BIN_DIR)/iotcode/EspAlarm; $(JAR) $(JARFLAGS) EspAlarm.jar ../../iotcode/EspAlarm/*.class ../../iotcode/interfaces/Alarm*.class ../../iotcode/interfaces/ZoneState*.class
96
97 PHONY += motion
98 motion:
99         $(JAVAC) $(JFLAGS) MotionSensor/*.java
100         cp MotionSensor/MotionSensor.config $(BIN_DIR)/iotcode/MotionSensor
101         #cd $(BIN_DIR)/iotcode/MotionSensor; $(JAR) $(JARFLAGS) MotionSensor.jar ../../iotcode/MotionSensor/*.class ../../iotcode/interfaces/SmartthingsSensor*.class ../../iotcode/interfaces/Camera*.class ../../IrrigationController/MotionDetection*.class
102         cd $(BIN_DIR)/iotcode/MotionSensor; $(JAR) $(JARFLAGS) MotionSensor.jar ../../iotcode/MotionSensor/*.class ../../iotcode/interfaces/SmartthingsSensor*.class ../../iotcode/interfaces/Camera*.class
103
104 PHONY += multipurpose
105 multipurpose:
106         $(JAVAC) $(JFLAGS) MultipurposeSensor/*.java
107         cp MultipurposeSensor/MultipurposeSensor.config $(BIN_DIR)/iotcode/MultipurposeSensor
108         #cd $(BIN_DIR)/iotcode/MultipurposeSensor; $(JAR) $(JARFLAGS) MultipurposeSensor.jar ../../iotcode/MultipurposeSensor/*.class ../../iotcode/interfaces/SmartthingsSensor*.class ../../iotcode/interfaces/Camera*.class ../../IrrigationController/MotionDetection*.class
109         cd $(BIN_DIR)/iotcode/MultipurposeSensor; $(JAR) $(JARFLAGS) MultipurposeSensor.jar ../../iotcode/MultipurposeSensor/*.class ../../iotcode/interfaces/SmartthingsSensor*.class ../../iotcode/interfaces/Camera*.class
110
111 PHONY += waterleak
112 waterleak:
113         $(JAVAC) $(JFLAGS) WaterLeakSensor/*.java
114         cp WaterLeakSensor/WaterLeakSensor.config $(BIN_DIR)/iotcode/WaterLeakSensor
115         #cd $(BIN_DIR)/iotcode/WaterLeakSensor; $(JAR) $(JARFLAGS) WaterLeakSensor.jar ../../iotcode/WaterLeakSensor/*.class ../../iotcode/interfaces/SmartthingsSensor*.class ../../iotcode/interfaces/Camera*.class ../../IrrigationController/MotionDetection*.class
116         cd $(BIN_DIR)/iotcode/WaterLeakSensor; $(JAR) $(JARFLAGS) WaterLeakSensor.jar ../../iotcode/WaterLeakSensor/*.class ../../iotcode/interfaces/SmartthingsSensor*.class ../../iotcode/interfaces/Camera*.class
117
118 # Compile - with checker
119 #
120 PHONY += check-light
121 check-light:
122         $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) LifxLightBulb/*.java
123         cp LifxLightBulb/LifxLightBulb.config $(BIN_DIR)/iotcode/LifxLightBulb
124         cd $(BIN_DIR)/iotcode/LifxLightBulb; $(JAR) $(JARFLAGS) LifxLightBulb.jar ../../iotcode/LifxLightBulb/*.class ../../iotcode/interfaces/LightBulb*.class
125
126 PHONY += check-camera
127 check-camera:
128         $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) AmcrestCamera/*.java
129         cp AmcrestCamera/AmcrestCamera.config $(BIN_DIR)/iotcode/AmcrestCamera
130         cd $(BIN_DIR)/iotcode/AmcrestCamera; $(JAR) $(JARFLAGS) AmcrestCamera.jar ../../iotcode/AmcrestCamera/*.class ../../iotcode/interfaces/Camera*.class ../../iotcode/interfaces/Resolution*.class
131
132 PHONY += check-labroom
133 check-labroom:
134         $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) LabRoom/*.java
135         cp LabRoom/LabRoom.config $(BIN_DIR)/iotcode/LabRoom
136         cd $(BIN_DIR)/iotcode/LabRoom; $(JAR) $(JARFLAGS) LabRoom.jar ../../iotcode/LabRoom/*.class ../../iotcode/interfaces/Room*.class
137
138 PHONY += check-greenlawn
139 check-greenlawn:
140         $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) GreenLawn/*.java
141         cp GreenLawn/GreenLawn.config $(BIN_DIR)/iotcode/GreenLawn
142         cd $(BIN_DIR)/iotcode/GreenLawn; $(JAR) $(JARFLAGS) GreenLawn.jar ../../iotcode/GreenLawn/*.class ../../iotcode/interfaces/Lawn*.class
143
144 PHONY += check-sprinkler
145 check-sprinkler:
146         $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) EspSprinkler/*.java
147         cp EspSprinkler/EspSprinkler.config $(BIN_DIR)/iotcode/EspSprinkler
148         cd $(BIN_DIR)/iotcode/EspSprinkler; $(JAR) $(JARFLAGS) EspSprinkler.jar ../../iotcode/EspSprinkler/*.class ../../iotcode/interfaces/Sprinkler*.class ../../iotcode/interfaces/ZoneState*.class
149
150 PHONY += check-moisture
151 check-moisture:
152         $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) SpruceSensor/*.java
153         cp SpruceSensor/SpruceSensor.config $(BIN_DIR)/iotcode/SpruceSensor
154         #cd $(BIN_DIR)/iotcode/SpruceSensor; $(JAR) $(JARFLAGS) SpruceSensor.jar ../../iotcode/SpruceSensor/*.class ../../iotcode/interfaces/MoistureSensor*.class ../../iotcode/interfaces/Camera*.class ../../IrrigationController/MotionDetection*.class
155         cd $(BIN_DIR)/iotcode/SpruceSensor; $(JAR) $(JARFLAGS) SpruceSensor.jar ../../iotcode/SpruceSensor/*.class ../../iotcode/interfaces/MoistureSensor*.class ../../iotcode/interfaces/Camera*.class
156
157 PHONY += check-weathergateway
158 check-weathergateway:
159         $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) WeatherPhoneGateway/*.java
160         cp WeatherPhoneGateway/WeatherPhoneGateway.config $(BIN_DIR)/iotcode/WeatherPhoneGateway
161         cd $(BIN_DIR)/iotcode/WeatherPhoneGateway; $(JAR) $(JARFLAGS) WeatherPhoneGateway.jar ../../iotcode/WeatherPhoneGateway/*.class ../../iotcode/interfaces/WeatherGateway*.class
162
163 PHONY += check-audioroom
164 check-audioroom:
165         $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) AudioRoom/*.java
166         cp AudioRoom/AudioRoom.config $(BIN_DIR)/iotcode/AudioRoom
167         cd $(BIN_DIR)/iotcode/AudioRoom; $(JAR) $(JARFLAGS) AudioRoom.jar ../../iotcode/AudioRoom/*.class ../../iotcode/interfaces/Room*.class
168
169 PHONY += check-gpsgateway
170 check-gpsgateway:
171         $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) GPSPhoneGateway/*.java
172         cp GPSPhoneGateway/GPSPhoneGateway.config $(BIN_DIR)/iotcode/GPSPhoneGateway
173         cd $(BIN_DIR)/iotcode/GPSPhoneGateway; $(JAR) $(JARFLAGS) GPSPhoneGateway.jar ../../iotcode/GPSPhoneGateway/*.class ../../iotcode/interfaces/GPSGateway*.class
174
175 PHONY += check-ihome
176 check-ihome:
177         $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) IHome/*.java
178         cp IHome/IHome.config $(BIN_DIR)/iotcode/IHome
179         cd $(BIN_DIR)/iotcode/IHome; $(JAR) $(JARFLAGS) IHome.jar ../../iotcode/IHome/*.class ../../iotcode/interfaces/Speaker*.class
180
181 PHONY += check-homeroom
182 check-homeroom:
183         $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) HomeRoom/*.java
184         cp HomeRoom/HomeRoom.config $(BIN_DIR)/iotcode/HomeRoom
185         cd $(BIN_DIR)/iotcode/HomeRoom; $(JAR) $(JARFLAGS) HomeRoom.jar ../../iotcode/HomeRoom/*.class ../../iotcode/interfaces/Room*.class
186
187 PHONY += check-alarm
188 check-alarm:
189         $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) EspAlarm/*.java
190         cp EspAlarm/EspAlarm.config $(BIN_DIR)/iotcode/EspAlarm
191         cd $(BIN_DIR)/iotcode/EspAlarm; $(JAR) $(JARFLAGS) EspAlarm.jar ../../iotcode/EspAlarm/*.class ../../iotcode/interfaces/Alarm*.class ../../iotcode/interfaces/ZoneState*.class
192
193 PHONY += check-motion
194 check-motion:
195         $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) MotionSensor/*.java
196         cp MotionSensor/MotionSensor.config $(BIN_DIR)/iotcode/MotionSensor
197         cd $(BIN_DIR)/iotcode/MotionSensor; $(JAR) $(JARFLAGS) MotionSensor.jar ../../iotcode/MotionSensor/*.class ../../iotcode/interfaces/SmartthingsSensor*.class ../../iotcode/interfaces/Camera*.class ../../IrrigationController/MotionDetection*.class
198
199 PHONY += check-multipurpose
200 check-multipurpose:
201         $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) MultipurposeSensor/*.java
202         cp MultipurposeSensor/MultipurposeSensor.config $(BIN_DIR)/iotcode/MultipurposeSensor
203         cd $(BIN_DIR)/iotcode/MultipurposeSensor; $(JAR) $(JARFLAGS) MultipurposeSensor.jar ../../iotcode/MultipurposeSensor/*.class ../../iotcode/interfaces/SmartthingsSensor*.class ../../iotcode/interfaces/Camera*.class ../../IrrigationController/MotionDetection*.class
204
205 PHONY += check-waterleak
206 check-waterleak:
207         $(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) WaterLeakSensor/*.java
208         cp WaterLeakSensor/WaterLeakSensor.config $(BIN_DIR)/iotcode/WaterLeakSensor
209         cd $(BIN_DIR)/iotcode/WaterLeakSensor; $(JAR) $(JARFLAGS) WaterLeakSensor.jar ../../iotcode/WaterLeakSensor/*.class ../../iotcode/interfaces/SmartthingsSensor*.class ../../iotcode/interfaces/Camera*.class ../../IrrigationController/MotionDetection*.class
210
211 .PHONY: $(PHONY)