4444#
4545# NOTE:
4646# To use this Makefile on Windows, you will need the GNU make utility, which
47- # is included in the Qtools collection for Windows, see:
48- # https://sourceforge.net/projects/qpc/files/QTools/
49- #
47+ # is included in the QTools collection for Windows, see:
48+ # https://github.com/QuantumLeaps/qtools
5049
5150# -----------------------------------------------------------------------------
5251# project name
@@ -176,18 +175,19 @@ BIN := $(GNU_ARM)/bin/arm-none-eabi-objcopy
176175# #############################################################################
177176# Typically, you should not need to change anything below this line
178177
179- # basic utilities (included in Qtools for Windows), see:
180- # http ://sourceforge.net/projects/qpc/files/Qtools
178+ # basic utilities (included in QTools for Windows), see:
179+ # https ://www.state-machine.com/qtools
181180
182181MKDIR := mkdir
183182RM := rm
184183
185184# -----------------------------------------------------------------------------
186- # build options for various configurations for ARM Cortex-M4F
185+ # build options for various configurations for ARM Cortex-M
187186#
188187
189188# combine all the sources...
190- C_SRCS += $(QP_SRCS ) $(RTOS_SRCS )
189+ C_SRCS += $(QP_SRCS )
190+ C_SRCS += $(RTOS_SRCS )
191191ASM_SRCS += $(QP_ASMS )
192192
193193ifeq (rel, $(CONF ) ) # Release configuration ..................................
@@ -198,11 +198,11 @@ ASFLAGS = $(ARM_CPU) $(ARM_FPU) $(ASM_CPU) $(ASM_FPU)
198198
199199CFLAGS = -c $(ARM_CPU ) $(ARM_FPU ) $(FLOAT_ABI ) -mthumb -Wall \
200200 -ffunction-sections -fdata-sections \
201- -O1 $(INCLUDES ) $(DEFINES ) -DNDEBUG
201+ -O2 $(INCLUDES ) $(DEFINES ) -DNDEBUG
202202
203203CPPFLAGS = -c $(ARM_CPU ) $(ARM_FPU ) $(FLOAT_ABI ) -mthumb -Wall \
204204 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions \
205- -O1 $(INCLUDES ) $(DEFINES ) -DNDEBUG
205+ -O2 $(INCLUDES ) $(DEFINES ) -DNDEBUG
206206
207207else ifeq (spy, $(CONF)) # Spy configuration ................................
208208
@@ -241,7 +241,6 @@ LINKFLAGS = -T$(LD_SCRIPT) $(ARM_CPU) $(ARM_FPU) $(FLOAT_ABI) -mthumb \
241241 -specs=nosys.specs -specs=nano.specs \
242242 -Wl,-Map,$(BIN_DIR ) /$(OUTPUT ) .map,--cref,--gc-sections $(LIB_DIRS )
243243
244-
245244ASM_OBJS := $(patsubst % .s,% .o, $(notdir $(ASM_SRCS ) ) )
246245C_OBJS := $(patsubst % .c,% .o, $(notdir $(C_SRCS ) ) )
247246CPP_OBJS := $(patsubst % .cpp,% .o,$(notdir $(CPP_SRCS ) ) )
@@ -263,8 +262,14 @@ endif
263262# rules
264263#
265264
266- all : $(TARGET_BIN )
267- # all: $(TARGET_ELF)
265+ .PHONY : run norun flash
266+
267+ ifeq ($(MAKECMDGOALS ) ,norun)
268+ all : $(TARGET_BIN )
269+ norun : all
270+ else
271+ all : $(TARGET_BIN ) run
272+ endif
268273
269274$(TARGET_BIN ) : $(TARGET_ELF )
270275 $(BIN ) -O binary $< $@
@@ -288,6 +293,8 @@ $(BIN_DIR)/%.o : %.c
288293$(BIN_DIR ) /% .o : % .cpp
289294 $(CPP ) $(CPPFLAGS ) $< -o $@
290295
296+ .PHONY : clean show
297+
291298# include dependency files only if our goal depends on their existence
292299ifneq ($(MAKECMDGOALS ) ,clean)
293300 ifneq ($(MAKECMDGOALS),show)
@@ -296,7 +303,6 @@ ifneq ($(MAKECMDGOALS),clean)
296303endif
297304
298305
299- .PHONY : clean
300306clean :
301307 -$(RM ) $(BIN_DIR ) /* .o \
302308 $(BIN_DIR ) /* .d \
0 commit comments