Parcourir la source

Linux makefile

Thomas Buck il y a 12 ans
Parent
révision
a317f92ecf
3 fichiers modifiés avec 27 ajouts et 3 suppressions
  1. 9
    0
      CubeControl/libSerial/makefile
  2. 16
    1
      CubeControl/makefile
  3. 2
    2
      README.md

+ 9
- 0
CubeControl/libSerial/makefile Voir le fichier

@@ -27,13 +27,22 @@ HelperUtility.class: ../HelperUtility.java
27 27
 ifdef SystemRoot
28 28
 libSerial: Serial.dll
29 29
 else
30
+UNAME := $(shell uname -s)
31
+ifeq ($(UNAME),Darwin)
30 32
 libSerial: libSerial.jnilib
33
+else
34
+libSerial: libSerial.so
35
+endif
31 36
 endif
32 37
 
33 38
 libSerial.jnilib: serialHelper.c unixSerial.c serialInterface.h
34 39
 	$(CC) -x c -I$(HEADERPATH) -c serialHelper.c -o serialHelper.o
35 40
 	$(CC) -dynamiclib -o libSerial.jnilib serialHelper.o
36 41
 
42
+libSerial.so: serialHelper.c unixSerial.c serialInterface.h
43
+	$(CC) -x c -I$(HEADERPATH) -c serialHelper.c -o serialHelper.o
44
+	$(CC) -dynamiclib -o libSerial.so serialHelper.o
45
+
37 46
 Serial.dll: serialHelper.c winSerial.c serialInterface.h
38 47
 	$(CC) -x c -I$(HEADERPATH) -c serialHelper.c -o serialHelper.o -D winHelper
39 48
 	$(CC) -shared -o Serial.dll serialHelper.o

+ 16
- 1
CubeControl/makefile Voir le fichier

@@ -8,10 +8,17 @@ RM = del
8 8
 INJAR += Serial.dll
9 9
 PLATFORM = Win
10 10
 else
11
-HEADERPATH = /System/Library/Frameworks/JavaVM.framework/Headers
12 11
 RM = rm -f
12
+UNAME := $(shell uname -s)
13
+ifeq ($(UNAME),Darwin)
13 14
 INJAR += libSerial.jnilib
14 15
 PLATFORM = Mac
16
+HEADERPATH = /System/Library/Frameworks/JavaVM.framework/Headers
17
+else
18
+INJAR += libSerial.so
19
+PLATFORM = Linux
20
+HEADERPATH = /usr/java-1.6/include
21
+endif
15 22
 endif
16 23
 
17 24
 # All java files to be compiled
@@ -39,7 +46,11 @@ doc/index.html: $(JAVAFILES)
39 46
 ifdef SystemRoot
40 47
 libSerial: Serial.dll
41 48
 else
49
+ifeq ($(UNAME),Darwin)
42 50
 libSerial: libSerial.jnilib
51
+else
52
+libSerial: libSerial.so
53
+endif
43 54
 endif
44 55
 
45 56
 Serial.dll: libSerial/serialHelper.c libSerial/winSerial.c
@@ -50,6 +61,10 @@ libSerial.jnilib: libSerial/serialHelper.c libSerial/unixSerial.c
50 61
 	make -C libSerial
51 62
 	mv libSerial/libSerial.jnilib libSerial.jnilib
52 63
 
64
+libSerial.so: libSerial/serialHelper.c libSerial/unixSerial.c
65
+	make -C libSerial
66
+	mv libSerial/libSerial.so libSerial.so
67
+
53 68
 # Delete intermediate files
54 69
 clean:
55 70
 	make -C libSerial clean

+ 2
- 2
README.md Voir le fichier

@@ -18,7 +18,7 @@ It's source is in the "Cube Control" directory.
18 18
 
19 19
 ## Build instructions
20 20
 
21
-There is a makefile in every source code directory. Running make inside CubeControl should produce a file called CubeControlMac.jar or CubeControlWin.jar. If not, you should take a look at the makefile. Hard-Coded include directorys are probably different than on your system... You obviously need a working JDK and a C Compiler Environment (we use gcc).
22
-CubeControls makefile will autodetect a Windows Host and compile a Windows Version accordingly. If it is not on Windows, it will compile a Mac Version. Unix is currently not supported by the makefile, but should work if compiled manually.
21
+There is a makefile in every source code directory. Running make inside CubeControl should produce a file called CubeControlMac.jar, CubeControlLinux.jar or CubeControlWin.jar. If not, you should take a look at the makefile. Hard-Coded include directorys are probably different than on your system... You obviously need a working JDK and a C Compiler Environment (we use gcc).
22
+CubeControls makefile will autodetect a Windows Host and compile a Windows Version accordingly. If it is not on Windows, it will check uname and compile a Mac Version if Darwin is reported as OS name. A Linux Version will be compiled if no Darwin OS was detected.
23 23
 
24 24
 The same goes for AudioFirmware and CubeFirmware. You need avr-gcc to compile these projects.

Chargement…
Annuler
Enregistrer