From 7f3fab3aab6a4de059277330fa52049033f022fc Mon Sep 17 00:00:00 2001 From: Enrique Date: Mon, 6 Jan 2025 16:40:25 +0100 Subject: Initial commit --- Makefile | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100755 index 0000000..07ff46c --- /dev/null +++ b/Makefile @@ -0,0 +1,40 @@ +CC = cyg +CFLAGS = -O0 -Wall -ggdb3 +LDFLAGS = -lssl -lcrypto + +SRCDIR = src +OBJDIR = obj +ifeq ($(OS),Windows_NT) + LIBDIR = C:/Users/quique/Documents/Programming/libs + RUNCMD = server.exe +else + LIBDIR = /mnt/c/Users/quique/Documents/Programming/libs + RUNCMD = ./server.exe +endif + +OBJS = $(addprefix $(OBJDIR)/, bit.o str.o log.o list.o crc64.o dir.o net.o ipc.o) + +INCL = -I$(LIBDIR) -I$(SRCDIR) + + + +all: server.exe worker.exe + +server.exe: $(SRCDIR)/main.c $(OBJS) + $(CC) $< $(OBJS) $(INCL) $(CFLAGS) -o server.exe $(LDFLAGS) + +worker.exe: $(SRCDIR)/worker.c $(OBJS) + $(CC) $< $(OBJS) $(INCL) $(CFLAGS) -o worker.exe $(LDFLAGS) + +$(OBJDIR)/%.o: $(SRCDIR)/%/*.c $(SRCDIR)/%/*.h + $(CC) -c $(SRCDIR)/$*/$*.c $(INCL) $(CFLAGS) -o $(OBJDIR)/$*.o $(LDFLAGS) + +$(OBJDIR)/%.o: $(LIBDIR)/%/*.c $(LIBDIR)/%/*.h + $(CC) -c $(LIBDIR)/$*/$*.c $(INCL) $(CFLAGS) -o $(OBJDIR)/$*.o $(LDFLAGS) + +clean: + rm -f worker.exe server.exe $(OBJDIR)/*.o + +memcheck: + sudo valgrind --show-leak-kinds=all --leak-check=full --track-origins=yes --trace-children=yes -s $(RUNCMD) 443 + -- cgit v1.2.3