From 1efe617ae78e00e046a6eabfef264c480fee1d35 Mon Sep 17 00:00:00 2001 From: Aadi Desai <21363892+supleed2@users.noreply.github.com> Date: Fri, 12 May 2023 14:01:16 +0100 Subject: [PATCH] Update demo makefile to always use CXX --- demo.sh | 2 +- demo/Makefile | 6 ++---- demo/demo.py | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/demo.sh b/demo.sh index 5a5bbfb..1f1691d 100755 --- a/demo.sh +++ b/demo.sh @@ -1,6 +1,6 @@ #!/bin/bash set -e -python3 demo/demo.py --build-path build/gsd_orangecrab/ --with-cxx +python3 demo/demo.py --build-path build/gsd_orangecrab/ rm -f demo/*.o demo/*.d demo/demo.bin demo/demo.elf demo/demo.elf.map && echo "Cleaned up build artifacts" # rm -f /mnt/c/Users/suple/Desktop/dfu-util-0.9-win64/gsd.bin && echo "Deleted old Win11 BIN" # mv demo.bin /mnt/c/Users/suple/Desktop/dfu-util-0.9-win64/gsd.bin && echo "Moved new BIN to Win11 Desktop" diff --git a/demo/Makefile b/demo/Makefile index ed274d7..c525d44 100644 --- a/demo/Makefile +++ b/demo/Makefile @@ -4,10 +4,8 @@ include $(BUILD_DIR)/software/include/generated/variables.mak include $(SOC_DIRECTORY)/software/common.mak OBJECTS = donut.o helloc.o crt0.o main.o -ifdef WITH_CXX - OBJECTS += hellocpp.o leds.o audio.o - CFLAGS += -DWITH_CXX -endif +OBJECTS += hellocpp.o leds.o audio.o +CFLAGS += -DWITH_CXX all: demo.bin diff --git a/demo/demo.py b/demo/demo.py index 1eaeb0f..736fca6 100755 --- a/demo/demo.py +++ b/demo/demo.py @@ -15,7 +15,7 @@ from litex.build.tools import replace_in_file def main(): parser = argparse.ArgumentParser(description="LiteX Bare Metal Demo App.") parser.add_argument("--build-path", help="Target's build path (ex build/board_name).", required=True) - parser.add_argument("--with-cxx", action="store_true", help="Enable CXX support.") + # parser.add_argument("--with-cxx", action="store_true", help="Enable CXX support.") parser.add_argument("--mem", default="main_ram", help="Memory Region where code will be loaded/executed.") args = parser.parse_args() @@ -24,7 +24,7 @@ def main(): # Compile demo build_path = args.build_path if os.path.isabs(args.build_path) else os.path.join("..", args.build_path) - os.system(f"export BUILD_DIR={build_path} && {'export WITH_CXX=1 &&' if args.with_cxx else ''} cd demo && make") + os.system(f"export BUILD_DIR={build_path} && export WITH_CXX=1 && cd demo && make") # Copy demo.bin os.system("cp demo/demo.bin ./")