[mw-devel] MARVIN r69 - trunk

pwb at sucs.org pwb at sucs.org
Fri Apr 14 22:24:45 BST 2006


Author: pwb
Date: 2006-04-14 22:24:44 +0100 (Fri, 14 Apr 2006)
New Revision: 69

Modified:
   trunk/Makefile
Log:
rewrote the makefile to be more sane (in particular, all source files now have their own targets, so header deps work properly)


Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2006-04-04 21:21:29 UTC (rev 68)
+++ trunk/Makefile	2006-04-14 21:24:44 UTC (rev 69)
@@ -1,22 +1,44 @@
-CFLAGS= -Wall -Werror -ggdb  -fPIC  -Dunix -DSLANG
-LDFLAGS= -ggdb
+XMLCFLAGS	= $(shell xml2-config --cflags)
+CFLAGS		= -std=gnu99 -g -O2 -Wall -Werror -ggdb -fPIC
+DEFS		= -DHAVE_CONFIG_H -Dunix -DSLANG $(XMLCFLAGS)
+LDFLAGS 	= -s -ggdb
+LIBS		= -lxml2 -lsqlite -lslang -lreadline -ltermcap -lcrypt 
 
+SERVEROBJS	= server.o socket.o session.o xml.o slang.o sqlite.o
+CLIENTOBJS	= client.o socket.o session.o xml.o slang.o sqlite.o
+ALLOBJS		= $(SERVEROBJS) $(CLIENTOBJS)
+BINARIES	= server client
 
-SERVEROBJS= server.o socket.o session.o xml.o slang.o sqlite.o
-CLIENTOBJS= client.o socket.o session.o xml.o slang.o sqlite.o
-ALLOBJS= $(SERVEROBJS) $(CLIENTOBJS)
-BINARIES= server client
+.PHONY:	clean
 
-XMLCFLAGS=$(shell xml2-config --cflags)
-CFLAGS+= $(XMLCFLAGS)
-LDFLAGS+= -lxml2 -lslang -lsqlite -lcrypt
+all:	server client
 
-all: server client
+clean:
+	@rm -vf $(ALLOBJS) $(BINARIES)
 
-server: $(SERVEROBJS)
+server:	$(SERVEROBJS)
+	$(CC) $(LDFLAGS) $(LIBS) $(SERVEROBJS) -o server
 
-client: $(CLIENTOBJS)
-	cc $(CLIENTOBJS) $(CFLAGS) $(LDFLAGS) -o client -lreadline -ltermcap
+client:	$(CLIENTOBJS)
+	$(CC) $(LDFLAGS) $(LIBS) -lreadline -ltermcap $(CLIENTOBJS) -o client
 
-clean: 
-	rm -f $(ALLOBJS) $(BINARIES)
+client.o: client.c socket.h session.h xml.h slang.h
+	$(CC) $(CFLAGS) $(DEFS) -c client.c
+
+server.o: server.c socket.h session.h xml.h slang.h
+	$(CC) $(CFLAGS) $(DEFS) -c server.c
+
+socket.o: socket.c
+	$(CC) $(CFLAGS) $(DEFS) -c socket.c
+
+session.o: session.c marvin.h socket.h session.h xml.h slang.h
+	$(CC) $(CFLAGS) $(DEFS) -c session.c
+
+xml.o:	xml.c session.h xml.h
+	$(CC) $(CFLAGS) $(DEFS) -c xml.c
+
+slang.o: slang.c marvin.h session.h xml.h slang.h _slang.h sqlite.h
+	$(CC) $(CFLAGS) $(DEFS) -c slang.c
+
+sqlite.o: sqlite.c marvin.h
+	$(CC) $(CFLAGS) $(DEFS) -c sqlite.c




More information about the mw-devel mailing list