Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 

131 řádky
3.7 KiB

  1. # Makefile:
  2. # wiringPi device - Wiring Compatable library for the Raspberry Pi
  3. #
  4. # Copyright (c) 2012-2013 Gordon Henderson
  5. #################################################################################
  6. # This file is part of wiringPi:
  7. # https://projects.drogon.net/raspberry-pi/wiringpi/
  8. #
  9. # wiringPi is free software: you can redistribute it and/or modify
  10. # it under the terms of the GNU Lesser General Public License as published by
  11. # the Free Software Foundation, either version 3 of the License, or
  12. # (at your option) any later version.
  13. #
  14. # wiringPi is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. # GNU Lesser General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU Lesser General Public License
  20. # along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
  21. #################################################################################
  22. DYN_VERS_MAJ=2
  23. DYN_VERS_MIN=0
  24. VERSION=$(DYN_VERS_MAJ).$(DYN_VERS_MIN)
  25. DESTDIR=/usr
  26. PREFIX=/local
  27. STATIC=libwiringPiDev.a
  28. DYNAMIC=libwiringPiDev.so.$(VERSION)
  29. #DEBUG = -g -O0
  30. DEBUG = -O2
  31. CC = gcc
  32. INCLUDE = -I.
  33. CFLAGS = $(DEBUG) -Wformat=2 -Wall $(INCLUDE) -Winline -pipe -fPIC
  34. LIBS =
  35. ###############################################################################
  36. SRC = ds1302.c maxdetect.c piNes.c \
  37. gertboard.c piFace.c \
  38. lcd128x64.c lcd.c
  39. OBJ = $(SRC:.c=.o)
  40. all: $(DYNAMIC)
  41. static: $(STATIC)
  42. $(STATIC): $(OBJ)
  43. @echo "[Link (Static)]"
  44. @ar rcs $(STATIC) $(OBJ)
  45. @ranlib $(STATIC)
  46. # @size $(STATIC)
  47. $(DYNAMIC): $(OBJ)
  48. @echo "[Link (Dynamic)]"
  49. @$(CC) -shared -Wl,-soname,libwiringPiDev.so -o libwiringPiDev.so.$(VERSION) -lpthread $(OBJ)
  50. .c.o:
  51. @echo [Compile] $<
  52. @$(CC) -c $(CFLAGS) $< -o $@
  53. .PHONEY: clean
  54. clean:
  55. @echo "[Clean]"
  56. @rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak libwiringPiDev.*
  57. .PHONEY: tags
  58. tags: $(SRC)
  59. @echo [ctags]
  60. @ctags $(SRC)
  61. .PHONEY: install-headers
  62. install-headers:
  63. @echo "[Install Headers]"
  64. @install -m 0755 -d $(DESTDIR)$(PREFIX)/include
  65. @install -m 0644 ds1302.h $(DESTDIR)$(PREFIX)/include
  66. @install -m 0644 maxdetect.h $(DESTDIR)$(PREFIX)/include
  67. @install -m 0644 piNes.h $(DESTDIR)$(PREFIX)/include
  68. @install -m 0644 gertboard.h $(DESTDIR)$(PREFIX)/include
  69. @install -m 0644 piFace.h $(DESTDIR)$(PREFIX)/include
  70. @install -m 0644 lcd128x64.h $(DESTDIR)$(PREFIX)/include
  71. @install -m 0644 lcd.h $(DESTDIR)$(PREFIX)/include
  72. .PHONEY: install
  73. install: $(DYNAMIC) install-headers
  74. @echo "[Install Dynamic Lib]"
  75. @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
  76. @install -m 0755 libwiringPiDev.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION)
  77. @ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION) $(DESTDIR)/lib/libwiringPiDev.so
  78. @ldconfig
  79. .PHONEY: install-static
  80. install-static: $(STATIC) install-headers
  81. @echo "[Install Static Lib]"
  82. @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
  83. @install -m 0755 libwiringPiDev.a $(DESTDIR)$(PREFIX)/lib
  84. .PHONEY: uninstall
  85. uninstall:
  86. @echo "[UnInstall]"
  87. @rm -f $(DESTDIR)$(PREFIX)/include/ds1302.h
  88. @rm -f $(DESTDIR)$(PREFIX)/include/maxdetect.h
  89. @rm -f $(DESTDIR)$(PREFIX)/include/piNes.h
  90. @rm -f $(DESTDIR)$(PREFIX)/include/gertboard.h
  91. @rm -f $(DESTDIR)$(PREFIX)/include/piFace.h
  92. @rm -f $(DESTDIR)$(PREFIX)/include/lcd128x64.h
  93. @rm -f $(DESTDIR)$(PREFIX)/include/lcd.h
  94. @rm -f $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.*
  95. @ldconfig
  96. .PHONEY: depend
  97. depend:
  98. makedepend -Y $(SRC)
  99. # DO NOT DELETE
  100. ds1302.o: ds1302.h
  101. maxdetect.o: maxdetect.h
  102. piNes.o: piNes.h
  103. gertboard.o: gertboard.h
  104. piFace.o: piFace.h
  105. lcd128x64.o: font.h lcd128x64.h
  106. lcd.o: lcd.h