From cab382db088d9f240253466a1c5a26c62f3967c8 Mon Sep 17 00:00:00 2001 From: justanothercatgirl Date: Sat, 8 Feb 2025 22:13:52 +0300 Subject: Implemented multiplexing in main thread (TCP loop). Removed CMake files. TODO: Implement multiplexing in worker threads (UDP loops), implement channel_pool interface. --- Makefile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 346f1f4..6db2190 100644 --- a/Makefile +++ b/Makefile @@ -8,18 +8,20 @@ CLINKS += -lc -lpthread # Where to build stuff BLDDIR ?= build TSTDIR ?= $(BLDDIR)/tests +# Library files +LIBFS = include/c_headers/include/container.h include/c_headers/include/rstypes.h -# This variable's value is NOT checked, only it's existence is checked. -# If you define it as `DEBUG = Off`, it will still build in debug mode -DEBUG = On +# TODO: remove in production build +DEBUG ?= 1 -ifdef $(DEBUG) - CFLAGS += -DDBG -ggdb -g +ifeq ($(DEBUG), 1) + CFLAGS += -DDBG -DLOG_DEBUG -ggdb -g endif .PHONY: clean all tests run_tests all: $(BLDDIR) $(BLDDIR)/server $(BLDDIR)/client tests + @echo DEBUG=$(DEBUG), CFLAGS=$(CFLAGS) $(BLDDIR): mkdir -p $(BLDDIR) @@ -32,15 +34,15 @@ $(BLDDIR)/packet.o: include/packet.c $(CC) -c $< $(CFLAGS) $(CLIBS) -o $@ # Server object files -$(BLDDIR)/s_%.o: server/%.c +$(BLDDIR)/s_%.o: server/%.c $(LIBFS) $(CC) -c $< $(CFLAGS) $(CLIBS) -o $@ # client object files -$(BLDDIR)/c_%.o: client/%.c +$(BLDDIR)/c_%.o: client/%.c $(LIBFS) $(CC) -c $< $(CFLAGS) $(CLIBS) -o $@ # test object files -$(TSTDIR)/%.o: test/%.c +$(TSTDIR)/%.o: test/%.c $(LIBFS) $(CC) -c $< $(CFLAGS) $(CLIBS) -o $@ # server executable -- cgit v1.2.3-70-g09d2