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.

Makefile 2.7 KiB

12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
12 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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-2016 Gordon Henderson
  8. #################################################################################
  9. # This file is part of wiringPi:
  10. # A "wiring" 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. ifneq ($V,1)
  28. Q ?= @
  29. endif
  30. #DEBUG = -g -O0
  31. DEBUG = -O2
  32. CC = gcc
  33. INCLUDE = -I$(DESTDIR)$(PREFIX)/include
  34. CFLAGS = $(DEBUG) -Wall -Wextra $(INCLUDE) -Winline -pipe
  35. LDFLAGS = -L$(DESTDIR)$(PREFIX)/lib
  36. LIBS = -lwiringPi -lwiringPiDev -lpthread -lrt -lm -lcrypt
  37. # May not need to alter anything below this line
  38. ###############################################################################
  39. SRC = gpio.c readall.c pins.c
  40. OBJ = $(SRC:.c=.o)
  41. all: gpio
  42. version.h: ../VERSION
  43. $Q echo Need to run newVersion above.
  44. gpio: $(OBJ)
  45. $Q echo [Link]
  46. $Q $(CC) -o $@ $(OBJ) $(LDFLAGS) $(LIBS)
  47. .c.o:
  48. $Q echo [Compile] $<
  49. $Q $(CC) -c $(CFLAGS) $< -o $@
  50. .PHONY: clean
  51. clean:
  52. $Q echo "[Clean]"
  53. $Q rm -f $(OBJ) gpio *~ core tags *.bak
  54. .PHONY: tags
  55. tags: $(SRC)
  56. $Q echo [ctags]
  57. $Q ctags $(SRC)
  58. .PHONY: install
  59. install: gpio
  60. $Q echo "[Install]"
  61. $Q cp gpio $(DESTDIR)$(PREFIX)/bin
  62. ifneq ($(WIRINGPI_SUID),0)
  63. $Q chown root.root $(DESTDIR)$(PREFIX)/bin/gpio
  64. $Q chmod 4755 $(DESTDIR)$(PREFIX)/bin/gpio
  65. endif
  66. $Q mkdir -p $(DESTDIR)$(PREFIX)/man/man1
  67. $Q cp gpio.1 $(DESTDIR)$(PREFIX)/man/man1
  68. .PHONY: install-deb
  69. install-deb: gpio
  70. $Q echo "[Install: deb]"
  71. $Q install -m 0755 -d ~/wiringPi/debian-template/wiringPi/usr/bin
  72. $Q install -m 0755 gpio ~/wiringPi/debian-template/wiringPi/usr/bin
  73. $Q install -m 0755 -d ~/wiringPi/debian-template/wiringPi/man/man1
  74. $Q install -m 0644 gpio.1 ~/wiringPi/debian-template/wiringPi/man/man1
  75. .PHONY: uninstall
  76. uninstall:
  77. $Q echo "[UnInstall]"
  78. $Q rm -f $(DESTDIR)$(PREFIX)/bin/gpio
  79. $Q rm -f $(DESTDIR)$(PREFIX)/man/man1/gpio.1
  80. .PHONY: depend
  81. depend:
  82. makedepend -Y $(SRC)
  83. # DO NOT DELETE
  84. gpio.o: ../version.h