Makefile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # Copyright (c) 2009 Openmoko Inc.
  2. #
  3. # This program is free software: you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation, either version 3 of the License, or
  6. # (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. # +++START_UPDATE_MAKEFILE: Start of auto included code
  16. # The text between the +++ and --- tags is copied by the
  17. # UpdateMakefiles script. Do not remove or change these tags.
  18. # ---
  19. # Autodetect root directory
  20. define FIND_ROOT_DIR
  21. while : ; do \
  22. d=$$(pwd) ; \
  23. [ -d "$${d}/samo-lib" ] && echo $${d} && exit 0 ; \
  24. [ X"/" = X"$${d}" ] && echo ROOT_DIRECTORY_NOT_FOUND && exit 1 ; \
  25. cd .. ; \
  26. done
  27. endef
  28. ROOT_DIR := $(shell ${FIND_ROOT_DIR})
  29. # Directory of Makefile includes
  30. MK_DIR := ${ROOT_DIR}/samo-lib/Mk
  31. # Include the initial Makefile setup
  32. include ${MK_DIR}/definitions.mk
  33. # ---END_UPDATE_MAKEFILE: End of auto included code
  34. INCLUDES += -I${DRIVERS_INCLUDE}
  35. INCLUDES += -I${FATFS_INCLUDE} -I${FATFS_CONFIG_INCLUDE}
  36. INCLUDES += -I${MINI_LIBC_INCLUDE}
  37. INCLUDES += -I${SAMO_LIB_INCLUDE}
  38. BUILD_PREFIX := build/
  39. vpath %.c :src
  40. TARGETS = lib/libdrivers.a
  41. # list of library modules
  42. OBJECTS += analog.o
  43. OBJECTS += button.o
  44. OBJECTS += console.o
  45. OBJECTS += ctp.o
  46. OBJECTS += contrast.o
  47. OBJECTS += delay_us.o
  48. OBJECTS += delay_nop.o
  49. OBJECTS += elf32.o
  50. OBJECTS += FLASH.o
  51. OBJECTS += lcd.o
  52. OBJECTS += mmc.o
  53. OBJECTS += print.o
  54. #OBJECTS += sd_spi.o
  55. #OBJECTS += sd_api.o
  56. OBJECTS += SPI.o
  57. OBJECTS += suspend.o
  58. OBJECTS += temperature.o
  59. OBJECTS += tick.o
  60. BUILD_OBJECTS = $(addprefix ${BUILD_PREFIX},${OBJECTS})
  61. .PHONY: all
  62. all: ${TARGETS}
  63. lib/libdrivers.a: lib build ${BUILD_OBJECTS}
  64. ${RM} "$@"
  65. ${AR} r "$@" ${BUILD_OBJECTS}
  66. lib:
  67. ${MKDIR} "$@"
  68. build:
  69. ${MKDIR} "$@"
  70. clean:
  71. $(RM) -r build lib
  72. ${RM} *~ *.o *.d *.lst *.elf *.map *.asm33
  73. include ${MK_DIR}/rules.mk