X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit-ng%2FMakefile;h=645e0260693768a8a6e03635753e08c77b155838;hb=HEAD;hp=7c2980cb2068de03b077442c8fbd1cf7db4e361f;hpb=5151485fd932fa44aae807be8516e08c4dd681fb;p=citadel.git diff --git a/webcit-ng/Makefile b/webcit-ng/Makefile index 7c2980cb2..15812fefd 100644 --- a/webcit-ng/Makefile +++ b/webcit-ng/Makefile @@ -1,13 +1,28 @@ +# Copyright (c) 1996-2024 by the citadel.org team +# This program is open source software. Use, duplication, or disclosure is subject to the GNU General Public License v3. + 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 + +HEADERS := $(wildcard $(SRC)/*.h) +SOURCES := $(wildcard $(SRC)/*.c) +OBJECTS := $(patsubst $(SRC)/%.c, $(OBJ)/%.o, $(SOURCES)) + +webcit: $(OBJECTS) + gcc $(CFLAGS) $(OBJECTS) $(LDFLAGS) -lcitadel -lpthread -lcrypto -lssl -lexpat -lical -o webcit + +$(SRC)/%.c: $(HEADERS) + touch $@ + +$(OBJ)/%.o: $(SRC)/%.c + gcc $(CFLAGS) -I$(SRC) -c $< -o $@ # remove compilation products clean: - rm -f webcit + rm -f webcit server/*.o distclean: clean