Makefile 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. ############################################################################
  2. # drivers/Makefile
  3. #
  4. # Copyright (C) 2007-2014, 2016 Gregory Nutt. All rights reserved.
  5. # Author: Gregory Nutt <gnutt@nuttx.org>
  6. #
  7. # Redistribution and use in source and binary forms, with or without
  8. # modification, are permitted provided that the following conditions
  9. # are met:
  10. #
  11. # 1. Redistributions of source code must retain the above copyright
  12. # notice, this list of conditions and the following disclaimer.
  13. # 2. Redistributions in binary form must reproduce the above copyright
  14. # notice, this list of conditions and the following disclaimer in
  15. # the documentation and/or other materials provided with the
  16. # distribution.
  17. # 3. Neither the name NuttX nor the names of its contributors may be
  18. # used to endorse or promote products derived from this software
  19. # without specific prior written permission.
  20. #
  21. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  24. # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  25. # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  26. # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  27. # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  28. # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  29. # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  30. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  31. # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  32. # POSSIBILITY OF SUCH DAMAGE.
  33. #
  34. ############################################################################
  35. -include $(TOPDIR)/Make.defs
  36. DELIM ?= $(strip /)
  37. ifeq ($(WINTOOL),y)
  38. INCDIROPT = -w
  39. endif
  40. DEPPATH = --dep-path .
  41. ASRCS =
  42. CSRCS =
  43. VPATH = .
  44. # Include support for various drivers. Each Make.defs file will add its
  45. # files to the source file list, add its DEPPATH info, and will add
  46. # the appropriate paths to the VPATH variable
  47. include analog$(DELIM)Make.defs
  48. include audio$(DELIM)Make.defs
  49. include bch$(DELIM)Make.defs
  50. include can$(DELIM)Make.defs
  51. include crypto$(DELIM)Make.defs
  52. include i2c$(DELIM)Make.defs
  53. include i2s$(DELIM)Make.defs
  54. include input$(DELIM)Make.defs
  55. include ioexpander$(DELIM)Make.defs
  56. include lcd$(DELIM)Make.defs
  57. include leds$(DELIM)Make.defs
  58. include loop$(DELIM)Make.defs
  59. include mmcsd$(DELIM)Make.defs
  60. include modem$(DELIM)Make.defs
  61. include mtd$(DELIM)Make.defs
  62. include eeprom$(DELIM)Make.defs
  63. include net$(DELIM)Make.defs
  64. include pipes$(DELIM)Make.defs
  65. include power$(DELIM)Make.defs
  66. include rptun$(DELIM)Make.defs
  67. include sensors$(DELIM)Make.defs
  68. include serial$(DELIM)Make.defs
  69. include spi$(DELIM)Make.defs
  70. include syslog$(DELIM)Make.defs
  71. include timers$(DELIM)Make.defs
  72. include usbdev$(DELIM)Make.defs
  73. include usbhost$(DELIM)Make.defs
  74. include usbmisc$(DELIM)Make.defs
  75. include usbmonitor$(DELIM)Make.defs
  76. include video$(DELIM)Make.defs
  77. include wireless$(DELIM)Make.defs
  78. include contactless$(DELIM)Make.defs
  79. include 1wire$(DELIM)Make.defs
  80. include rf$(DELIM)Make.defs
  81. ifeq ($(CONFIG_SPECIFIC_DRIVERS),y)
  82. include platform$(DELIM)Make.defs
  83. endif
  84. ifeq ($(CONFIG_DEV_SIMPLE_ADDRENV),y)
  85. CSRCS += addrenv.c
  86. endif
  87. CSRCS += dev_null.c dev_zero.c
  88. ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
  89. CSRCS += ramdisk.c
  90. ifeq ($(CONFIG_DRVR_MKRD),y)
  91. CSRCS += mkrd.c
  92. endif
  93. ifeq ($(CONFIG_DRVR_WRITEBUFFER),y)
  94. CSRCS += rwbuffer.c
  95. else
  96. ifeq ($(CONFIG_DRVR_READAHEAD),y)
  97. CSRCS += rwbuffer.c
  98. endif
  99. endif
  100. endif
  101. AOBJS = $(ASRCS:.S=$(OBJEXT))
  102. COBJS = $(CSRCS:.c=$(OBJEXT))
  103. SRCS = $(ASRCS) $(CSRCS)
  104. OBJS = $(AOBJS) $(COBJS)
  105. BIN = libdrivers$(LIBEXT)
  106. all: $(BIN)
  107. .PHONY: depend clean distclean
  108. $(AOBJS): %$(OBJEXT): %.S
  109. $(call ASSEMBLE, $<, $@)
  110. $(COBJS): %$(OBJEXT): %.c
  111. $(call COMPILE, $<, $@)
  112. $(BIN): $(OBJS)
  113. $(call ARCHIVE, $@, $(OBJS))
  114. .depend: Makefile $(SRCS)
  115. $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
  116. $(Q) touch $@
  117. depend: .depend
  118. clean:
  119. $(call DELFILE, $(BIN))
  120. $(call CLEAN)
  121. distclean: clean
  122. $(call DELFILE, Make.dep)
  123. $(call DELFILE, .depend)
  124. -include Make.dep