Makefile 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. #
  2. # Makefile:
  3. # wiringPi - Wiring Compatable library for the Raspberry Pi
  4. # https://projects.drogon.net/wiring-pi
  5. #
  6. # Copyright (c) 2012 Gordon Henderson
  7. #################################################################################
  8. # This file is part of wiringPi:
  9. # Wiring Compatable library for the Raspberry Pi
  10. #
  11. # wiringPi is free software: you can redistribute it and/or modify
  12. # it under the terms of the GNU Lesser General Public License as published by
  13. # the Free Software Foundation, either version 3 of the License, or
  14. # (at your option) any later version.
  15. #
  16. # wiringPi is distributed in the hope that it will be useful,
  17. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. # GNU Lesser General Public License for more details.
  20. #
  21. # You should have received a copy of the GNU Lesser General Public License
  22. # along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
  23. #################################################################################
  24. ifneq ($V,1)
  25. Q ?= @
  26. endif
  27. #DEBUG = -g -O0
  28. DEBUG = -O3
  29. CC = gcc
  30. INCLUDE = -I/usr/local/include
  31. CFLAGS = $(DEBUG) -Wall $(INCLUDE) -Winline -pipe
  32. LDFLAGS = -L/usr/local/lib
  33. LDLIBS = -lwiringPi -lwiringPiDev -lpthread -lm
  34. # Should not alter anything below this line
  35. ###############################################################################
  36. SRC = blink.c blink8.c blink12.c \
  37. blink12drcs.c \
  38. pwm.c \
  39. speed.c wfi.c isr.c isr-osc.c \
  40. lcd.c lcd-adafruit.c clock.c \
  41. nes.c \
  42. softPwm.c softTone.c \
  43. delayTest.c serialRead.c serialTest.c okLed.c ds1302.c \
  44. lowPower.c \
  45. rht03.c piglow.c
  46. OBJ = $(SRC:.c=.o)
  47. BINS = $(SRC:.c=)
  48. all:
  49. $Q cat README.TXT
  50. $Q echo " $(BINS)" | fmt
  51. $Q echo ""
  52. really-all: $(BINS)
  53. blink: blink.o
  54. $Q echo [link]
  55. $Q $(CC) -o $@ blink.o $(LDFLAGS) $(LDLIBS)
  56. blink8: blink8.o
  57. $Q echo [link]
  58. $Q $(CC) -o $@ blink8.o $(LDFLAGS) $(LDLIBS)
  59. blink12drcs: blink12drcs.o
  60. $Q echo [link]
  61. $Q $(CC) -o $@ blink12drcs.o $(LDFLAGS) $(LDLIBS)
  62. blink12: blink12.o
  63. $Q echo [link]
  64. $Q $(CC) -o $@ blink12.o $(LDFLAGS) $(LDLIBS)
  65. speed: speed.o
  66. $Q echo [link]
  67. $Q $(CC) -o $@ speed.o $(LDFLAGS) $(LDLIBS)
  68. lcd: lcd.o
  69. $Q echo [link]
  70. $Q $(CC) -o $@ lcd.o $(LDFLAGS) $(LDLIBS)
  71. lcd-adafruit: lcd-adafruit.o
  72. $Q echo [link]
  73. $Q $(CC) -o $@ lcd-adafruit.o $(LDFLAGS) $(LDLIBS)
  74. clock: clock.o
  75. $Q echo [link]
  76. $Q $(CC) -o $@ clock.o $(LDFLAGS) $(LDLIBS)
  77. wfi: wfi.o
  78. $Q echo [link]
  79. $Q $(CC) -o $@ wfi.o $(LDFLAGS) $(LDLIBS)
  80. isr: isr.o
  81. $Q echo [link]
  82. $Q $(CC) -o $@ isr.o $(LDFLAGS) $(LDLIBS)
  83. isr-osc: isr-osc.o
  84. $Q echo [link]
  85. $Q $(CC) -o $@ isr-osc.o $(LDFLAGS) $(LDLIBS)
  86. nes: nes.o
  87. $Q echo [link]
  88. $Q $(CC) -o $@ nes.o $(LDFLAGS) $(LDLIBS)
  89. rht03: rht03.o
  90. $Q echo [link]
  91. $Q $(CC) -o $@ rht03.o $(LDFLAGS) $(LDLIBS)
  92. pwm: pwm.o
  93. $Q echo [link]
  94. $Q $(CC) -o $@ pwm.o $(LDFLAGS) $(LDLIBS)
  95. softPwm: softPwm.o
  96. $Q echo [link]
  97. $Q $(CC) -o $@ softPwm.o $(LDFLAGS) $(LDLIBS)
  98. softTone: softTone.o
  99. $Q echo [link]
  100. $Q $(CC) -o $@ softTone.o $(LDFLAGS) $(LDLIBS)
  101. delayTest: delayTest.o
  102. $Q echo [link]
  103. $Q $(CC) -o $@ delayTest.o $(LDFLAGS) $(LDLIBS)
  104. serialRead: serialRead.o
  105. $Q echo [link]
  106. $Q $(CC) -o $@ serialRead.o $(LDFLAGS) $(LDLIBS)
  107. serialTest: serialTest.o
  108. $Q echo [link]
  109. $Q $(CC) -o $@ serialTest.o $(LDFLAGS) $(LDLIBS)
  110. okLed: okLed.o
  111. $Q echo [link]
  112. $Q $(CC) -o $@ okLed.o $(LDFLAGS) $(LDLIBS)
  113. tone: tone.o
  114. $Q echo [link]
  115. $Q $(CC) -o $@ tone.o $(LDFLAGS) $(LDLIBS)
  116. ds1302: ds1302.o
  117. $Q echo [link]
  118. $Q $(CC) -o $@ ds1302.o $(LDFLAGS) $(LDLIBS)
  119. piglow: piglow.o
  120. $Q echo [link]
  121. $Q $(CC) -o $@ piglow.o $(LDFLAGS) $(LDLIBS)
  122. .c.o:
  123. $Q echo [CC] $<
  124. $Q $(CC) -c $(CFLAGS) $< -o $@
  125. clean:
  126. $Q echo "[Clean]"
  127. $Q rm -f $(OBJ) *~ core tags $(BINS)
  128. tags: $(SRC)
  129. $Q echo [ctags]
  130. $Q ctags $(SRC)
  131. depend:
  132. makedepend -Y $(SRC)
  133. # DO NOT DELETE