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.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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. #OBJS += $(BINARY).o
  78. ELMOASMFUNCTIONS = elmoasmfunctions.o
  79. #!!! PLEASE ADD YOUR SOURCES, HEADERS AND OBJECTS HERE !!!
  80. SOURCES = $(BINARY).c
  81. HEADERS =
  82. OBJECTS = $(BINARY).o
  83. ###############################################################################
  84. # C flags
  85. CFLAGS += -Os -g
  86. CFLAGS += -Wextra -Wshadow -Wimplicit-function-declaration
  87. CFLAGS += -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes
  88. CFLAGS += -fno-common -ffunction-sections -fdata-sections
  89. ###############################################################################
  90. # C & C++ preprocessor common flags
  91. CPPFLAGS += -MD
  92. CPPFLAGS += -Wall -Wundef
  93. ###############################################################################
  94. # Linker flags
  95. LDFLAGS += --static -nostartfiles
  96. LDFLAGS += -T$(LDSCRIPT)
  97. LDFLAGS += -Wl,-Map=$(*).map
  98. LDFLAGS += -Wl,--gc-sections
  99. ###############################################################################
  100. # Used libraries
  101. LDLIBS += -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group
  102. ###############################################################################
  103. ###############################################################################
  104. ###############################################################################
  105. all: elf bin list
  106. elf: $(BINARY).elf
  107. bin: $(BINARY).bin
  108. list: $(BINARY).list
  109. images: $(BINARY).images
  110. $(BINARY).images: $(BINARY).bin $(BINARY).list $(BINARY).map
  111. $(BINARY).bin: $(BINARY).elf
  112. $(Q)$(OBJCOPY) -Obinary $(BINARY).elf $(BINARY).bin
  113. $(BINARY).list: $(BINARY).elf
  114. $(Q)$(OBJDUMP) -S $(BINARY).elf > $(BINARY).list
  115. $(BINARY).elf $(BINARY).map: $(OBJS) $(LDSCRIPT)
  116. $(Q)$(LD) $(LDFLAGS) vector.o $(ARCH_FLAGS) $(OBJS) $(ELMOASMFUNCTIONS) $(LDLIBS) -o $(BINARY).elf
  117. %.o: %.c $(HEADER)
  118. $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) $(ARCH_FLAGS) -c -o $@ $<
  119. clean:
  120. $(Q)$(RM) $(OBJECTS) $(BINARY).d $(BINARY).elf $(BINARY).bin $(BINARY).list $(BINARY).map