Python-ELMO is a Python library which offers an encapsulation of the binary tool ELMO, in order to manipulate it easily in Python and SageMath script.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

Makefile 5.3KB

  1. ##
  2. ## University of Bristol – Open Access Software Licence
  3. ## Copyright (c) 2016, The University of Bristol, a chartered
  4. ## corporation having Royal Charter number RC000648 and a charity
  5. ## (number X1121) and its place of administration being at Senate
  6. ## House, Tyndall Avenue, Bristol, BS8 1TH, United Kingdom.
  7. ## All rights reserved
  8. ##
  9. ## Redistribution and use in source and binary forms, with or without
  10. ## modification, are permitted provided that the following conditions
  11. ## are met:
  12. ##
  13. ## 1. Redistributions of source code must retain the above copyright
  14. ## notice, this list of conditions and the following disclaimer.
  15. ##
  16. ## 2. Redistributions in binary form must reproduce the above
  17. ## copyright notice, this list of conditions and the following
  18. ## disclaimer in the documentation and/or other materials provided
  19. ## with the distribution.
  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 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  26. ## INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  27. ## (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  28. ## SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  29. ## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  30. ## STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  31. ## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  32. ## OF THE POSSIBILITY OF SUCH DAMAGE.
  33. ##
  34. ## Any use of the software for scientific publications or commercial
  35. ## purposes should be reported to the University of Bristol
  36. ## (OSI-notifications@bristol.ac.uk and quote reference 2668). This is
  37. ## for impact and usage monitoring purposes only.
  38. ##
  39. ## Enquiries about further applications and development opportunities
  40. ## are welcome. Please contact elisabeth.oswald@bristol.ac.uk
  41. ##
  42. ##
  43. ## This file was based on files that are part of the libopencm3 project.
  44. ## See below for licecning information.
  45. ##
  46. ## Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
  47. ## Copyright (C) 2010 Piotr Esden-Tempski <piotr@esden.net>
  48. ## Copyright (C) 2011 Fergus Noble <fergusnoble@gmail.com>
  49. ##
  50. ## This library is free software: you can redistribute it and/or modify
  51. ## it under the terms of the GNU Lesser General Public License as published by
  52. ## the Free Software Foundation, either version 3 of the License, or
  53. ## (at your option) any later version.
  54. ##
  55. ## This library is distributed in the hope that it will be useful,
  56. ## but WITHOUT ANY WARRANTY; without even the implied warranty of
  57. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  58. ## GNU Lesser General Public License for more details.
  59. ##
  60. ## You should have received a copy of the GNU Lesser General Public License
  61. ## along with this library. If not, see <http://www.gnu.org/licenses/>.
  62. # Remove to display makefile output
  63. Q := @
  64. BINARY = project
  65. FP_FLAGS ?= -msoft-float
  66. ARCH_FLAGS = -mthumb -mcpu=cortex-m0 $(FP_FLAGS)
  67. ###############################################################################
  68. # Executables
  69. PREFIX ?= arm-none-eabi
  70. CC := $(PREFIX)-gcc
  71. LD := $(PREFIX)-gcc
  72. OBJCOPY := $(PREFIX)-objcopy
  73. OBJDUMP := $(PREFIX)-objdump
  74. ###############################################################################
  75. # Source files
  76. LDSCRIPT = $(BINARY).ld
  77. ELMOASMFUNCTIONS = elmoasmfunctions.o
  78. #!!! PLEASE ADD YOUR SOURCES, HEADERS AND OBJECTS HERE !!!
  79. SOURCES = $(BINARY).c
  80. HEADERS =
  81. OBJECTS = $(BINARY).o
  82. ###############################################################################
  83. # C flags
  84. CFLAGS += -Os -g
  85. CFLAGS += -Wextra -Wshadow -Wimplicit-function-declaration
  86. CFLAGS += -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes
  87. CFLAGS += -fno-common -ffunction-sections -fdata-sections
  88. ###############################################################################
  89. # C & C++ preprocessor common flags
  90. CPPFLAGS += -MD
  91. CPPFLAGS += -Wall -Wundef
  92. ###############################################################################
  93. # Linker flags
  94. LDFLAGS += --static -nostartfiles
  95. LDFLAGS += -T$(LDSCRIPT)
  96. LDFLAGS += -Wl,-Map=$(*).map
  97. LDFLAGS += -Wl,--gc-sections
  98. ###############################################################################
  99. # Used libraries
  100. LDLIBS += -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group
  101. ###############################################################################
  102. ###############################################################################
  103. ###############################################################################
  104. all: elf bin list
  105. elf: $(BINARY).elf
  106. bin: $(BINARY).bin
  107. list: $(BINARY).list
  108. images: $(BINARY).images
  109. $(BINARY).images: $(BINARY).bin $(BINARY).list $(BINARY).map
  110. $(BINARY).bin: $(BINARY).elf
  111. $(Q)$(OBJCOPY) -Obinary $(BINARY).elf $(BINARY).bin
  112. $(BINARY).list: $(BINARY).elf
  113. $(Q)$(OBJDUMP) -S $(BINARY).elf > $(BINARY).list
  114. $(BINARY).elf $(BINARY).map: $(OBJECTS) $(LDSCRIPT)
  115. $(Q)$(LD) $(LDFLAGS) vector.o $(ARCH_FLAGS) $(OBJECTS) $(ELMOASMFUNCTIONS) $(LDLIBS) -o $(BINARY).elf
  116. %.o: %.c $(HEADER)
  117. $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) $(ARCH_FLAGS) -c -o $@ $<
  118. clean:
  119. $(Q)$(RM) $(OBJECTS) $(BINARY).d $(BINARY).elf $(BINARY).bin $(BINARY).list $(BINARY).map