From 2cad8341019659a65fc6e94992165b3d7b7a37db Mon Sep 17 00:00:00 2001 From: johannst Date: Sun, 23 Mar 2025 23:51:01 +0000 Subject: deploy: 916b73bee95494c205ba67e4a50e6a525afc3a3c --- trace_profile/tracy/Makefile | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 trace_profile/tracy/Makefile (limited to 'trace_profile/tracy/Makefile') diff --git a/trace_profile/tracy/Makefile b/trace_profile/tracy/Makefile new file mode 100644 index 0000000..0d21426 --- /dev/null +++ b/trace_profile/tracy/Makefile @@ -0,0 +1,53 @@ +B := BUILD + +main: $(B)/main-static $(B)/main-dynamic $(B)/main-dynamic-win +tracy: $(B)/tracy +.PHONY: main tracy + +# -- TRACY STATIC --------------------------------------------------------------- + +$(B)/main-static: main.cpp | $(B) + clang++ -DTRACY_ENABLE -I$(B)/tracy/public -o $@ $^ $(B)/tracy/public/TracyClient.cpp + +# -- TRACY DYNAMIC -------------------------------------------------------------- + +$(B)/main-dynamic: main.cpp $(B)/foo.so $(B)/TracyClient.so | $(B) + clang++ -DTRACY_ENABLE -I$(B)/tracy/public -DUSE_FOO -o $@ $^ + +$(B)/foo.so: foo.c $(B)/TracyClient.so + clang -DTRACY_ENABLE -I$(B)/tracy/public -fPIC -shared -o $@ $^ + +$(B)/TracyClient.so: $(B)/tracy/public/TracyClient.cpp + clang++ -DTRACY_ENABLE -I$(B)/tracy/public -fPIC -shared -o $@ $^ + +# -- TRACY DYNAMIC WINDOWS ------------------------------------------------------ + +$(B)/main-dynamic-win: main.cpp $(B)/foo.dll $(B)/TracyClient.dll + @# eg run with wine + zig c++ -target x86_64-windows -DTRACY_ENABLE -DTRACY_IMPORTS -DUSE_FOO -o $@ $^ -I $(B)/tracy/public + +$(B)/foo.dll: foo.c $(B)/TracyClient.dll + zig c++ -target x86_64-windows -DTRACY_ENABLE -DTRACY_IMPORTS -fPIC -shared -o $@ $^ -I $(B)/tracy/public + +$(B)/TracyClient.dll: $(B)/tracy/public/TracyClient.cpp + @# win libs from 'pragma comment(lib, ..)' + zig c++ -target x86_64-windows -DTRACY_ENABLE -DTRACY_EXPORTS -fPIC -shared -o $@ $^ -lws2_32 -ldbghelp -ladvapi32 -luser32 + +# -- TRACY ---------------------------------------------------------------------- + +# Get latest tracy and build profiler. +$(B)/tracy: $(B) + cd $(B); bash $(CURDIR)/get-tracy.sh +.PHONY: $(B)/tracy + +$B: + mkdir -p $(B) +.PHONY: $(B) + +# -- CLEAN ---------------------------------------------------------------------- + +clean: + $(RM) $(B)/*.so $(B)/*.dll $(B)/*.pdb $(B)/*.lib $(B)/main* + +distclean: + rm -rf $(B) -- cgit v1.2.3