|
1 | 1 | # TODO! Make this platform independent! |
2 | 2 | INC = "C:\PROGRA~2\Java\jdk1.7.0_45\include" "C:\PROGRA~2\Java\jdk1.7.0_45\include\win32" |
3 | | -EXT = .dll |
4 | 3 |
|
5 | | -all : TSDRLibraryNDK$(EXT) |
| 4 | +ifeq ($(OS),Windows_NT) |
| 5 | + EXT = .dll |
| 6 | +else |
| 7 | + UNAME_S := $(shell uname -s) |
| 8 | + ifeq ($(UNAME_S),Linux) |
| 9 | + EXT = .so |
| 10 | + endif |
| 11 | +endif |
6 | 12 |
|
7 | | -# $@ matches the target, $< matches the first dependancy |
8 | | -TSDRLibraryNDK$(EXT) : TSDRLibraryNDK.o |
9 | | - gcc -Wl,--add-stdcall-alias -shared -o $@ $< |
| 13 | +all : ../TSDRLibraryNDK$(EXT) |
| 14 | + |
| 15 | +# $@ matches the target, $< matches the firs8t dependancy |
| 16 | +../TSDRLibraryNDK$(EXT) : TSDRLibraryNDK.o rebuildtempestsdr |
| 17 | + gcc -L../../TempestSDR/bin/ -lTSDRLibrary -Wl,--add-stdcall-alias -shared -o $@ $< |
| 18 | + |
| 19 | +rebuildtempestsdr : |
| 20 | + @$(MAKE) -C ../../TempestSDR bin/TSDRLibrary$(EXT) |
| 21 | + @cp -f ../../TempestSDR/bin/TSDRLibrary$(EXT) ../TSDRLibrary$(EXT) |
10 | 22 |
|
11 | 23 | # $@ matches the target, $< matches the first dependancy |
12 | | -TSDRLibraryNDK.o : TSDRLibraryNDK.c TSDRLibraryNDK.h |
| 24 | +TSDRLibraryNDK.o : TSDRLibraryNDK.c TSDRLibraryNDK.h include/TSDRLibrary.h |
13 | 25 | gcc $(foreach d, $(INC), -I$d) -c $< -o $@ |
| 26 | + |
| 27 | +include/TSDRLibrary.h : ../../TempestSDR/src/include/TSDRLibrary.h |
| 28 | + mkdir -p include |
| 29 | + @cp -f $< $@ |
14 | 30 |
|
15 | | -# $* matches the target filename without the extension |
16 | 31 | TSDRLibraryNDK.h : ../bin/martin/tempest/core/TSDRLibrary.class |
17 | 32 | javah -classpath ../bin -o TSDRLibraryNDK.h -jni martin.tempest.core.TSDRLibrary |
| 33 | + |
| 34 | +../bin/martin/tempest/core/TSDRLibrary.class : ../src/martin/tempest/core/TSDRLibrary.java |
| 35 | + mkdir -p include ../bin/martin/tempest/core/ |
| 36 | + javac $< -d ../bin/ |
18 | 37 |
|
19 | 38 | clean : |
20 | | - rm -f *.h *.o *.dll *.so *.exe |
| 39 | + rm -f TSDRLibraryNDK.h *.o ../TSDRLibraryNDK$(EXT) ../TSDRLibrary$(EXT) include/*.h |
| 40 | + rm -rf include/ |
0 commit comments