Remove compilation artifacts

This commit is contained in:
2025-07-20 21:25:06 +02:00
parent 3201eac013
commit 1c6c0a75cf
7 changed files with 18 additions and 7 deletions
+18 -7
View File
@@ -6,9 +6,20 @@ LFLAGS = -lssl -lcrypto
CFILES = $(shell find src -name "*.c") CFILES = $(shell find src -name "*.c")
HFILES = $(shell find src -name "*.h") HFILES = $(shell find src -name "*.h")
EXAMPLES_CLIENT := $(basename $(shell ls examples/client/*.c 2>/dev/null)) # Detect OS and set executable extension
EXAMPLES_SERVER := $(basename $(shell ls examples/server/*.c 2>/dev/null)) ifeq ($(OS),Windows_NT)
EXAMPLES_ENGINE := $(basename $(shell ls examples/engine/*.c 2>/dev/null)) EXT = .exe
else
EXT = .out
endif
EXAMPLES_CLIENT_SRC := $(shell ls examples/client/*.c 2>/dev/null)
EXAMPLES_SERVER_SRC := $(shell ls examples/server/*.c 2>/dev/null)
EXAMPLES_ENGINE_SRC := $(shell ls examples/engine/*.c 2>/dev/null)
EXAMPLES_CLIENT := $(patsubst %.c,%$(EXT),$(EXAMPLES_CLIENT_SRC))
EXAMPLES_SERVER := $(patsubst %.c,%$(EXT),$(EXAMPLES_SERVER_SRC))
EXAMPLES_ENGINE := $(patsubst %.c,%$(EXT),$(EXAMPLES_ENGINE_SRC))
all: chttp.c chttp.h examples all: chttp.c chttp.h examples
@@ -17,15 +28,15 @@ chttp.c chttp.h: $(HFILES) $(CFILES)
examples: $(EXAMPLES_CLIENT) $(EXAMPLES_SERVER) $(EXAMPLES_ENGINE) examples: $(EXAMPLES_CLIENT) $(EXAMPLES_SERVER) $(EXAMPLES_ENGINE)
examples/client/%: examples/client/%.c chttp.c chttp.h examples/client/%$(EXT): examples/client/%.c chttp.c chttp.h
$(CC) $(CFLAGS) $< chttp.c -o $@ $(LFLAGS) $(CC) $(CFLAGS) $< chttp.c -o $@ $(LFLAGS)
examples/server/%: examples/server/%.c chttp.c chttp.h examples/server/%$(EXT): examples/server/%.c chttp.c chttp.h
$(CC) $(CFLAGS) $< chttp.c -o $@ $(LFLAGS) $(CC) $(CFLAGS) $< chttp.c -o $@ $(LFLAGS)
examples/engine/%: examples/engine/%.c chttp.c chttp.h examples/engine/%$(EXT): examples/engine/%.c chttp.c chttp.h
$(CC) $(CFLAGS) $< chttp.c -o $@ $(LFLAGS) $(CC) $(CFLAGS) $< chttp.c -o $@ $(LFLAGS)
clean: clean:
rm -f client_example server_example rm -f client_example server_example
rm -f examples/client/* examples/server/* examples/engine/* rm -f examples/client/*$(EXT) examples/server/*$(EXT) examples/engine/*$(EXT)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.