Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #
  2. # Makefile:
  3. # The gpio command:
  4. # A swiss-army knige of GPIO shenanigans.
  5. # https://projects.drogon.net/wiring-pi
  6. #
  7. # Copyright (c) 2012-2015 Gordon Henderson
  8. #################################################################################
  9. # This file is part of wiringPi:
  10. # Wiring Compatable library for the Raspberry Pi
  11. #
  12. # wiringPi is free software: you can redistribute it and/or modify
  13. # it under the terms of the GNU Lesser General Public License as published by
  14. # the Free Software Foundation, either version 3 of the License, or
  15. # (at your option) any later version.
  16. #
  17. # wiringPi is distributed in the hope that it will be useful,
  18. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. # GNU Lesser General Public License for more details.
  21. #
  22. # You should have received a copy of the GNU Lesser General Public License
  23. # along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
  24. #################################################################################
  25. DESTDIR=/usr
  26. PREFIX=/local
  27. #DEBUG = -g -O0
  28. DEBUG = -O2
  29. CC = gcc
  30. INCLUDE = -I$(DESTDIR)$(PREFIX)/include
  31. CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
  32. LDFLAGS = -L$(DESTDIR)$(PREFIX)/lib
  33. LIBS = -lwiringPi -lwiringPiDev -lpthread -lm
  34. # May not need to alter anything below this line
  35. ###############################################################################
  36. SRC = gpio.c readall.c pins.c
  37. OBJ = $(SRC:.c=.o)
  38. all: gpio
  39. version.h: ../VERSION
  40. ./newVersion
  41. gpio: $(OBJ)
  42. @echo [Link]
  43. @$(CC) -o $@ $(OBJ) $(LDFLAGS) $(LIBS)
  44. .c.o:
  45. @echo [Compile] $<
  46. @$(CC) -c $(CFLAGS) $< -o $@
  47. .PHONY: clean
  48. clean:
  49. @echo "[Clean]"
  50. @rm -f $(OBJ) gpio *~ core tags *.bak
  51. .PHONY: tags
  52. tags: $(SRC)
  53. @echo [ctags]
  54. @ctags $(SRC)
  55. .PHONY: install
  56. install: gpio
  57. @echo "[Install]"
  58. @cp gpio $(DESTDIR)$(PREFIX)/bin
  59. @chown root.root $(DESTDIR)$(PREFIX)/bin/gpio
  60. @chmod 4755 $(DESTDIR)$(PREFIX)/bin/gpio
  61. @mkdir -p $(DESTDIR)$(PREFIX)/man/man1
  62. @cp gpio.1 $(DESTDIR)$(PREFIX)/man/man1
  63. .PHONY: install-deb
  64. install-deb: gpio
  65. @echo "[Install: deb]"
  66. @install -m 0755 -d ~/wiringPi/debian/wiringPi/usr/bin
  67. @install -m 0755 gpio ~/wiringPi/debian/wiringPi/usr/bin
  68. .PHONY: uninstall
  69. uninstall:
  70. @echo "[UnInstall]"
  71. @rm -f $(DESTDIR)$(PREFIX)/bin/gpio
  72. @rm -f $(DESTDIR)$(PREFIX)/man/man1/gpio.1
  73. .PHONY: depend
  74. depend:
  75. makedepend -Y $(SRC)
  76. # DO NOT DELETE