Browse Source

Nice makefile

Thomas Buck 12 years ago
parent
commit
e770f33cdd

+ 0
- 1
CubeControl/AFrame.java View File

@@ -21,7 +21,6 @@
21 21
  * along with LED-Cube.  If not, see <http://www.gnu.org/licenses/>.
22 22
  */
23 23
 
24
-import java.util.ArrayList;
25 24
 import java.util.Arrays;
26 25
 
27 26
 /**

+ 2
- 1
CubeControl/Animation.java View File

@@ -22,6 +22,7 @@
22 22
  */
23 23
 
24 24
 import java.util.ArrayList;
25
+import java.util.List;
25 26
 
26 27
 /**
27 28
  * A collection of frames that represent an entire animation.
@@ -32,7 +33,7 @@ import java.util.ArrayList;
32 33
  */
33 34
 
34 35
 public class Animation {
35
-  ArrayList<AFrame> frames = new ArrayList<AFrame>();
36
+  List<AFrame> frames = new ArrayList<AFrame>();
36 37
   private int lastFrameIndex = 0;
37 38
   private String name = "Animation";
38 39
 

+ 4
- 4
CubeControl/AnimationUtility.java View File

@@ -26,6 +26,7 @@ import java.io.File;
26 26
 import java.util.Scanner;
27 27
 import java.io.IOException;
28 28
 import java.util.ArrayList;
29
+import java.util.List;
29 30
 
30 31
 /**
31 32
  * A helper class that loads animations from a file or saves them to one.
@@ -44,10 +45,9 @@ public class AnimationUtility {
44 45
    * @return Populated ArrayList
45 46
    * @throws Excpetion When something goes wrong with the Scanner...
46 47
    */
47
-  public static ArrayList<Animation> readFile(String path) throws Exception {
48
+  public static List<Animation> readFile(String path) throws Exception {
48 49
     Scanner sc = new Scanner(new File(path));
49
-  ArrayList<Animation> animations = new ArrayList<Animation>();
50
-
50
+  List<Animation> animations = new ArrayList<Animation>();
51 51
   do {
52 52
   Animation tmp = readAnimation(sc);
53 53
   if (tmp == null) {
@@ -68,7 +68,7 @@ public class AnimationUtility {
68 68
    * @param animations ArrayList with all animations to be saved
69 69
    * @see AnimationUtility#getLastError() getLastError()
70 70
    */
71
-  public static void writeFile(String path, ArrayList<Animation> animations) {
71
+  public static void writeFile(String path, List<Animation> animations) {
72 72
     File f = new File(path);
73 73
     if (f.exists()) {
74 74
       try {

+ 3
- 2
CubeControl/cubeWorker.java View File

@@ -26,6 +26,7 @@
26 26
  * many animations, but has to be only 1Mbit in size (128*1024 Byte).
27 27
  */
28 28
 import java.util.ArrayList;
29
+import java.util.List;
29 30
 import java.util.Collections;
30 31
 import java.util.StringTokenizer;
31 32
 
@@ -50,7 +51,7 @@ public class cubeWorker {
50 51
 // Fields
51 52
 // --------------------
52 53
 
53
-  private ArrayList<Animation> animations = new ArrayList<Animation>();
54
+  private List<Animation> animations = new ArrayList<Animation>();
54 55
   private int framesRemaining = 2016; // (128 * 1024) / 65 = 2016,...
55 56
   private boolean changedState = false;
56 57
 
@@ -71,7 +72,7 @@ public class cubeWorker {
71 72
    * Creates a worker from the given animation list
72 73
    * @param anims List of animations
73 74
    */
74
-  cubeWorker(ArrayList<Animation> anims) {
75
+  cubeWorker(List<Animation> anims) {
75 76
     animations = anims;
76 77
   }
77 78
 

+ 13
- 14
CubeControl/makefile View File

@@ -1,10 +1,12 @@
1 1
 # Name of your C-Compiler
2 2
 CC = gcc
3 3
 # Path to jni.h
4
-HEADERPATH = /System/Library/Frameworks/JavaVM.framework/Headers
5
-
6 4
 ifdef SystemRoot
7 5
 HEADERPATH = C:/Program\ Files/Java/jdk1.6.0_29/include
6
+$(RM) = del
7
+else
8
+HEADERPATH = /System/Library/Frameworks/JavaVM.framework/Headers
9
+$(RM) = rm -f
8 10
 endif
9 11
 
10 12
 # All java files to be compiled
@@ -14,8 +16,9 @@ JAVAFILES = HelperUtility.java AnimationUtility.java Animation.java AFrame.java
14 16
 # Files that go in the jar
15 17
 INJAR = *.class *.png
16 18
 
19
+# --------------------------------------
17 20
 
18
-all: CubeControl.jar libSerial
21
+all: libSerial CubeControl.jar
19 22
 
20 23
 doc: doc/index.html
21 24
 
@@ -28,28 +31,24 @@ serialInterface.h: HelperUtility.class
28 31
 HelperUtility.class: $(JAVAFILES)
29 32
 	javac $(JAVAFILES)
30 33
 
31
-# SystemRoot is only defined in Windows
32
-ifdef SystemRoot
33
-libSerial: Serial.dll
34
-$(RM) = del
35
-else
36
-libSerial: libSerial.jnilib
37
-$(RM) = rm -f
38
-endif
39
-
40 34
 libSerial.jnilib: serialHelper.c helper/unixSerial.c serialInterface.h
41 35
 	$(CC) -x c -I$(HEADERPATH) -c serialHelper.c -o serialHelper.o
42 36
 	$(CC) -dynamiclib -o libSerial.jnilib serialHelper.o
43
-	rm -f serialHelper.o
44 37
 
45 38
 Serial.dll: serialHelper.c helper/winSerial.c serialInterface.h
46 39
 	$(CC) -x c -I$(HEADERPATH) -c serialHelper.c -o serialHelper.o -D winHelper
47 40
 	$(CC) -shared -o Serial.dll serialHelper.o
48
-	del serialHelper.o
49 41
 
50 42
 doc/index.html: $(JAVAFILES)
51 43
 	javadoc -d doc $(JAVAFILES)
52 44
 
45
+# SystemRoot is only defined in Windows
46
+ifdef SystemRoot
47
+libSerial: Serial.dll
48
+else
49
+libSerial: libSerial.jnilib
50
+endif
51
+
53 52
 # Delete intermediate files
54 53
 clean:
55 54
 	$(RM) *.class

Loading…
Cancel
Save