final touches on dkim test harness
[citadel.git] / webcit-ng / Makefile
index 5a96ee2c67c59f1f2bb5ca17c653700324ba90a8..15812fefd855fa96a1ea9f51e88bea47792abadb 100644 (file)
@@ -1,24 +1,28 @@
-OBJS := http.o main.o request.o tls.o static.o tcp_sockets.o webserver.o ctdlclient.o \
-       admin_functions.o room_functions.o util.o caldav_reports.o messages.o \
-       ctdlfunctions.o ctdl_commands.o forum_view.o html2html.o text2html.o user_functions.o
-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: $(OBJS)
-       gcc $(OBJS) $(LDFLAGS) -lcitadel -lpthread -lcrypto -lssl -lexpat -o webcit
+CFLAGS := $(CFLAGS) -ggdb -Wno-format-truncation
+LDFLAGS := $(LDFLAGS)
 
-# pull in dependency info for *existing* .o files
--include $(OBJS:.o=.d)
+SRC := server
+OBJ := server
 
-# compile and generate dependency info
-%.o: %.c
-       gcc -c $(CFLAGS) $*.c -o $*.o
-       gcc -MM $(CFLAGS) $*.c > $*.d
+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 *.o *.d
+       rm -f webcit server/*.o
 
 distclean: clean