From: Art Cancro Date: Tue, 4 Jul 2023 20:27:56 +0000 (-0900) Subject: webcit-ng/Makefile: made it awesomer X-Git-Tag: v981~49 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=624928ab39adeb10a7972210297689c79b5e20db;p=citadel.git webcit-ng/Makefile: made it awesomer --- diff --git a/webcit-ng/Makefile b/webcit-ng/Makefile index 7c2980cb2..7b9e2c299 100644 --- a/webcit-ng/Makefile +++ b/webcit-ng/Makefile @@ -1,13 +1,21 @@ CFLAGS := $(CFLAGS) -ggdb -Wno-format-truncation LDFLAGS := $(LDFLAGS) -# link -webcit: server/*.c - gcc $(CFLAGS) server/*.c $(LDFLAGS) -lcitadel -lpthread -lcrypto -lssl -lexpat -o webcit +SRC := server +OBJ := server + +SOURCES := $(wildcard $(SRC)/*.c) +OBJECTS := $(patsubst $(SRC)/%.c, $(OBJ)/%.o, $(SOURCES)) + +webcit: $(OBJECTS) + gcc $(CFLAGS) $(OBJECTS) $(LDFLAGS) -lcitadel -lpthread -lcrypto -lssl -lexpat -o webcit + +$(OBJ)/%.o: $(SRC)/%.c + gcc $(CFLAGS) -I$(SRC) -c $< -o $@ # remove compilation products clean: - rm -f webcit + rm -f webcit server/*.o distclean: clean