From 406436d2c42f4435c8390b78cfca036b67543385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20B=C3=A9rub=C3=A9?= Date: Wed, 22 May 2024 06:39:33 -0400 Subject: [PATCH] Some changes to the compilation process - -rdynamic flag is required to fulfilled missing symbols - Makefile is located inside the src directory --- Makefile | 4 ---- build.sh | 6 +++--- src/Makefile | 16 +++------------- 3 files changed, 6 insertions(+), 20 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index caa8fad..0000000 --- a/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -SRC := $(shell find src -name *.c) - -divinus: - $(CC) $(SRC) $(OPT) -I src -o $@ diff --git a/build.sh b/build.sh index 6731eb2..81e6251 100755 --- a/build.sh +++ b/build.sh @@ -19,13 +19,13 @@ fi if [ "$1" = "divinus-musl" ]; then toolchain cortex_a7_thumb2-gcc13-musl-4_9 - make -B CC=$GCC OPT="$OPT" + make -C src -B CC=$GCC OPT="$OPT" elif [ "$1" = "divinus-muslhf" ]; then toolchain cortex_a7_thumb2_hf-gcc13-musl-4_9 - make -B CC=$GCC OPT="$OPT" + make -C src -B CC=$GCC OPT="$OPT" elif [ "$1" = "divinus-glibc" ]; then toolchain cortex_a7_thumb2_hf-gcc13-glibc-4_9 - make -B CC=$GCC OPT="$OPT -lm" + make -C src -B CC=$GCC OPT="$OPT -lm" else echo "Usage: $0 [divinus-musl|divinus-muslhf|divinus-glibc]" exit 1 diff --git a/src/Makefile b/src/Makefile index 4c46524..704a39a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,14 +1,4 @@ -SRCS := hal/hisi/*_hal.c hal/sstar/*_hal.c hal/config.c hal/support.c hal/tools.c\ - mp4/bitbuf.c mp4/moof.c mp4/moov.c mp4/mp4.c mp4/nal.c\ - rtsp/ringfifo.c rtsp/rtputils.c rtsp/rtspservice.c rtsp/rtsputils.c\ - app_config.c compat.c error.c gpio.c http_post.c jpeg.c main.c night.c server.c video.c -BUILD = $(CC) $(SRCS) -I. -ldl -lm -lpthread -rdynamic $(OPT) -o ../$(or $(TARGET),$@) +SRC := $(shell find ./ -name '*.c') -divinus-musl: - $(BUILD) - -divinus-muslhf: - $(BUILD) - -divinus-glibc: - $(BUILD) \ No newline at end of file +divinus: + $(CC) $(SRC) -I src -rdynamic $(OPT) -o ../$@ \ No newline at end of file