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.
 
 
 
 
 

135 line
3.8 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. piGlow.c
  40. OBJ = $(SRC:.c=.o)
  41. all: $(DYNAMIC)
  42. static: $(STATIC)
  43. $(STATIC): $(OBJ)
  44. @echo "[Link (Static)]"
  45. @ar rcs $(STATIC) $(OBJ)
  46. @ranlib $(STATIC)
  47. # @size $(STATIC)
  48. $(DYNAMIC): $(OBJ)
  49. @echo "[Link (Dynamic)]"
  50. @$(CC) -shared -Wl,-soname,libwiringPiDev.so -o libwiringPiDev.so.$(VERSION) -lpthread $(OBJ)
  51. .c.o:
  52. @echo [Compile] $<
  53. @$(CC) -c $(CFLAGS) $< -o $@
  54. .PHONEY: clean
  55. clean:
  56. @echo "[Clean]"
  57. @rm -f $(OBJ) $(OBJ_I2C) *~ core tags Makefile.bak libwiringPiDev.*
  58. .PHONEY: tags
  59. tags: $(SRC)
  60. @echo [ctags]
  61. @ctags $(SRC)
  62. .PHONEY: install-headers
  63. install-headers:
  64. @echo "[Install Headers]"
  65. @install -m 0755 -d $(DESTDIR)$(PREFIX)/include
  66. @install -m 0644 ds1302.h $(DESTDIR)$(PREFIX)/include
  67. @install -m 0644 maxdetect.h $(DESTDIR)$(PREFIX)/include
  68. @install -m 0644 piNes.h $(DESTDIR)$(PREFIX)/include
  69. @install -m 0644 gertboard.h $(DESTDIR)$(PREFIX)/include
  70. @install -m 0644 piFace.h $(DESTDIR)$(PREFIX)/include
  71. @install -m 0644 lcd128x64.h $(DESTDIR)$(PREFIX)/include
  72. @install -m 0644 lcd.h $(DESTDIR)$(PREFIX)/include
  73. @install -m 0644 piGlow.h $(DESTDIR)$(PREFIX)/include
  74. .PHONEY: install
  75. install: $(DYNAMIC) install-headers
  76. @echo "[Install Dynamic Lib]"
  77. @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
  78. @install -m 0755 libwiringPiDev.so.$(VERSION) $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION)
  79. @ln -sf $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.so.$(VERSION) $(DESTDIR)/lib/libwiringPiDev.so
  80. @ldconfig
  81. .PHONEY: install-static
  82. install-static: $(STATIC) install-headers
  83. @echo "[Install Static Lib]"
  84. @install -m 0755 -d $(DESTDIR)$(PREFIX)/lib
  85. @install -m 0755 libwiringPiDev.a $(DESTDIR)$(PREFIX)/lib
  86. .PHONEY: uninstall
  87. uninstall:
  88. @echo "[UnInstall]"
  89. @rm -f $(DESTDIR)$(PREFIX)/include/ds1302.h
  90. @rm -f $(DESTDIR)$(PREFIX)/include/maxdetect.h
  91. @rm -f $(DESTDIR)$(PREFIX)/include/piNes.h
  92. @rm -f $(DESTDIR)$(PREFIX)/include/gertboard.h
  93. @rm -f $(DESTDIR)$(PREFIX)/include/piFace.h
  94. @rm -f $(DESTDIR)$(PREFIX)/include/lcd128x64.h
  95. @rm -f $(DESTDIR)$(PREFIX)/include/lcd.h
  96. @rm -f $(DESTDIR)$(PREFIX)/include/piGlow.h
  97. @rm -f $(DESTDIR)$(PREFIX)/lib/libwiringPiDev.*
  98. @ldconfig
  99. .PHONEY: depend
  100. depend:
  101. makedepend -Y $(SRC)
  102. # DO NOT DELETE
  103. ds1302.o: ds1302.h
  104. maxdetect.o: maxdetect.h
  105. piNes.o: piNes.h
  106. gertboard.o: gertboard.h
  107. piFace.o: piFace.h
  108. lcd128x64.o: font.h lcd128x64.h
  109. lcd.o: lcd.h
  110. piGlow.o: piGlow.h