Rev 2 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2 | Rev 3 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ########################################################################################################################## |
1 | ########################################################################################################################## |
2 | # File automatically-generated by tool: [projectgenerator] version: [3.16.0] date: [Sun Apr 30 17:33:50 BST 2023] |
2 | # File automatically-generated by tool: [projectgenerator] version: [4.2.0-B44] date: [Sun Jan 21 11:27:08 GMT 2024] |
3 | ########################################################################################################################## |
3 | ########################################################################################################################## |
4 | 4 | ||
5 | # ------------------------------------------------ |
5 | # ------------------------------------------------ |
6 | # Generic Makefile (based on gcc) |
6 | # Generic Makefile (based on gcc) |
7 | # |
7 | # |
Line 52... | Line 52... | ||
52 | Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c \ |
52 | Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c \ |
53 | Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c \ |
53 | Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c \ |
54 | Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c \ |
54 | Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c \ |
55 | Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c \ |
55 | Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c \ |
56 | Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c \ |
56 | Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c \ |
57 | Core/Src/system_stm32f1xx.c |
57 | Core/Src/system_stm32f1xx.c \ |
- | 58 | Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c |
|
58 | 59 | ||
59 | # ASM sources |
60 | # ASM sources |
60 | ASM_SOURCES = \ |
61 | ASM_SOURCES = \ |
61 | startup_stm32f103x6.s |
62 | startup_stm32f103xb.s |
62 | 63 | ||
- | 64 | # User added C sources |
|
63 | C_SOURCES += \ |
65 | C_SOURCES += \ |
64 | Core/Src/base64.c |
66 | Core/Src/base64.c |
65 | 67 | ||
- | 68 | # User added Cpp sources |
|
- | 69 | CPP_SOURCES +=\ |
|
- | 70 | Core/Src/display.cpp |
|
66 | 71 | ||
67 | ####################################### |
72 | ####################################### |
68 | # binaries |
73 | # binaries |
69 | ####################################### |
74 | ####################################### |
70 | PREFIX = arm-none-eabi- |
75 | PREFIX = arm-none-eabi- |
Line 73... | Line 78... | ||
73 | ifdef GCC_PATH |
78 | ifdef GCC_PATH |
74 | CC = $(GCC_PATH)/$(PREFIX)gcc |
79 | CC = $(GCC_PATH)/$(PREFIX)gcc |
75 | AS = $(GCC_PATH)/$(PREFIX)gcc -x assembler-with-cpp |
80 | AS = $(GCC_PATH)/$(PREFIX)gcc -x assembler-with-cpp |
76 | CP = $(GCC_PATH)/$(PREFIX)objcopy |
81 | CP = $(GCC_PATH)/$(PREFIX)objcopy |
77 | SZ = $(GCC_PATH)/$(PREFIX)size |
82 | SZ = $(GCC_PATH)/$(PREFIX)size |
- | 83 | ## User added |
|
- | 84 | CXX = $(GCC_PATH)/$(PREFIX)g++ |
|
78 | else |
85 | else |
79 | CC = $(PREFIX)gcc |
86 | CC = $(PREFIX)gcc |
80 | AS = $(PREFIX)gcc -x assembler-with-cpp |
87 | AS = $(PREFIX)gcc -x assembler-with-cpp |
81 | CP = $(PREFIX)objcopy |
88 | CP = $(PREFIX)objcopy |
82 | SZ = $(PREFIX)size |
89 | SZ = $(PREFIX)size |
- | 90 | ## User Added |
|
- | 91 | CXX = $(PREFIX)g++ |
|
83 | endif |
92 | endif |
84 | HEX = $(CP) -O ihex |
93 | HEX = $(CP) -O ihex |
85 | BIN = $(CP) -O binary -S |
94 | BIN = $(CP) -O binary -S |
86 | 95 | ||
87 | ####################################### |
96 | ####################################### |
Line 124... | Line 133... | ||
124 | # Add serial driver |
133 | # Add serial driver |
125 | C_DEFS+=-DSERIAL_UART1 |
134 | C_DEFS+=-DSERIAL_UART1 |
126 | LIBSERIAL = ../libSerial |
135 | LIBSERIAL = ../libSerial |
127 | include $(LIBSERIAL)/libSerial.mk |
136 | include $(LIBSERIAL)/libSerial.mk |
128 | 137 | ||
129 | # Add small printf libtrary |
138 | # Add small printf library |
130 | LIBSMALLPRINTF = ../libSmallPrintf |
139 | LIBSMALLPRINTF = ../libSmallPrintf |
131 | include $(LIBSMALLPRINTF)/libSmallPrintf.mk |
140 | include $(LIBSMALLPRINTF)/libSmallPrintf.mk |
- | 141 | ||
- | 142 | # Add OLED SPI display library |
|
- | 143 | # New OLED library |
|
- | 144 | HAL = stm32_hal |
|
- | 145 | LIBOLED = ../libOLED |
|
- | 146 | include $(LIBOLED)/libOLED.mk |
|
- | 147 | ||
132 | ################################################################ |
148 | ################################################################ |
133 | 149 | ||
134 | 150 | ||
135 | # compile gcc flags |
151 | # compile gcc flags |
136 | ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections |
152 | ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections |
Line 140... | Line 156... | ||
140 | ifeq ($(DEBUG), 1) |
156 | ifeq ($(DEBUG), 1) |
141 | CFLAGS += -g -gdwarf-2 |
157 | CFLAGS += -g -gdwarf-2 |
142 | endif |
158 | endif |
143 | 159 | ||
144 | 160 | ||
- | 161 | ## User added |
|
- | 162 | CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions |
|
- | 163 | ||
- | 164 | ||
145 | # Generate dependency information |
165 | # Generate dependency information |
146 | CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" |
166 | CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" |
147 | 167 | ||
148 | 168 | ||
149 | ####################################### |
169 | ####################################### |
Line 168... | Line 188... | ||
168 | OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o))) |
188 | OBJECTS = $(addprefix $(BUILD_DIR)/,$(notdir $(C_SOURCES:.c=.o))) |
169 | vpath %.c $(sort $(dir $(C_SOURCES))) |
189 | vpath %.c $(sort $(dir $(C_SOURCES))) |
170 | # list of ASM program objects |
190 | # list of ASM program objects |
171 | OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o))) |
191 | OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASM_SOURCES:.s=.o))) |
172 | vpath %.s $(sort $(dir $(ASM_SOURCES))) |
192 | vpath %.s $(sort $(dir $(ASM_SOURCES))) |
- | 193 | ## User added List of C++ compiled objects |
|
- | 194 | OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(CPP_SOURCES:.cpp=.o))) |
|
- | 195 | vpath %.cpp $(sort $(dir $(CPP_SOURCES))) |
|
- | 196 | ||
- | 197 | ## User added C++ compilation rule |
|
- | 198 | $(BUILD_DIR)/%.o: %.cpp Makefile | $(BUILD_DIR) |
|
- | 199 | $(CXX) -c $(CXXFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@ |
|
173 | 200 | ||
174 | $(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) |
201 | $(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) |
175 | $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@ |
202 | $(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@ |
176 | 203 | ||
177 | $(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR) |
204 | $(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR) |
Line 192... | Line 219... | ||
192 | 219 | ||
193 | ####################################### |
220 | ####################################### |
194 | # clean up |
221 | # clean up |
195 | ####################################### |
222 | ####################################### |
196 | clean: |
223 | clean: |
- | 224 | pwd |
|
- | 225 | rm -Recurse -Force $(BUILD_DIR) |
|
197 | -rm -fR $(BUILD_DIR) |
226 | # -rm -fR $(BUILD_DIR) |
198 | 227 | ||
199 | ####################################### |
228 | ####################################### |
200 | # dependencies |
229 | # dependencies |
201 | ####################################### |
230 | ####################################### |
202 | -include $(wildcard $(BUILD_DIR)/*.d) |
231 | -include $(wildcard $(BUILD_DIR)/*.d) |