src/server/plugins/postgresql/Makefile

branch
webdav
changeset 287
a171da778817
parent 275
535004faa1a5
child 299
f927ef81a12b
--- a/src/server/plugins/postgresql/Makefile	Fri Feb 04 18:41:40 2022 +0100
+++ b/src/server/plugins/postgresql/Makefile	Sat Feb 19 16:34:29 2022 +0100
@@ -36,19 +36,32 @@
 SRC += service.c
 SRC += vfs.c
 
+TEST_SRC  = pgtest.c
+
 OBJ = $(SRC:%.c=$(BUILD_ROOT)/build/server/plugins/postgresql/%$(OBJ_EXT))
+
+TEST_OBJ = $(TEST_SRC:%.c=$(BUILD_ROOT)/build/server/plugins/postgresql/%$(OBJ_EXT))
 	
 BUILD_DIR = $(BUILD_ROOT)/build/server/plugins/postgresql
 
 PLUGIN_TARGET = $(BUILD_ROOT)/build/lib/libwspostgresql$(LIB_EXT)
+TEST_TARGET = $(BUILD_ROOT)/build/lib/libwspgtest$(LIB_EXT)
 
-all: $(PLUGIN_TARGET)
+PGTEST = $(BUILD_ROOT)/build/server/plugins/postgresql/test
+
+all: $(PLUGIN_TARGET) $(TEST_TARGET) $(PGTEST)
 
 $(BUILD_DIR):
 	mkdir -p $(BUILD_DIR)
 
 $(PLUGIN_TARGET): $(BUILD_DIR) $(OBJ)
 	$(CC) $(POSTGRESQL_LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $(OBJ)
+	
+$(TEST_TARGET): $(BUILD_DIR) $(OBJ) $(TEST_OBJ)
+	$(CC) $(POSTGRESQL_LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $(OBJ) $(TEST_OBJ)
 
 $(BUILD_DIR)/%.o: %.c
-	$(CC) $(CFLAGS) $(POSTGRESQL_CFLAGS) $(SHLIB_CFLAGS) -c -o $@ $<
\ No newline at end of file
+	$(CC) $(CFLAGS) $(POSTGRESQL_CFLAGS) $(SHLIB_CFLAGS) -c -o $@ $<
+
+$(PGTEST): $(OBJ)
+	cd test; $(MAKE)

mercurial