Browse Source

Linux makefile

Thomas Buck 13 years ago
parent
commit
a317f92ecf
3 changed files with 27 additions and 3 deletions
  1. 9
    0
      CubeControl/libSerial/makefile
  2. 16
    1
      CubeControl/makefile
  3. 2
    2
      README.md

+ 9
- 0
CubeControl/libSerial/makefile View File

27
 ifdef SystemRoot
27
 ifdef SystemRoot
28
 libSerial: Serial.dll
28
 libSerial: Serial.dll
29
 else
29
 else
30
+UNAME := $(shell uname -s)
31
+ifeq ($(UNAME),Darwin)
30
 libSerial: libSerial.jnilib
32
 libSerial: libSerial.jnilib
33
+else
34
+libSerial: libSerial.so
35
+endif
31
 endif
36
 endif
32
 
37
 
33
 libSerial.jnilib: serialHelper.c unixSerial.c serialInterface.h
38
 libSerial.jnilib: serialHelper.c unixSerial.c serialInterface.h
34
 	$(CC) -x c -I$(HEADERPATH) -c serialHelper.c -o serialHelper.o
39
 	$(CC) -x c -I$(HEADERPATH) -c serialHelper.c -o serialHelper.o
35
 	$(CC) -dynamiclib -o libSerial.jnilib serialHelper.o
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
 Serial.dll: serialHelper.c winSerial.c serialInterface.h
46
 Serial.dll: serialHelper.c winSerial.c serialInterface.h
38
 	$(CC) -x c -I$(HEADERPATH) -c serialHelper.c -o serialHelper.o -D winHelper
47
 	$(CC) -x c -I$(HEADERPATH) -c serialHelper.c -o serialHelper.o -D winHelper
39
 	$(CC) -shared -o Serial.dll serialHelper.o
48
 	$(CC) -shared -o Serial.dll serialHelper.o

+ 16
- 1
CubeControl/makefile View File

8
 INJAR += Serial.dll
8
 INJAR += Serial.dll
9
 PLATFORM = Win
9
 PLATFORM = Win
10
 else
10
 else
11
-HEADERPATH = /System/Library/Frameworks/JavaVM.framework/Headers
12
 RM = rm -f
11
 RM = rm -f
12
+UNAME := $(shell uname -s)
13
+ifeq ($(UNAME),Darwin)
13
 INJAR += libSerial.jnilib
14
 INJAR += libSerial.jnilib
14
 PLATFORM = Mac
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
 endif
22
 endif
16
 
23
 
17
 # All java files to be compiled
24
 # All java files to be compiled
39
 ifdef SystemRoot
46
 ifdef SystemRoot
40
 libSerial: Serial.dll
47
 libSerial: Serial.dll
41
 else
48
 else
49
+ifeq ($(UNAME),Darwin)
42
 libSerial: libSerial.jnilib
50
 libSerial: libSerial.jnilib
51
+else
52
+libSerial: libSerial.so
53
+endif
43
 endif
54
 endif
44
 
55
 
45
 Serial.dll: libSerial/serialHelper.c libSerial/winSerial.c
56
 Serial.dll: libSerial/serialHelper.c libSerial/winSerial.c
50
 	make -C libSerial
61
 	make -C libSerial
51
 	mv libSerial/libSerial.jnilib libSerial.jnilib
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
 # Delete intermediate files
68
 # Delete intermediate files
54
 clean:
69
 clean:
55
 	make -C libSerial clean
70
 	make -C libSerial clean

+ 2
- 2
README.md View File

18
 
18
 
19
 ## Build instructions
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
 The same goes for AudioFirmware and CubeFirmware. You need avr-gcc to compile these projects.
24
 The same goes for AudioFirmware and CubeFirmware. You need avr-gcc to compile these projects.

Loading…
Cancel
Save