Browse Source

Nice makefile

Thomas Buck 12 years ago
parent
commit
e770f33cdd

+ 0
- 1
CubeControl/AFrame.java View File

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

+ 2
- 1
CubeControl/Animation.java View File

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

+ 4
- 4
CubeControl/AnimationUtility.java View File

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

+ 3
- 2
CubeControl/cubeWorker.java View File

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

+ 13
- 14
CubeControl/makefile View File

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

Loading…
Cancel
Save