Testing out the PPD42 Air Quality Sensor, with an MSP430 Launchpad and graphing the data with GNUplot.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
8.0 KiB

5 years ago
  1. #-------------------------------------------------------------------------
  2. # rxtx is a native interface to serial ports in java.
  3. # Copyright 1997-2004 by Trent Jarvi taj@www.linux.org.uk.
  4. #
  5. # This library is free software; you can redistribute it and/or
  6. # modify it under the terms of the GNU Library General Public
  7. # License as published by the Free Software Foundation; either
  8. # version 2 of the License, or (at your option) any later version.
  9. #
  10. # This library is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. # Library General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU Library General Public
  16. # License along with this library; if not, write to the Free
  17. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. #-------------------------------------------------------------------------
  19. srcdir = @srcdir@
  20. abs_srcdir=$(TOP)/@srcdir@
  21. VPATH = @srcdir@
  22. AUTOMAKE_OPTIONS = foreign
  23. INCLUDES= -I$(TOP) -I$(DEST) -I. $(JAVAINCLUDE) $(JAVANATINC)
  24. ####################### vars for rxtx-1.4->1.5 transition
  25. JARTARGET=RXTXcomm.jar
  26. CLASSDIR=gnu.io
  27. CLASSTOP=gnu
  28. CLASSDEST=gnu/io
  29. ####################### tools
  30. LIBTOOLC=$(GLIBTOOL) --mode=compile $(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(VERBOSE_IOEXCEPTIONS) -c
  31. LIBTOOL_INST=$(GLIBTOOL) --mode=install $(INSTALL_PROGRAM)
  32. ####################### dirs
  33. SPATH = $(abs_srcdir)/src
  34. DEST=$(target_triplet)
  35. ####################### rules
  36. CLASSES = $(patsubst $(SPATH)/%.java,$(TOP)/$(CLASSDEST)/%.class,$(wildcard $(SPATH)/*.java))
  37. javafiles = $(wildcard $(SPATH)/*.java)
  38. javahfiles = $(patsubst $(SPATH)/%.java,%,$(wildcard $(SPATH)/*.java))
  39. #######################
  40. CLEANFILES = $(TOP)/*.class $(TOP)/$(CLASSDEST)/*.class $(TOP)/$(JARTARGET)
  41. # for SCO builds everything else is currently using lib%.la below
  42. # I'm thinking about taking libtool out completely. See also Mac OS X builds.
  43. $(target_triplet)/lib%.so: $(SPATH)/%Imp.@EXTENSION@ $(CLASSES)
  44. $(COMPILE) $(SPATH)/$*Imp.@EXTENSION@ -o $(TOP)/$(DEST)/$*Imp.o
  45. $(LINK) -G -o lib$*.so $(TOP)/$(DEST)/$*Imp.o
  46. # compile src/SerialImp.c and similar files into libraries.
  47. # LIBTOOL_FIX handles problems encountered on some OS's. See configure.in
  48. # If a LIBTOOL_FIX is added be sure to provide a trailing ';' in configure.in
  49. $(target_triplet)/librxtx%.@LIB_EXTENSION@: $(SPATH)/%Imp.c $(CLASSES) $(SPATH)/%Imp.h
  50. ( \
  51. $(LIBTOOL_FIX) \
  52. cd $(DEST); \
  53. $(LIBTOOLC) $(SPATH)/$*Imp.@EXTENSION@ -o \
  54. $(TOP)/$(DEST)/$*Imp.@OBJECT_EXTENSION@; \
  55. if [ "$*" = "Serial" ]; then \
  56. $(LIBTOOLC) $(SPATH)/fuserImp.@EXTENSION@ -o \
  57. $(TOP)/$(DEST)/fuserImp.@OBJECT_EXTENSION@; \
  58. @LINK@ $(TOP)/$(DEST)/$*Imp.@OBJECT_EXTENSION@ \
  59. $(TOP)/$(DEST)/fuserImp.@OBJECT_EXTENSION@; \
  60. else \
  61. @LINK@ $(TOP)/$(DEST)/$*Imp.@OBJECT_EXTENSION@; \
  62. fi; \
  63. )
  64. # compile src/RXTXPort.java and similar files into classes
  65. # then create the .jar file
  66. $(CLASSES): $(javafiles) $(TOP)/Makefile
  67. $(JAVAH_FIX)
  68. $(JAVAC) $(javafiles)
  69. $(JAVAH) `(for i in $(javahfiles);do \
  70. if grep > /dev/null native.*\( $(SPATH)/$$i.java; then \
  71. echo $(CLASSDIR).$$i; \
  72. fi; \
  73. done)`
  74. $(JAR) cf $(JARTARGET) $(CLASSTOP)/*
  75. # install librxtxSerial.so into the proper directory and copy $(JARTARGET) to its
  76. # proper location
  77. install: all
  78. @$(LIBTOOL_INST) \
  79. `for i in $(TARGETLIB);do \
  80. if [ -f $$i ];then \
  81. echo $$i; \
  82. fi; \
  83. done` $(RXTX_PATH)
  84. $(INSTALL_PROGRAM) $(JARTARGET) $(JHOME)/
  85. clean-generic:
  86. rm -rf $(DEST) $(TOP)/$(CLASSTOP)
  87. -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
  88. all: $(TARGETLIB)
  89. # create the javadoc files.
  90. docs: $(CLASSES)
  91. $(JAVADOC) $(javafiles)
  92. ################ WIN32 CrossCompiling from here down #######################
  93. $(DEST)/rxtxSerial.dll: $(CLASSES) $(TOP)/Makefile
  94. gcc -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -b$(target_alias) -I $(TOP) -I $(DEST) -I . $(WINDOWS_JAVA_INCLUDE) -I $(SPATH) -Wall -c $(SPATH)/SerialImp.c -o $(DEST)/SerialImp.o
  95. gcc -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -b$(target_alias) -I $(TOP) -I $(DEST) -I . $(WINDOWS_JAVA_INCLUDE) -I $(SPATH) -Wall -c $(SPATH)/termios.c -o $(DEST)/termios.o
  96. gcc -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -b$(target_alias) -I $(TOP) -I $(DEST) -I . $(WINDOWS_JAVA_INCLUDE) -I $(SPATH) -Wall -c $(SPATH)/fixup.c -o $(DEST)/fixup.o
  97. gcc -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -b$(target_alias) -I $(TOP) -I $(DEST) -I . $(WINDOWS_JAVA_INCLUDE) -I $(SPATH) -Wall -c $(SPATH)/init.cc -o $(DEST)/init.o
  98. ld --base-file $(DEST)/Serial.base --dll -o $(DEST)/rxtxSerial.dll $(DEST)/termios.o $(DEST)/SerialImp.o $(DEST)/fixup.o $(DEST)/init.o -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmingw32 -lmoldname -lcrtdll -e _dll_entry@12 --base-file $(DEST)/Serial.base
  99. echo EXPORTS >$(DEST)/Serial.def;for i in `nm $(DEST)/rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(DEST)/Serial.def
  100. dlltool -b$(DEST) --as=as --dllname $(DEST)/rxtxSerial.dll --def $(DEST)/Serial.def --base-file $(DEST)/Serial.base --output-exp $(DEST)/Serial.exp
  101. ld --base-file $(DEST)/Serial.base $(DEST)/Serial.exp -dll -o $(DEST)/rxtxSerial.dll $(DEST)/termios.o $(DEST)/SerialImp.o $(DEST)/fixup.o $(DEST)/init.o -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmingw32 -lmoldname -lcrtdll -e _dll_entry@12 --base-file $(DEST)/Serial.base
  102. dlltool -b$(DEST) --as=as --dllname $(DEST)/rxtxSerial.dll --def $(DEST)/Serial.def --base-file $(DEST)/Serial.base --output-exp $(DEST)/Serial.exp
  103. ld $(DEST)/Serial.exp -dll -o $(DEST)/rxtxSerial.dll $(DEST)/termios.o $(DEST)/SerialImp.o $(DEST)/fixup.o $(DEST)/init.o -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmingw32 -lmoldname -lcrtdll -e _dll_entry@12 --base-file $(DEST)/Serial.base
  104. $(DEST)/rxtxParallel.dll: $(CLASSES) $(TOP)/Makefile
  105. gcc -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -b$(target_alias) -I $(TOP) -I $(DEST) -I . $(WINDOWS_JAVA_INCLUDE) -I $(SPATH) -Wall -c $(SPATH)/ParallelImp.c -o $(DEST)/ParallelImp.o
  106. gcc -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -b$(target_alias) -I $(TOP) -I $(DEST) -I . $(WINDOWS_JAVA_INCLUDE) -I $(SPATH) -Wall -c $(SPATH)/termios.c -o $(DEST)/termios.o
  107. gcc -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -b$(target_alias) -I $(TOP) -I $(DEST) -I . $(WINDOWS_JAVA_INCLUDE) -I $(SPATH) -Wall -c $(SPATH)/fixup.c -o $(DEST)/fixup.o
  108. gcc -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -b$(target_alias) -I $(TOP) -I $(DEST) -I . $(WINDOWS_JAVA_INCLUDE) -I $(SPATH) -Wall -c $(SPATH)/init.cc -o $(DEST)/init.o
  109. ld --base-file $(DEST)/Parallel.base --dll -o $(DEST)/rxtxParallel.dll $(DEST)/termios.o $(DEST)/ParallelImp.o $(DEST)/fixup.o $(DEST)/init.o -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmingw32 -lmoldname -lcrtdll -e _dll_entry@12 --base-file $(DEST)/Parallel.base
  110. echo EXPORTS >$(DEST)/Parallel.def;for i in `nm $(DEST)/rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(DEST)/Parallel.def
  111. dlltool -b$(DEST) --as=as --dllname $(DEST)/rxtxParallel.dll --def $(DEST)/Parallel.def --base-file $(DEST)/Parallel.base --output-exp $(DEST)/Parallel.exp
  112. ld --base-file $(DEST)/Parallel.base $(DEST)/Parallel.exp -dll -o $(DEST)/rxtxParallel.dll $(DEST)/termios.o $(DEST)/ParallelImp.o $(DEST)/fixup.o $(DEST)/init.o -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmingw32 -lmoldname -lcrtdll -e _dll_entry@12 --base-file $(DEST)/Parallel.base
  113. dlltool -b$(DEST) --as=as --dllname $(DEST)/rxtxParallel.dll --def $(DEST)/Parallel.def --base-file $(DEST)/Parallel.base --output-exp $(DEST)/Parallel.exp
  114. ld $(DEST)/Parallel.exp -dll -o $(DEST)/rxtxParallel.dll $(DEST)/termios.o $(DEST)/ParallelImp.o $(DEST)/fixup.o $(DEST)/init.o -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmingw32 -lmoldname -lcrtdll -e _dll_entry@12 --base-file $(DEST)/Parallel.base