final touches on dkim test harness
[citadel.git] / webcit-ng / Makefile
index cda937007a98555c7e34b80dd9f5e8b0b1a48c3d..15812fefd855fa96a1ea9f51e88bea47792abadb 100644 (file)
@@ -1,13 +1,28 @@
-CFLAGS := -ggdb -Wno-format-truncation
-LDFLAGS := 
+# 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.
 
-# link
-webcit: server/*.c
-       gcc server/*.c $(LDFLAGS) -lcitadel -lpthread -lcrypto -lssl -lexpat -o webcit
+CFLAGS := $(CFLAGS) -ggdb -Wno-format-truncation
+LDFLAGS := $(LDFLAGS)
+
+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