Debian Codegraph @

src/gdb_test_program/Makefile

raw symbols SCIP
1 # pyOCD debugger
2 # Copyright (c) 2018 Arm Limited
3 # SPDX-License-Identifier: Apache-2.0
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16
17 PREFIX = arm-none-eabi-
18 CC = $(PREFIX)gcc
19 OBJCOPY = $(PREFIX)objcopy
20
21 TARGET = gdb_test.elf
22 TARGET_BIN = gdb_test.bin
23
24 OBJECTS = main.o
25
26 LIBRARIES =
27
28 INCLUDES =
29
30 CFLAGS = -std=gnu11 -MMD -MP $(INCLUDES) -O0 -fno-common -ffunction-sections \
31 -fdata-sections -Wall -Werror -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -g3 -gdwarf-2 \
32 -gstrict-dwarf -nostdlib -fpie
33
34 LDFLAGS = -T"linker_script.ld" -Wl,-Map,gdb_test.map,--gc-sections,-emain -nostdlib -fpie
35
36 .PHONY: all
37 all: $(TARGET) $(TARGET_BIN)
38
39 .PHONY: clean
40 clean:
41 # @echo "Cleaning output..."
42 rm -f *.o *.d $(TARGET) $(TARGET_BIN)
43
44 $(TARGET): $(OBJECTS)
45 $(CC) $(LDFLAGS) $(OBJECTS) $(LIBRARIES) -o $@
46
47 $(TARGET_BIN): $(TARGET)
48 $(OBJCOPY) -O binary $(TARGET) $(TARGET_BIN)
49
50 # Include dependency files.
51 -include $(OBJECTS:.o=.d)