Skip to content
This repository was archived by the owner on Apr 16, 2026. It is now read-only.

Commit 3067a5b

Browse files
committed
build: fix debug mode
1 parent ddebec6 commit 3067a5b

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
CC = ${CROSS_COMPILE}gcc
22
CXX = ${CROSS_COMPILE}g++
33

4-
DEBUG=n
5-
64
CXXFLAGS += $(CFLAGS) -std=c++20 -Wall -Wextra -Wno-unused-parameter
75
LDFLAGS += -lrt -lpthread
86

@@ -74,6 +72,8 @@ endif
7472
LIBWEBSOCKETS = ./3rdparty/install/include/
7573
VERSION_FILE = $(LIBIMP_INC_DIR)/version.hpp
7674

75+
STRIP_FLAG := $(if $(filter 0,$(DEBUG_STRIP)),,"-s")
76+
7777
$(VERSION_FILE): $(SRC_DIR)/version.tpl.hpp
7878
@if ! grep -q "$(commit_tag)" version.h > /dev/null 2>&1; then \
7979
echo "Updating version.h to $(commit_tag)"; \
@@ -84,13 +84,13 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(VERSION_FILE)
8484
@mkdir -p $(@D)
8585
$(CXX) $(CXXFLAGS) -I$(LIBIMP_INC_DIR) -I$(LIBWEBSOCKETS) -c $< -o $@
8686

87-
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(VERSION_FILE)
87+
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(VERSION_FILE)
8888
@mkdir -p $(@D)
8989
$(CC) $(CFLAGS) -I$(LIBIMP_INC_DIR) -I$(LIBWEBSOCKETS) -c $< -o $@
9090

9191
$(TARGET): $(OBJECTS) $(VERSION_FILE)
9292
@mkdir -p $(@D)
93-
$(CCACHE) $(CXX) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS) -s
93+
$(CCACHE) $(CXX) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS) $(STRIP_FLAG)
9494

9595
.PHONY: all clean
9696

buildroot_dev.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ while [[ $# -gt 0 ]]; do
137137
-d)
138138
DEBUG_MODE=1
139139
OPT_CMD="-O0 -g"
140+
DEBUG_STRIP_FLAG="DEBUG_STRIP=0"
140141
shift
141142
;;
142143
-c)
@@ -176,7 +177,7 @@ PLAT=$(sed -n 's/BR2_SOC_FAMILY_INGENIC_\([^=]*\)=.*/\1/p' "$CONFIG_FILE")
176177

177178
rm -rf 3rdparty
178179
make distclean
179-
time /usr/bin/make V=1 -j$(( $(nproc) + 1 )) \
180+
time /usr/bin/make V=1 -j$(( $(nproc) + 1 )) $DEBUG_STRIP_FLAG \
180181
ARCH= \
181182
CROSS_COMPILE="$CCACHE_BIN $HOME_DIR/output/$PROFILE_NAME/per-package/prudynt-t/host/bin/mipsel-linux-" \
182183
CFLAGS="-DPLATFORM_$PLAT $OPT_CMD -DBINARY_${BINARY_MODE^^} -DALLOW_RTSP_SERVER_PORT_REUSE=1 -DNO_OPENSSL=1 \

0 commit comments

Comments
 (0)