[mw-devel] MW3 r1003 - in trunk: . src

arthur at sucs.org arthur at sucs.org
Mon Dec 3 13:53:11 GMT 2007


Author: arthur
Date: 2007-12-03 13:53:10 +0000 (Mon, 03 Dec 2007)
New Revision: 1003

Added:
   trunk/scripts/
Modified:
   trunk/Makefile
   trunk/src/Makefile
Log:
clean up the makefiles to make rpm build sane


Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2007-12-01 17:34:13 UTC (rev 1002)
+++ trunk/Makefile	2007-12-03 13:53:10 UTC (rev 1003)
@@ -1,3 +1,37 @@
+# this is duplicated here to get the filenames right
+VERSION_MAJOR= 2
+VERSION_MINOR= 15
+VERSION_TWEAK= $(shell svnversion -c .|cut -d : -f 2)
+VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_TWEAK)
 
+# the non source files that should get installed
+INSTALLFILES = colour help login.banner mudhelp rooms scripthelp talkhelp wizhelp users.bb folders.bb COPYING INSTALL LICENSE README
+
+ifndef TMPDIR
 rpm:
-	make -C src rpm
+	make TMPDIR=`mktemp -d` rpm
+else
+rpm: tarball
+	rpmbuild -ta $(TMPDIR)/mw3-$(VERSION).tar.gz
+endif
+
+install:
+	install -d $(HOMEPATH)/mesgs
+	touch "$(HOMEPATH)/who.bb"
+	touch "$(HOMEPATH)/log.bb"
+	install -Ds mw $(bindir)/mw
+	install $(HOMEPATH) $(INSTALLFILES)
+	make -C src install
+
+tarball:
+	rm -rf $(TMPDIR)/mw3-$(VERSION)
+	mkdir -p $(TMPDIR)/mw3-$(VERSION)/src
+	cp -a $(INSTALLFILES) $(TMPDIR)/mw3-$(VERSION)/
+	cp -a src/*.[ch] $(TMPDIR)/mw3-$(VERSION)/src/
+	cp -a *spec  $(TMPDIR)/mw3-$(VERSION)/
+	cp -a Makefile  $(TMPDIR)/mw3-$(VERSION)/
+	cp -a src/Makefile  $(TMPDIR)/mw3-$(VERSION)/src/
+	tar zchvf $(TMPDIR)/mw3-$(VERSION).tar.gz --exclude .svn --exclude .cvsignore -C $(TMPDIR) mw3-$(VERSION)
+	rm -fr $(TMPDIR)/mw3-$(VERSION)
+
+

Modified: trunk/src/Makefile
===================================================================
--- trunk/src/Makefile	2007-12-01 17:34:13 UTC (rev 1002)
+++ trunk/src/Makefile	2007-12-03 13:53:10 UTC (rev 1003)
@@ -58,7 +58,7 @@
 	
 -include $(CODE:.c=.d)
 
-.PHONY: all setup_homepath install clean wipe test
+.PHONY: all install clean wipe test
 
 messages.po: $(CODE) $(HDRS)
 	xgettext --copyright-holder="Justin Mitchell <arthur at sucs.org>" -E  --no-wrap --keyword=_ $^ -j -o messages.po 
@@ -90,33 +90,18 @@
 js.o sqlite.o ipc.o
 	$(CC) $(LDFLAGS) $(LDLIBS) -o $@ $^
 
-setup_homepath:
-	mkdir -p "$(HOMEPATH)/mesgs"
-	touch "$(HOMEPATH)/who.bb"
-	touch "$(HOMEPATH)/log.bb"
-
 del_user: del_user.o perms.o strings.o
 	$(CC) $(LDFLAGS) -o $@ $^
 
 red: red.c
 	$(CC) -o $@ $^
 
-# files to install to $(HOMEPATH) (not including the executable which goes in /usr/bin)
-INSTALLFILES = colour help login.banner mudhelp rooms scripthelp talkhelp wizhelp users.bb folders.bb COPYING INSTALL LICENSE README
-install: mw setup_homepath
-	strip mw
-	mkdir -p "$(HOMEPATH)"
-	mkdir -p "$(bindir)"
-	cp mw $(bindir)/mw
-	cd .. && cp -a $(INSTALLFILES) $(HOMEPATH)
+install: mw
+	install -Ds mw $(bindir)/mw
 
 clean:
-	-rm -f *.o *.d red mw del_user ../who.bb ../log.bb
-	-rmdir --ignore-fail-on-non-empty ../mesgs
+	-rm -f *.o *.d red mw del_user
 
-wipe:
-	-rm -f *.i *.t *.bb
-
 test: test.o db.o dbglue.o mwdb.o gnudb.o
 	$(CC) $(LDFLAGS) -lgdbm -o $@ $^
 
@@ -124,12 +109,3 @@
 	$(CC) $(LDFLAGS) -o $@ $^
 
 
-tarball: clean
-	rm -rf $(TMPDIR)/mw3-$(VERSION)
-	mkdir $(TMPDIR)/mw3-$(VERSION)
-	cp -a ../* $(TMPDIR)/mw3-$(VERSION)
-	tar zchvf $(TMPDIR)/mw3-$(VERSION).tar.gz --exclude .svn --exclude .cvsignore -C $(TMPDIR) mw3-$(VERSION)
-	rm -fr $(TMPDIR)/mw3-$(VERSION)
-
-rpm: tarball
-	rpmbuild -tb $(TMPDIR)/mw3-$(VERSION).tar.gz





More information about the mw-devel mailing list