Update demo makefile to always use CXX

This commit is contained in:
Aadi Desai 2023-05-12 14:01:16 +01:00
parent 5b66d01ac6
commit 1efe617ae7
No known key found for this signature in database
3 changed files with 5 additions and 7 deletions

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -e 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 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" # 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" # mv demo.bin /mnt/c/Users/suple/Desktop/dfu-util-0.9-win64/gsd.bin && echo "Moved new BIN to Win11 Desktop"

View file

@ -4,10 +4,8 @@ include $(BUILD_DIR)/software/include/generated/variables.mak
include $(SOC_DIRECTORY)/software/common.mak include $(SOC_DIRECTORY)/software/common.mak
OBJECTS = donut.o helloc.o crt0.o main.o OBJECTS = donut.o helloc.o crt0.o main.o
ifdef WITH_CXX OBJECTS += hellocpp.o leds.o audio.o
OBJECTS += hellocpp.o leds.o audio.o CFLAGS += -DWITH_CXX
CFLAGS += -DWITH_CXX
endif
all: demo.bin all: demo.bin

View file

@ -15,7 +15,7 @@ from litex.build.tools import replace_in_file
def main(): def main():
parser = argparse.ArgumentParser(description="LiteX Bare Metal Demo App.") 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("--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.") parser.add_argument("--mem", default="main_ram", help="Memory Region where code will be loaded/executed.")
args = parser.parse_args() args = parser.parse_args()
@ -24,7 +24,7 @@ def main():
# Compile demo # Compile demo
build_path = args.build_path if os.path.isabs(args.build_path) else os.path.join("..", args.build_path) 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 # Copy demo.bin
os.system("cp demo/demo.bin ./") os.system("cp demo/demo.bin ./")