/farmR/src/jvm-w32/Makefile

https://code.google.com/p/javawfm/ · Makefile · 38 lines · 15 code · 10 blank · 13 comment · 0 complexity · 380cc787e81f49fd8ef26e893aaac678 MD5 · raw file

  1. # helper tools and libs for building and running rJava for Windows
  2. # Author: Simon Urbanek
  3. TARGETS=libjvm.dll.a findjava.exe WinRegistry.dll
  4. # libjvm.dll.a - wrapper lib for jvm.dll from Java
  5. # findjava.exe - helper tool to find the current JDK from the registry
  6. # WinRegistry.dll - helper lib to provide registry access to rJava before
  7. # rJava.dll is loaded, because at that point path to
  8. # jvm.dll must be known. We don't hard-code the JVM path,
  9. # because updates of JRE/JDK can re-locate it.
  10. all: $(TARGETS)
  11. libjvm.dll.a: jvm.def
  12. dlltool --input-def jvm.def --kill-at --dllname jvm.dll --output-lib libjvm.dll.a
  13. # compile findjava.exe from source - no magic here, no special libs necessary
  14. findjava.o: findjava.c
  15. $(CC) -O2 -c -o $@ $^
  16. findjava.exe: findjava.o
  17. $(CC) -s -o $@ $^
  18. # compile WinRegistry.dll - this can be tricky, because it should emulate
  19. # the way R builds package DLLs. I know of no easier or more reliable way
  20. # to do that ..
  21. WinRegistry.o: WinRegistry.c
  22. $(CC) -O2 -c -o $@ $^ -I$(RHOME)/include
  23. WinRegistry.dll: WinRegistry.o
  24. $(CC) --shared -s -o $@ $^ -lR -L$(RHOME)/src/gnuwin32 -L$(RHOME)/bin
  25. # just cleanup everything
  26. clean:
  27. rm -f *.o *~ $(TARGETS)
  28. .PHONY: all clean