blob: a593d31637403929fdffce44db59dae4552de3fa [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
Jan Kiszka67f2f542018-10-02 09:28:00 +020015CFLAGS := -Wall -Werror -pedantic -std=c99 -D_GNU_SOURCE
Yann Gautierba46a932018-07-05 16:50:22 +020016ifeq (${DEBUG},1)
17 CFLAGS += -g -O0 -DDEBUG
18else
19 CFLAGS += -O2
20endif
21
22ifeq (${V},0)
23 Q := @
24else
25 Q :=
26endif
27
28CC := gcc
29
30.PHONY: all clean distclean
31
32all: ${PROJECT}
33
34${PROJECT}: ${OBJECTS} Makefile
35 @echo " LD $@"
36 ${Q}${CC} ${OBJECTS} -o $@
37 @${ECHO_BLANK_LINE}
38 @echo "Built $@ successfully"
39 @${ECHO_BLANK_LINE}
40
Jan Kiszka67f2f542018-10-02 09:28:00 +020041%.o: %.c Makefile
Yann Gautierba46a932018-07-05 16:50:22 +020042 @echo " CC $<"
43 ${Q}${CC} -c ${CFLAGS} $< -o $@
44
45clean:
46 $(call SHELL_DELETE_ALL, ${PROJECT} ${OBJECTS})
47
48distclean: clean