From 787ef64ce61302a159ad48974272533b6fdf6c9e Mon Sep 17 00:00:00 2001 From: justanothercatgirl Date: Mon, 24 Mar 2025 08:21:04 +0300 Subject: initial commit --- Makefile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..44869e6 --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +# Makefile + +all: main endpoints.so + +.PHONY: all clean + +endpoints.o: endpoints.c + $(CC) -c $< -o $@ + +rename.ld: endpoints.o + # Looks terrible + # All it does it generates renaming + echo SECTIONS { > $@ + @readelf --syms endpoints.o | awk '/FUNC/ && /GLOBAL/ {printf "\t%s = %s;\n", gensub(/_/, "/", "g", $$8), $$8;}' >> $@ + echo } >> $@ + +endpoints.so: endpoints.o rename.ld + $(CC) -shared -Wl,rename.ld $< -fPIE -o $@ + +main: main.c + $(CC) $< -ldl -lmicrohttpd -o $@ + +clean: + $(RM) main endpoints.o endpoints.so rename.ld -- cgit v1.2.3-70-g09d2