Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 

88 rader
2.2 KiB

  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-2013 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 extensions.c readall.c
  37. OBJ = $(SRC:.c=.o)
  38. all: gpio
  39. gpio: $(OBJ)
  40. @echo [Link]
  41. @$(CC) -o $@ $(OBJ) $(LDFLAGS) $(LIBS)
  42. .c.o:
  43. @echo [Compile] $<
  44. @$(CC) -c $(CFLAGS) $< -o $@
  45. .PHONEY: clean
  46. clean:
  47. @echo "[Clean]"
  48. @rm -f $(OBJ) gpio *~ core tags *.bak
  49. .PHONEY: tags
  50. tags: $(SRC)
  51. @echo [ctags]
  52. @ctags $(SRC)
  53. .PHONEY: install
  54. install:
  55. @echo "[Install]"
  56. @cp gpio $(DESTDIR)$(PREFIX)/bin
  57. @chown root.root $(DESTDIR)$(PREFIX)/bin/gpio
  58. @chmod 4755 $(DESTDIR)$(PREFIX)/bin/gpio
  59. @mkdir -p $(DESTDIR)$(PREFIX)/man/man1
  60. @cp gpio.1 $(DESTDIR)$(PREFIX)/man/man1
  61. .PHONEY: uninstall
  62. uninstall:
  63. @echo "[UnInstall]"
  64. @rm -f $(DESTDIR)$(PREFIX)/bin/gpio
  65. @rm -f $(DESTDIR)$(PREFIX)/man/man1/gpio.1
  66. .PHONEY: depend
  67. depend:
  68. makedepend -Y $(SRC)
  69. # DO NOT DELETE
  70. gpio.o: extensions.h
  71. extensions.o: extensions.h