blob: 80dfbecf0620525b757db46d3fe464964cf2c80c [file] [log] [blame]
Yann Gautierba46a932018-07-05 16:50:22 +02001#
2# Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7MAKE_HELPERS_DIRECTORY := ../../make_helpers/
8include ${MAKE_HELPERS_DIRECTORY}build_macros.mk
9include ${MAKE_HELPERS_DIRECTORY}build_env.mk
10
11PROJECT := stm32image${BIN_EXT}
12OBJECTS := stm32image.o
13V := 0
14
15override CPPFLAGS += -D_GNU_SOURCE
16CFLAGS := -Wall -Werror -pedantic -std=c99
17ifeq (${DEBUG},1)
18 CFLAGS += -g -O0 -DDEBUG
19else
20 CFLAGS += -O2
21endif
22
23ifeq (${V},0)
24 Q := @
25else
26 Q :=
27endif
28
29CC := gcc
30
31.PHONY: all clean distclean
32
33all: ${PROJECT}
34
35${PROJECT}: ${OBJECTS} Makefile
36 @echo " LD $@"
37 ${Q}${CC} ${OBJECTS} -o $@
38 @${ECHO_BLANK_LINE}
39 @echo "Built $@ successfully"
40 @${ECHO_BLANK_LINE}
41
42%.o: %.c %.h Makefile
43 @echo " CC $<"
44 ${Q}${CC} -c ${CFLAGS} $< -o $@
45
46clean:
47 $(call SHELL_DELETE_ALL, ${PROJECT} ${OBJECTS})
48
49distclean: clean