src/server/Makefile

changeset 14
b8bf95b39952
parent 13
1fdbf4170ef4
child 16
a9bbd82d2dce
--- a/src/server/Makefile	Sun Jan 08 15:46:47 2012 +0100
+++ b/src/server/Makefile	Sat Jan 14 13:53:44 2012 +0100
@@ -27,27 +27,43 @@
 #
 
 BUILD_ROOT = ../../
+
+LDFLAGS = -L/usr/lib/mps -R/usr/lib/mps -lplds4 -lplc4 -lnspr4 -lpthread -ldl -lposix4  -lsocket -lnsl -lgen -lm -lsendfile -lxerces-c -pg
+
 OBJ_DIR = $(BUILD_ROOT)build/
 
-CFLAGS  = -I/usr/include/mps -g
-LDFLAGS = -L/usr/lib/mps -R/usr/lib/mps -lplds4 -lplc4 -lnspr4 -lpthread -ldl -lposix4  -lsocket -lnsl -lgen -lm -lsendfile -lxerces-c -pg
-
 MAIN_TARGET = $(BUILD_ROOT)work/bin/webservd
 
-include objs.mk
-
 all: preparation $(MAIN_TARGET)
 
-preparation:
-	mkdir -p $(OBJPRE)
+include ucx/objs.mk
+include util/objs.mk
+include safs/objs.mk
+include webdav/objs.mk
+include daemon/objs.mk
+
+MAINOBJS = $(UCXOBJS) $(UTILOBJS) $(SAFOBJS) $(DAVOBJS) $(DAEMONOBJS)
+
+OBJ_DIRS = daemon safs ucx util webdav
+MK_OBJ_DIRS = $(OBJ_DIRS:%=$(OBJ_DIR)server/%)
+
+preparation: $(MK_OBJ_DIRS)
 	mkdir -p $(BUILD_ROOT)work/bin
+	
+$(MK_OBJ_DIRS):
+	mkdir -p $@
 
-$(MAIN_TARGET): $(MAINOBJS)
+$(MAIN_TARGET): $(DAEMONOBJS) $(UCXOBJS) $(UTILOBJS) $(SAFOBJS) $(DAVOBJS)
 	CC -o $(MAIN_TARGET) $(LDFLAGS) $(MAINOBJS)
 
-$(OBJPRE)%.o: %.c
-	cc -o $@ -c $(CFLAGS) $<
+$(DAEMONOBJS): $(UCXOBJS)
+	cd daemon; $(MAKE) all
+$(UCXOBJS):
+	cd ucx; $(MAKE) all
+$(UTILOBJS):
+	cd util; $(MAKE) all
+$(SAFOBJS):
+	cd safs; $(MAKE) all
+$(DAVOBJS):
+	cd webdav; $(MAKE) all
 
-$(OBJPRE)%.o: %.cpp
-	CC -o $@ -c $(CFLAGS) $<
-	

mercurial