1# Sarien toplevel Makefile
2# $Id: Makefile,v 1.10 2001/09/04 02:17:00 almightyjustin Exp $
3
4# DIST		distribution package name
5# DFILES	standard distribution files
6# DDIRS		standard distribution directories
7
8include Version
9
10PKG	= sarien
11XCFLAGS	= -Iloaders/include
12DIST	= $(PKG)-$(VERSION)
13DFILES	= configure configure.in Makefile Makefile.wat Makefile.dj \
14	  Makefile.tc Sarien.make Sarien.DICE Rules.in Rules.dj Version \
15	  README
16DDIRS	= VC++6.0 OSX-ProjectBuilder eVC3 doc scripts bin debian etc lib \
17	  src rulesets
18CFILES	=
19DCFILES	= Rules config.log config.status config.cache
20
21all:
22	for i in $(DDIRS); do \
23		(cd $$i; [ -f $(MAKEFILE) ] && $(MAKE) $@) \
24	done; true
25
26include Rules
27
28clean::
29	rm -f config.cache config.log
30
31distclean::
32	rm -f Rules
33
34configure: configure.in
35	autoconf
36
37check: test
38
39dust:
40	@echo "<cough, cough>"
41
42# Extra targets:
43# 'dist' prepares a distribution package
44# 'mark' marks the last RCS revision with the package version number
45# 'whatsout' lists the locked files
46# 'diff' creates a diff file
47# 'rpm' generates an RPM package
48
49dist:
50	rm -Rf $(DIST) $(DIST).tar.gz
51	mkdir $(DIST)
52	$(MAKE) DISTDIR=$(DIST) subdist
53	chmod -R u+w $(DIST)/*
54	tar cvf - $(DIST) | gzip -9c > $(DIST).tar.gz
55	rm -Rf $(DIST)
56	./config.status
57	sync
58	ls -l $(DIST).tar.gz
59
60bz2:
61	zcat $(DIST).tar.gz | bzip2 > $(DIST).tar.bz2
62
63bindist:
64	$(MAKE) _bindist1 CONFIGURE="./configure"
65
66binpkg: bindist $(PORTS)
67
68_bindist1:
69	rm -Rf $(DIST)
70	gzip -dc $(DIST).tar.gz | tar xvf -
71	cd $(DIST); $(CONFIGURE); $(MAKE) _bindist2
72	rm -Rf $(DIST)
73	sync
74
75chkoldver:
76	@if [ "$(OLDVER)" = "" ]; then \
77	    echo "parameter missing: OLDVER=<old_version>"; \
78	    false; \
79	fi
80
81diff: chkoldver
82	@if [ "$(OLDVER)" != "none" ]; then \
83	    echo "Creating diff from $(OLDVER) to $(VERSION)"; \
84	    rm -Rf $(PKG)-$(OLDVER) $(PKG)-$(VERSION); \
85	    tar xzf $(PKG)-$(OLDVER).tar.gz; \
86	    tar xzf $(PKG)-$(VERSION).tar.gz; \
87	    diff -rud --new-file $(PKG)-$(OLDVER) $(PKG)-$(VERSION) | \
88		gzip -9c > $(PKG)-$(VERSION).diff.gz; \
89	    rm -Rf $(PKG)-$(OLDVER) $(PKG)-$(VERSION); \
90	    sync; \
91	fi
92
93Rules: Rules.in
94	./config.status
95
96$(OBJS): Makefile
97
98