您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. # ;
  2. # Makefile:
  3. # wiringPi - Wiring Compatable library for the Raspberry Pi
  4. #
  5. # Copyright (c) 2012 Gordon Henderson
  6. #################################################################################
  7. # This file is part of wiringPi:
  8. # https://projects.drogon.net/raspberry-pi/wiringpi/
  9. #
  10. # wiringPi is free software: you can redistribute it and/or modify
  11. # it under the terms of the GNU Lesser General Public License as published by
  12. # the Free Software Foundation, either version 3 of the License, or
  13. # (at your option) any later version.
  14. #
  15. # wiringPi is distributed in the hope that it will be useful,
  16. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. # GNU Lesser General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU Lesser General Public License
  21. # along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
  22. #################################################################################
  23. DYN_VERS_MAJ=2
  24. DYN_VERS_MIN=0
  25. VERSION=$(DYN_VERS_MAJ).$(DYN_VERS_MIN)
  26. DESTDIR=/usr
  27. PREFIX=/local
  28. STATIC=libwiringPi.a
  29. DYNAMIC=libwiringPi.so.$(VERSION)
  30. #DEBUG = -g -O0
  31. DEBUG = -O2
  32. CC = gcc
  33. INCLUDE = -I.
  34. DEFS = -D_GNU_SOURCE
  35. CFLAGS = $(DEBUG) $(DEFS) -Wformat=2 -Wall -Winline $(INCLUDE) -pipe -fPIC
  36. LIBS =
  37. # Should not alter anything below this line
  38. ###############################################################################
  39. SRC = wiringPi.c \
  40. wiringSerial.c wiringShift.c \
  41. piHiPri.c piThread.c \
  42. wiringPiSPI.c wiringPiI2C.c \
  43. softPwm.c softTone.c \
  44. mcp23008.c mcp23016.c mcp23017.c \
  45. mcp23s08.c mcp23s17.c \
  46. sr595.c \
  47. pcf8574.c pcf8591.c \
  48. mcp3002.c mcp3004.c mcp4802.c mcp3422.c \
  49. max31855.c max5322.c \
  50. drc.c
  51. OBJ = $(SRC:.c=.o)
  52. all: $(DYNAMIC)
  53. static: $(STATIC)
  54. $(STATIC): $(OBJ)
  55. @echo "[Link (Static)]"
  56. @ar rcs $(STATIC) $(OBJ)
  57. @ranlib $(STATIC)
  58. # @size $(STATIC)
  59. $(DYNAMIC): $(OBJ)
  60. @echo "[Link (Dynamic)]"
  61. @$(CC) -shared -Wl,-soname,libwiringPi.so -o libwiringPi.so.$(VERSION) -lpthread $(OBJ)
  62. .c.o:
  63. @echo [Compile] $<
  64. @$(CC) -c $(CFLAGS) $< -o $@
  65. .PHONEY: clean
  66. clean:
  67. @echo "[Clean]"
  68. @rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak libwiringPi.*
  69. .PHONEY: tags
  70. tags: $(SRC)
  71. @echo [ctags]
  72. @ctags $(SRC)
  73. .PHONEY: install-headers
  74. install-headers:
  75. @echo "[Install Headers]"
  76. @install -m 0755 -d $(DESTDIR)$(PREFIX)/include
  77. @install -m 0644 wiringPi.h $(DESTDIR)$(PREFIX)/include
  78. @install -m 0644 wiringSerial.h $(DESTDIR)$(PREFIX)/include
  79. @install -m 0644 wiringShift.h $(DESTDIR)$(PREFIX)/include
  80. @install -m 0644 softPwm.h $(DESTDIR)$(PREFIX)/include
  81. @install -m 0644 softTone.h $(DESTDIR)$(PREFIX)/include
  82. @install -m 0644 wiringPiSPI.h $(DESTDIR)$(PREFIX)/include
  83. @install -m 0644 wiringPiI2C.h $(DESTDIR)$(PREFIX)/include
  84. @install -m 0644 mcp23008.h $(DESTDIR)$(PREFIX)/include
  85. @install -m 0644 mcp23016.h $(DESTDIR)$(PREFIX)/include
  86. @install -m 0644 mcp23017.h $(DESTDIR)$(PREFIX)/include
  87. @install -m 0644 mcp23s08.h $(DESTDIR)$(PREFIX)/include
  88. @install -m 0644 mcp23s17.h $(DESTDIR)$(PREFIX)/include
  89. @install -m 0644 max31855.h $(DESTDIR)$(PREFIX)/include
  90. @install -m 0644 max5322.h $(DESTDIR)$(PREFIX)/include
  91. @install -m 0644 mcp3002.h $(DESTDIR)$(PREFIX)/include
  92. @install -m 0644 mcp3004.h $(DESTDIR)$(PREFIX)/include
  93. @install -m 0644 mcp4802.h $(DESTDIR)$(PREFIX)/include
  94. @install -m 0644 mcp3422.h $(DESTDIR)$(PREFIX)/include
  95. @install -m 0644 sr595.h $(DESTDIR)$(PREFIX)/include
  96. @install -m 0644 pcf8574.h $(DESTDIR)$(PREFIX)/include
  97. @install -m 0644 pcf8591.h $(DESTDIR)$(PREFIX)/include
  98. .PHONEY: install
  99. install: $(DYNAMIC) install-headers
  100. @echo "[Install Dynamic Lib]"
  101. @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
  102. @install -m 0755 libwiringPi.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION)
  103. @ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPi.so.$(VERSION) $(DESTDIR)/lib/libwiringPi.so
  104. @ldconfig
  105. .PHONEY: install-static
  106. install-static: $(STATIC) install-headers
  107. @echo "[Install Static Lib]"
  108. @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
  109. @install -m 0755 libwiringPi.a $(DESTDIR)$(PREFIX)/lib
  110. .PHONEY: uninstall
  111. uninstall:
  112. @echo "[UnInstall]"
  113. @rm -f $(DESTDIR)$(PREFIX)/include/wiringPi.h
  114. @rm -f $(DESTDIR)$(PREFIX)/include/wiringSerial.h
  115. @rm -f $(DESTDIR)$(PREFIX)/include/wiringShift.h
  116. @rm -f $(DESTDIR)$(PREFIX)/include/softPwm.h
  117. @rm -f $(DESTDIR)$(PREFIX)/include/softTone.h
  118. @rm -f $(DESTDIR)$(PREFIX)/include/wiringPiSPI.h
  119. @rm -f $(DESTDIR)$(PREFIX)/include/wiringPiI2C.h
  120. @rm -f $(DESTDIR)$(PREFIX)/include/mcp23008.h
  121. @rm -f $(DESTDIR)$(PREFIX)/include/mcp23016.h
  122. @rm -f $(DESTDIR)$(PREFIX)/include/mcp23017.h
  123. @rm -f $(DESTDIR)$(PREFIX)/include/mcp23s08.h
  124. @rm -f $(DESTDIR)$(PREFIX)/include/mcp23s17.h
  125. @rm -f $(DESTDIR)$(PREFIX)/include/max31855.h
  126. @rm -f $(DESTDIR)$(PREFIX)/include/max5322.h
  127. @rm -f $(DESTDIR)$(PREFIX)/include/mcp3002.h
  128. @rm -f $(DESTDIR)$(PREFIX)/include/mcp3004.h
  129. @rm -f $(DESTDIR)$(PREFIX)/include/mcp4802.h
  130. @rm -f $(DESTDIR)$(PREFIX)/include/mcp3422.h
  131. @rm -f $(DESTDIR)$(PREFIX)/include/sr595.h
  132. @rm -f $(DESTDIR)$(PREFIX)/include/pcf8574.h
  133. @rm -f $(DESTDIR)$(PREFIX)/include/pcf8591.h
  134. @rm -f $(DESTDIR)$(PREFIX)/lib/libwiringPi.*
  135. @ldconfig
  136. .PHONEY: depend
  137. depend:
  138. makedepend -Y $(SRC) $(SRC_I2C)
  139. # DO NOT DELETE
  140. wiringPi.o: wiringPi.h
  141. wiringSerial.o: wiringSerial.h
  142. wiringShift.o: wiringPi.h wiringShift.h
  143. piHiPri.o: wiringPi.h
  144. piThread.o: wiringPi.h
  145. wiringPiSPI.o: wiringPi.h wiringPiSPI.h
  146. wiringPiI2C.o: wiringPi.h wiringPiI2C.h
  147. softPwm.o: wiringPi.h softPwm.h
  148. softTone.o: wiringPi.h softTone.h
  149. mcp23008.o: wiringPi.h wiringPiI2C.h mcp23x0817.h mcp23008.h
  150. mcp23016.o: wiringPi.h wiringPiI2C.h mcp23016.h mcp23016reg.h
  151. mcp23017.o: wiringPi.h wiringPiI2C.h mcp23x0817.h mcp23017.h
  152. mcp23s08.o: wiringPi.h wiringPiSPI.h mcp23x0817.h mcp23s08.h
  153. mcp23s17.o: wiringPi.h wiringPiSPI.h mcp23x0817.h mcp23s17.h
  154. sr595.o: wiringPi.h sr595.h
  155. pcf8574.o: wiringPi.h wiringPiI2C.h pcf8574.h
  156. pcf8591.o: wiringPi.h wiringPiI2C.h pcf8591.h
  157. mcp3002.o: wiringPi.h wiringPiSPI.h mcp3002.h
  158. mcp3004.o: wiringPi.h wiringPiSPI.h mcp3004.h
  159. mcp4802.o: wiringPi.h wiringPiSPI.h mcp4802.h
  160. mcp3422.o: wiringPi.h wiringPiI2C.h mcp3422.h
  161. max31855.o: wiringPi.h wiringPiSPI.h max31855.h
  162. max5322.o: wiringPi.h wiringPiSPI.h max5322.h
  163. drc.o: wiringPi.h wiringSerial.h drc.h