aboutsummaryrefslogtreecommitdiffhomepage
path: root/content/2023-09-01-cas-llsc-aba/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'content/2023-09-01-cas-llsc-aba/Makefile')
-rw-r--r--content/2023-09-01-cas-llsc-aba/Makefile37
1 files changed, 37 insertions, 0 deletions
diff --git a/content/2023-09-01-cas-llsc-aba/Makefile b/content/2023-09-01-cas-llsc-aba/Makefile
new file mode 100644
index 0000000..602418f
--- /dev/null
+++ b/content/2023-09-01-cas-llsc-aba/Makefile
@@ -0,0 +1,37 @@
+BINS = cas-aba-issue cas-ptr-generation a64-basic-llsc a64-llsc
+
+CFLAGS_cas-ptr-generation = -mcx16
+CFLAGS = -g -O3 -Wall -Wextra $(CFLAGS_$(*))
+
+A64_SYSROOT = /usr/aarch64-linux-gnu
+
+run: $(BINS:%=run-%)
+build: $(BINS:%=%.elf)
+
+# -- HOST NATIVE TARGETS -------------------------------------------------------
+
+run-%: %.elf
+ ./$^
+
+%.elf : %.cc
+ $(CXX) $(CFLAGS) -o $@ $^ -latomic
+
+disasm: cas-ptr-generation.elf
+ objdump -C -d -j .text -M intel --no-show-raw-insn --visualize-jumps=color $^ | less -R
+
+# -- ARM64 CROSS TARGETS -------------------------------------------------------
+
+a64-%.elf: a64-%.cc
+ clang++ $(CFLAGS) -target aarch64-linux-gnu --sysroot=$(A64_SYSROOT) -fuse-ld=lld -o $@ $^
+ #llvm-objdump -j .text -C -d $@
+
+run-a64-%: a64-%.elf
+ qemu-aarch64 -L $(A64_SYSROOT) -E LD_LIBRARY_PATH=$(A64_SYSROOT)/lib64 $^
+
+# -- MISC TARGETS --------------------------------------------------------------
+
+fmt:
+ clang-format -i *.cc
+
+clean:
+ $(RM) *.elf