Makefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. ############################################################################
  2. # fs/Makefile
  3. #
  4. # Copyright (C) 2007, 2008, 2011-2014, 2016-2018 Gregory Nutt. All rights
  5. # reserved.
  6. # Author: Gregory Nutt <gnutt@nuttx.org>
  7. #
  8. # Redistribution and use in source and binary forms, with or without
  9. # modification, are permitted provided that the following conditions
  10. # are met:
  11. #
  12. # 1. Redistributions of source code must retain the above copyright
  13. # notice, this list of conditions and the following disclaimer.
  14. # 2. Redistributions in binary form must reproduce the above copyright
  15. # notice, this list of conditions and the following disclaimer in
  16. # the documentation and/or other materials provided with the
  17. # distribution.
  18. # 3. Neither the name NuttX nor the names of its contributors may be
  19. # used to endorse or promote products derived from this software
  20. # without specific prior written permission.
  21. #
  22. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  23. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  24. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  25. # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  26. # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  27. # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  28. # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  29. # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  30. # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  31. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  32. # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  33. # POSSIBILITY OF SUCH DAMAGE.
  34. #
  35. ############################################################################
  36. include $(TOPDIR)/Make.defs
  37. CSRCS = fs_initialize.c
  38. include inode/Make.defs
  39. include vfs/Make.defs
  40. include driver/Make.defs
  41. include dirent/Make.defs
  42. include aio/Make.defs
  43. include mmap/Make.defs
  44. # OS resources
  45. include semaphore/Make.defs
  46. include mqueue/Make.defs
  47. include shm/Make.defs
  48. # Additional files required is mount-able file systems are supported
  49. ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
  50. include mount/Make.defs
  51. include partition/Make.defs
  52. include fat/Make.defs
  53. include romfs/Make.defs
  54. include cromfs/Make.defs
  55. include tmpfs/Make.defs
  56. include nxffs/Make.defs
  57. include nfs/Make.defs
  58. include smartfs/Make.defs
  59. include binfs/Make.defs
  60. include procfs/Make.defs
  61. include spiffs/Make.defs
  62. include unionfs/Make.defs
  63. include userfs/Make.defs
  64. include hostfs/Make.defs
  65. include littlefs/Make.defs
  66. endif
  67. CFLAGS += ${shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)fs}
  68. AOBJS = $(ASRCS:.S=$(OBJEXT))
  69. COBJS = $(CSRCS:.c=$(OBJEXT))
  70. SRCS = $(ASRCS) $(CSRCS)
  71. OBJS = $(AOBJS) $(COBJS)
  72. BIN = libfs$(LIBEXT)
  73. all: $(BIN)
  74. .PHONY: depend clean distclean
  75. $(AOBJS): %$(OBJEXT): %.S
  76. $(call ASSEMBLE, $<, $@)
  77. $(COBJS): %$(OBJEXT): %.c
  78. $(call COMPILE, $<, $@)
  79. $(BIN): $(OBJS)
  80. $(call ARCHIVE, $@, $(OBJS))
  81. context::
  82. .depend: Makefile $(SRCS) $(TOPDIR)$(DELIM).config
  83. $(Q) $(MKDEP) $(DEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep
  84. $(Q) touch $@
  85. depend: .depend
  86. clean:
  87. $(call DELFILE, $(BIN))
  88. $(call CLEAN)
  89. distclean:: clean
  90. $(call DELFILE, Make.dep)
  91. $(call DELFILE, .depend)
  92. -include Make.dep