Skip to content

Commit 69cc851

Browse files
author
dmi3
committed
Updated makefile
1 parent 31e3666 commit 69cc851

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ As the example used embedded RISC-V.
88

99
Using Python GDB API allows to expand GDB opportunities.
1010
Python GDB API allows to create Python script for GDB. Also it is possible to implement custom GDB-commands. It can be used to automate work with GDB. [GDB doc: 23.2 Extending gdb using Python]
11-
12-
These ideas can be used for launch automation, test automation and other. Details in the Wiki.
11+
Submodule /modules/ contains custom GDB-commands and custom GDB-functions.
12+
These ideas can be used for launch automation, test automation and other.
13+
Details in the Wiki.
1314

1415
## Quick start
1516

makefile

+11-5
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ TARGET := $(notdir $(CURDIR))
1010
SRC_DIR := src
1111
BUILD_DIR := Debug
1212

13-
SRC_CPP := $(wildcard $(SRC_DIR)/*.cpp)
14-
SRC_ASM := $(wildcard $(SRC_DIR)/*.asm)
15-
SRC_S := $(wildcard $(SRC_DIR)/*.S)
13+
14+
SRC_CPP := $(foreach DIR, $(SRC_DIR), $(wildcard $(DIR)/*.cpp))
15+
SRC_ASM := $(foreach DIR, $(SRC_DIR), $(wildcard $(DIR)/*.asm))
16+
SRC_S := $(foreach DIR, $(SRC_DIR), $(wildcard $(DIR)/*.S))
1617

1718
OBJECTS := $(addprefix $(BUILD_DIR)/, $(SRC_CPP:.cpp=.o)) \
1819
$(addprefix $(BUILD_DIR)/, $(SRC_ASM:.asm=.o)) \
@@ -27,6 +28,11 @@ CXXFLAGS = -march=rv64g -msmall-data-limit=8 -O0 -fmessage-length=0 \
2728
-fno-exceptions -fno-rtti -fno-use-cxa-atexit -fno-threadsafe-statics -fno-unwind-tables \
2829
-MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
2930

31+
ASFLAGS = -march=rv64g -msmall-data-limit=8 -O0 -fmessage-length=0 \
32+
-fsigned-char -ffunction-sections -fdata-sections -g3 \
33+
-x assembler-with-cpp \
34+
-MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
35+
3036
LDFLAGS := -march=rv64g -msmall-data-limit=8 -O0 -fmessage-length=0 \
3137
-fsigned-char -ffunction-sections -fdata-sections -g3 \
3238
-T"src/link.ld" -nostartfiles \
@@ -67,13 +73,13 @@ $(BUILD_DIR)/%.o: %.cpp
6773
$(BUILD_DIR)/%.o: %.S
6874
@echo Building file: "$@"
6975
@mkdir -p $(dir $@)
70-
$(CXX) $(CXXFLAGS)
76+
$(CXX) $(ASFLAGS)
7177
@echo ""
7278

7379
$(BUILD_DIR)/%.o: %.asm
7480
@echo Building file: "$@"
7581
@mkdir -p $(dir $@)
76-
$(CXX) $(CXXFLAGS)
82+
$(CXX) $(ASFLAGS)
7783
@echo ""
7884

7985
#Include .d files for existing .o files

0 commit comments

Comments
 (0)