Development mbed library for MAX32630FTHR
Dependents: blinky_max32630fthr
tools/export/makefile/Makefile.tmpl@3:1198227e6421, 2016-12-16 (annotated)
- Committer:
- switches
- Date:
- Fri Dec 16 16:27:57 2016 +0000
- Revision:
- 3:1198227e6421
- Parent:
- 0:5c4d7b2438d3
Changed ADC scale for MAX32625 platforms to 1.2V full scale to match MAX32630 platforms
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
switches | 0:5c4d7b2438d3 | 1 | # This file was automagically generated by mbed.org. For more information, |
switches | 0:5c4d7b2438d3 | 2 | # see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded |
switches | 0:5c4d7b2438d3 | 3 | |
switches | 0:5c4d7b2438d3 | 4 | ############################################################################### |
switches | 0:5c4d7b2438d3 | 5 | # Boiler-plate |
switches | 0:5c4d7b2438d3 | 6 | |
switches | 0:5c4d7b2438d3 | 7 | # cross-platform directory manipulation |
switches | 0:5c4d7b2438d3 | 8 | ifeq ($(shell echo $$OS),$$OS) |
switches | 0:5c4d7b2438d3 | 9 | MAKEDIR = if not exist "$(1)" mkdir "$(1)" |
switches | 0:5c4d7b2438d3 | 10 | RM = rmdir /S /Q "$(1)" |
switches | 0:5c4d7b2438d3 | 11 | else |
switches | 0:5c4d7b2438d3 | 12 | MAKEDIR = '$(SHELL)' -c "mkdir -p \"$(1)\"" |
switches | 0:5c4d7b2438d3 | 13 | RM = '$(SHELL)' -c "rm -rf \"$(1)\"" |
switches | 0:5c4d7b2438d3 | 14 | endif |
switches | 0:5c4d7b2438d3 | 15 | |
switches | 0:5c4d7b2438d3 | 16 | # Move to the build directory |
switches | 0:5c4d7b2438d3 | 17 | ifeq (,$(filter .build,$(notdir $(CURDIR)))) |
switches | 0:5c4d7b2438d3 | 18 | .SUFFIXES: |
switches | 0:5c4d7b2438d3 | 19 | OBJDIR := .build |
switches | 0:5c4d7b2438d3 | 20 | mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) |
switches | 0:5c4d7b2438d3 | 21 | MAKETARGET = '$(MAKE)' --no-print-directory -C $(OBJDIR) -f '$(mkfile_path)' \ |
switches | 0:5c4d7b2438d3 | 22 | 'SRCDIR=$(CURDIR)' $(MAKECMDGOALS) |
switches | 0:5c4d7b2438d3 | 23 | .PHONY: $(OBJDIR) clean |
switches | 0:5c4d7b2438d3 | 24 | all: |
switches | 0:5c4d7b2438d3 | 25 | +@$(call MAKEDIR,$(OBJDIR)) |
switches | 0:5c4d7b2438d3 | 26 | +@$(MAKETARGET) |
switches | 0:5c4d7b2438d3 | 27 | $(OBJDIR): all |
switches | 0:5c4d7b2438d3 | 28 | Makefile : ; |
switches | 0:5c4d7b2438d3 | 29 | % :: $(OBJDIR) ; : |
switches | 0:5c4d7b2438d3 | 30 | clean : |
switches | 0:5c4d7b2438d3 | 31 | $(call RM,$(OBJDIR)) |
switches | 0:5c4d7b2438d3 | 32 | {% block target_clean -%} |
switches | 0:5c4d7b2438d3 | 33 | {% endblock %} |
switches | 0:5c4d7b2438d3 | 34 | else |
switches | 0:5c4d7b2438d3 | 35 | |
switches | 0:5c4d7b2438d3 | 36 | # trick rules into thinking we are in the root, when we are in the bulid dir |
switches | 0:5c4d7b2438d3 | 37 | VPATH = {{vpath|join(" ")}} |
switches | 0:5c4d7b2438d3 | 38 | |
switches | 0:5c4d7b2438d3 | 39 | # Boiler-plate |
switches | 0:5c4d7b2438d3 | 40 | ############################################################################### |
switches | 0:5c4d7b2438d3 | 41 | # Project settings |
switches | 0:5c4d7b2438d3 | 42 | |
switches | 0:5c4d7b2438d3 | 43 | PROJECT := {{name}} |
switches | 0:5c4d7b2438d3 | 44 | |
switches | 0:5c4d7b2438d3 | 45 | |
switches | 0:5c4d7b2438d3 | 46 | # Project settings |
switches | 0:5c4d7b2438d3 | 47 | ############################################################################### |
switches | 0:5c4d7b2438d3 | 48 | # Objects and Paths |
switches | 0:5c4d7b2438d3 | 49 | |
switches | 0:5c4d7b2438d3 | 50 | {% for obj in to_be_compiled %}OBJECTS += {{obj}} |
switches | 0:5c4d7b2438d3 | 51 | {% endfor %} |
switches | 0:5c4d7b2438d3 | 52 | {% for obj in object_files %} SYS_OBJECTS += {{obj}} |
switches | 0:5c4d7b2438d3 | 53 | {% endfor %} |
switches | 0:5c4d7b2438d3 | 54 | {% for path in include_paths %}INCLUDE_PATHS += -I{{path}} |
switches | 0:5c4d7b2438d3 | 55 | {% endfor %} |
switches | 0:5c4d7b2438d3 | 56 | LIBRARY_PATHS :={% for p in library_paths %} {{user_library_flag}}{{p}} {% endfor %} |
switches | 0:5c4d7b2438d3 | 57 | LIBRARIES :={% for lib in libraries %} {{lib}} {% endfor %} |
switches | 0:5c4d7b2438d3 | 58 | LINKER_SCRIPT := {{linker_script}} |
switches | 0:5c4d7b2438d3 | 59 | {%- block additional_variables -%}{% endblock %} |
switches | 0:5c4d7b2438d3 | 60 | |
switches | 0:5c4d7b2438d3 | 61 | # Objects and Paths |
switches | 0:5c4d7b2438d3 | 62 | ############################################################################### |
switches | 0:5c4d7b2438d3 | 63 | # Tools and Flags |
switches | 0:5c4d7b2438d3 | 64 | |
switches | 0:5c4d7b2438d3 | 65 | AS = {{asm_cmd}} |
switches | 0:5c4d7b2438d3 | 66 | CC = {{cc_cmd}} |
switches | 0:5c4d7b2438d3 | 67 | CPP = {{cppc_cmd}} |
switches | 0:5c4d7b2438d3 | 68 | LD = {{ld_cmd}} |
switches | 0:5c4d7b2438d3 | 69 | ELF2BIN = {{elf2bin_cmd}} |
switches | 0:5c4d7b2438d3 | 70 | {% if hex_files %} |
switches | 0:5c4d7b2438d3 | 71 | SREC_CAT = srec_cat |
switches | 0:5c4d7b2438d3 | 72 | {%- endif %} |
switches | 0:5c4d7b2438d3 | 73 | {%- block additional_executables -%}{%- endblock %} |
switches | 0:5c4d7b2438d3 | 74 | |
switches | 0:5c4d7b2438d3 | 75 | {% for flag in c_flags %}C_FLAGS += {{flag}} |
switches | 0:5c4d7b2438d3 | 76 | {% endfor %} |
switches | 0:5c4d7b2438d3 | 77 | {% for flag in cxx_flags %}CXX_FLAGS += {{flag}} |
switches | 0:5c4d7b2438d3 | 78 | {% endfor %} |
switches | 0:5c4d7b2438d3 | 79 | {% for flag in asm_flags %}ASM_FLAGS += {{flag}} |
switches | 0:5c4d7b2438d3 | 80 | {% endfor %} |
switches | 0:5c4d7b2438d3 | 81 | |
switches | 0:5c4d7b2438d3 | 82 | LD_FLAGS :={%- block ld_flags -%} {{ld_flags|join(" ")}} {% endblock %} |
switches | 0:5c4d7b2438d3 | 83 | {% block sys_libs -%}{%- endblock %} |
switches | 0:5c4d7b2438d3 | 84 | |
switches | 0:5c4d7b2438d3 | 85 | # Tools and Flags |
switches | 0:5c4d7b2438d3 | 86 | ############################################################################### |
switches | 0:5c4d7b2438d3 | 87 | # Rules |
switches | 0:5c4d7b2438d3 | 88 | |
switches | 0:5c4d7b2438d3 | 89 | .PHONY: all lst size |
switches | 0:5c4d7b2438d3 | 90 | |
switches | 0:5c4d7b2438d3 | 91 | {% if hex_files -%} |
switches | 0:5c4d7b2438d3 | 92 | all: $(PROJECT).bin $(PROJECT)-combined.hex size |
switches | 0:5c4d7b2438d3 | 93 | {% else %} |
switches | 0:5c4d7b2438d3 | 94 | all: $(PROJECT).bin $(PROJECT).hex size |
switches | 0:5c4d7b2438d3 | 95 | {% endif %} |
switches | 0:5c4d7b2438d3 | 96 | |
switches | 0:5c4d7b2438d3 | 97 | .asm.o: |
switches | 0:5c4d7b2438d3 | 98 | +@$(call MAKEDIR,$(dir $@)) |
switches | 0:5c4d7b2438d3 | 99 | +@echo "Assemble: $(notdir $<)" |
switches | 0:5c4d7b2438d3 | 100 | @$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $< |
switches | 0:5c4d7b2438d3 | 101 | |
switches | 0:5c4d7b2438d3 | 102 | .s.o: |
switches | 0:5c4d7b2438d3 | 103 | +@$(call MAKEDIR,$(dir $@)) |
switches | 0:5c4d7b2438d3 | 104 | +@echo "Assemble: $(notdir $<)" |
switches | 0:5c4d7b2438d3 | 105 | @$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $< |
switches | 0:5c4d7b2438d3 | 106 | |
switches | 0:5c4d7b2438d3 | 107 | .S.o: |
switches | 0:5c4d7b2438d3 | 108 | +@$(call MAKEDIR,$(dir $@)) |
switches | 0:5c4d7b2438d3 | 109 | +@echo "Assemble: $(notdir $<)" |
switches | 0:5c4d7b2438d3 | 110 | @$(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $< |
switches | 0:5c4d7b2438d3 | 111 | |
switches | 0:5c4d7b2438d3 | 112 | .c.o: |
switches | 0:5c4d7b2438d3 | 113 | +@$(call MAKEDIR,$(dir $@)) |
switches | 0:5c4d7b2438d3 | 114 | +@echo "Compile: $(notdir $<)" |
switches | 0:5c4d7b2438d3 | 115 | @$(CC) $(C_FLAGS) $(INCLUDE_PATHS) -o $@ $< |
switches | 0:5c4d7b2438d3 | 116 | |
switches | 0:5c4d7b2438d3 | 117 | .cpp.o: |
switches | 0:5c4d7b2438d3 | 118 | +@$(call MAKEDIR,$(dir $@)) |
switches | 0:5c4d7b2438d3 | 119 | +@echo "Compile: $(notdir $<)" |
switches | 0:5c4d7b2438d3 | 120 | @$(CPP) $(CXX_FLAGS) $(INCLUDE_PATHS) -o $@ $< |
switches | 0:5c4d7b2438d3 | 121 | |
switches | 0:5c4d7b2438d3 | 122 | {% block target_project_elf %} |
switches | 0:5c4d7b2438d3 | 123 | $(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS) $(LINKER_SCRIPT) |
switches | 0:5c4d7b2438d3 | 124 | +@echo "link: $(notdir $@)" |
switches | 0:5c4d7b2438d3 | 125 | @$(LD) $(LD_FLAGS) {{link_script_option}} $(filter %{{link_script_ext}}, $^) $(LIBRARY_PATHS) --output $@ $(filter %.o, $^) $(LIBRARIES) $(LD_SYS_LIBS) |
switches | 0:5c4d7b2438d3 | 126 | {% endblock %} |
switches | 0:5c4d7b2438d3 | 127 | |
switches | 0:5c4d7b2438d3 | 128 | $(PROJECT).bin: $(PROJECT).elf |
switches | 0:5c4d7b2438d3 | 129 | {%- block elf2bin -%}{%- endblock %} |
switches | 0:5c4d7b2438d3 | 130 | |
switches | 0:5c4d7b2438d3 | 131 | $(PROJECT).hex: $(PROJECT).elf |
switches | 0:5c4d7b2438d3 | 132 | {%- block elf2hex -%}{%- endblock %} |
switches | 0:5c4d7b2438d3 | 133 | |
switches | 0:5c4d7b2438d3 | 134 | {% if hex_files %} |
switches | 0:5c4d7b2438d3 | 135 | $(PROJECT)-combined.hex: $(PROJECT).hex |
switches | 0:5c4d7b2438d3 | 136 | +@echo "NOTE: the $(SREC_CAT) binary is required to be present in your PATH. Please see http://srecord.sourceforge.net/ for more information." |
switches | 0:5c4d7b2438d3 | 137 | $(SREC_CAT) {% for f in hex_files %}{{f}} {% endfor %} -intel $(PROJECT).hex -intel -o $(PROJECT)-combined.hex -intel --line-length=44 |
switches | 0:5c4d7b2438d3 | 138 | {% endif %} |
switches | 0:5c4d7b2438d3 | 139 | # Rules |
switches | 0:5c4d7b2438d3 | 140 | ############################################################################### |
switches | 0:5c4d7b2438d3 | 141 | # Dependencies |
switches | 0:5c4d7b2438d3 | 142 | |
switches | 0:5c4d7b2438d3 | 143 | DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d) |
switches | 0:5c4d7b2438d3 | 144 | -include $(DEPS) |
switches | 0:5c4d7b2438d3 | 145 | endif |
switches | 0:5c4d7b2438d3 | 146 | |
switches | 0:5c4d7b2438d3 | 147 | # Dependencies |
switches | 0:5c4d7b2438d3 | 148 | ############################################################################### |
switches | 0:5c4d7b2438d3 | 149 |