From 048c106ca08b136443f2265922d15cfc8dd1495b Mon Sep 17 00:00:00 2001 From: johannst Date: Tue, 29 Sep 2020 20:55:25 +0200 Subject: add own demo1 run target + replace use make variables --- Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index b725812..289a6c7 100644 --- a/Makefile +++ b/Makefile @@ -20,26 +20,28 @@ fmt: example/demo1: example/demo1.o lib/libmatcha.a $(CXX) -o $@ $^ $(LDFLAGS) + +demo1: example/demo1 ifeq ($(ARCH),arm64) qemu-aarch64 \ -L /usr/aarch64-linux-gnu \ -E LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib \ - example/demo1 + $< else - example/demo1 + $< endif -gdb: example/demo1 +demo1-gdb: example/demo1 ifeq ($(ARCH),arm64) qemu-aarch64 \ -L /usr/aarch64-linux-gnu \ -E LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib \ -g 1234 \ - example/demo1 & - gdb-multiarch -ex 'target remote :1234' -ex 'b main' -ex 'c' example/demo1 + $< & + gdb-multiarch -ex 'target remote :1234' -ex 'b main' -ex 'c' $< else - which cgdb && cgdb -x util.gdb -ex 'start' example/demo1 \ - || gdb -x util.gdb -ex 'start' example/demo1 + which cgdb && cgdb --ex 'start' $< \ + || gdb --ex 'start' $< endif docker: docker/Dockerfile @@ -48,7 +50,6 @@ docker: docker/Dockerfile docker run -it --rm -v $(PWD):/develop $(IMG):latest .PHONY: docker - clean: make -C lib clean rm -f example/demo1 example/demo1.o -- cgit v1.2.3