| 1 | ############################################################################### |
|---|
| 2 | # |
|---|
| 3 | # Makefile.in: Top-level makefile for ithildin. |
|---|
| 4 | # |
|---|
| 5 | # Copyright 2002 the Ithildin Project. |
|---|
| 6 | # See the COPYING file for more information on licensing and use. |
|---|
| 7 | # |
|---|
| 8 | # $Id$ |
|---|
| 9 | # |
|---|
| 10 | ############################################################################### |
|---|
| 11 | |
|---|
| 12 | # these are where to install things at the end of the day |
|---|
| 13 | prefix = @prefix@ |
|---|
| 14 | exec_prefix = @exec_prefix@ |
|---|
| 15 | BINDIR = @bindir@ |
|---|
| 16 | DATADIR = @datadir@@DIRSUFFIX@ |
|---|
| 17 | CONFDIR = @sysconfdir@@DIRSUFFIX@ |
|---|
| 18 | INCDIR = @includedir@/@PACKAGE@ |
|---|
| 19 | INSTALL = @INSTALL@ |
|---|
| 20 | PACKAGE = @PACKAGE@ |
|---|
| 21 | VERSION = @VERSION@ |
|---|
| 22 | |
|---|
| 23 | # binaries which might prove useful |
|---|
| 24 | RM = @RM@ |
|---|
| 25 | CTAGS = @CTAGS@ |
|---|
| 26 | |
|---|
| 27 | # the nitty-gritty compiler stuff. |
|---|
| 28 | |
|---|
| 29 | CC = @CC@ |
|---|
| 30 | CFLAGS = @CFLAGS@ |
|---|
| 31 | LDFLAGS = @LDFLAGS@ |
|---|
| 32 | LIBS = @LIBS@ |
|---|
| 33 | |
|---|
| 34 | # avoid directory printing |
|---|
| 35 | MAKEFLAGS += --no-print-directory |
|---|
| 36 | |
|---|
| 37 | default: all |
|---|
| 38 | |
|---|
| 39 | all: base_build modules_build |
|---|
| 40 | |
|---|
| 41 | base_build: |
|---|
| 42 | @echo ">>> building base system ..." |
|---|
| 43 | @repover=`sh tools/repover.sh` ; \ |
|---|
| 44 | (cd source && $(MAKE) REPOVER=$$repover all) |
|---|
| 45 | @echo "<<< finished building base system" |
|---|
| 46 | |
|---|
| 47 | modules_build: |
|---|
| 48 | @(cd modules && $(MAKE) all) |
|---|
| 49 | |
|---|
| 50 | base_install: base_build |
|---|
| 51 | mkdir -p $(BINDIR) |
|---|
| 52 | $(INSTALL) -b source/$(PACKAGE) $(BINDIR) |
|---|
| 53 | $(INSTALL) source/md5sum $(BINDIR) |
|---|
| 54 | |
|---|
| 55 | conf_install: |
|---|
| 56 | @if test -e $(CONFDIR)/$(PACKAGE).conf; then\ |
|---|
| 57 | echo ">>> not overwriting conf files";\ |
|---|
| 58 | else\ |
|---|
| 59 | echo ">>> installing configuration files";\ |
|---|
| 60 | mkdir -p $(CONFDIR);\ |
|---|
| 61 | $(INSTALL) -b -m 644 doc/conf/*.conf $(CONFDIR);\ |
|---|
| 62 | fi |
|---|
| 63 | |
|---|
| 64 | data_install: |
|---|
| 65 | mkdir -p $(DATADIR)/doc |
|---|
| 66 | @echo ">>> installing data files in $(DATADIR)" |
|---|
| 67 | @$(INSTALL) -m 644 COPYING DEVELOPERS README $(DATADIR) |
|---|
| 68 | @echo ">>> installing documentation in $(DATADIR)/doc" |
|---|
| 69 | @cd doc && for f in `find . \! -path '*/.svn*' -type f` ; do \ |
|---|
| 70 | df=`dirname $$f` ;\ |
|---|
| 71 | mkdir -p $(DATADIR)/doc/$$df ;\ |
|---|
| 72 | $(INSTALL) -m 644 $$f $(DATADIR)/doc/$$df ;\ |
|---|
| 73 | done |
|---|
| 74 | |
|---|
| 75 | include_install: |
|---|
| 76 | mkdir -p $(INCDIR) |
|---|
| 77 | @echo ">>> installing include files in $(INCDIR)" |
|---|
| 78 | $(INSTALL) -m 644 include/*.h $(INCDIR) |
|---|
| 79 | |
|---|
| 80 | modules_install: modules_build |
|---|
| 81 | @cd modules; $(MAKE) install |
|---|
| 82 | |
|---|
| 83 | install: base_install modules_install conf_install data_install include_install |
|---|
| 84 | @echo ">>> well, there you have it. everything installed. enjoy!" |
|---|
| 85 | |
|---|
| 86 | clean: |
|---|
| 87 | @echo ">>> cleaning base" |
|---|
| 88 | rm -f *~ doc/*~ include/*~ source/*~ *.core source/*.core |
|---|
| 89 | rm -f source/*.[do] source/$(PACKAGE) source/md5sum |
|---|
| 90 | @cd modules; $(MAKE) clean |
|---|
| 91 | @echo "<<< finished cleaning" |
|---|
| 92 | |
|---|
| 93 | distclean: clean |
|---|
| 94 | rm -rf autom4te.cache config.log config.status configure.lineno |
|---|
| 95 | rm -f tags source/tags include/config.h |
|---|
| 96 | rm -f Makefile source/Makefile modules/Makefile doc/conf/Makefile |
|---|
| 97 | rm -f `find . -name '*.d'` |
|---|
| 98 | |
|---|
| 99 | update: clean |
|---|
| 100 | svn update |
|---|
| 101 | @cfgline=`grep -E '^ \\$$' config.log | head -1 | \ |
|---|
| 102 | sed 's/^ \\$$ //' | sed 's/--quiet//'` ;\ |
|---|
| 103 | if test autoconf/configure.ac -nt configure ; then \ |
|---|
| 104 | echo ">>> updating configure and include/config.h.in" ;\ |
|---|
| 105 | autoconf -o configure autoconf/configure.ac ;\ |
|---|
| 106 | autoheader autoconf/configure.ac ;\ |
|---|
| 107 | echo ">>> re-running configure as:" ;\ |
|---|
| 108 | echo " $$cfgline" ;\ |
|---|
| 109 | $$cfgline ;\ |
|---|
| 110 | fi |
|---|
| 111 | |
|---|
| 112 | reconf: reconfigure |
|---|
| 113 | reconfig: reconfigure |
|---|
| 114 | reconfigure: |
|---|
| 115 | @cfgline=`grep -E '^ \\$$' config.log | head -1 | sed 's/^ \\$$ //'`;\ |
|---|
| 116 | echo ">>> re-running configure as:" ;\ |
|---|
| 117 | echo " $$cfgline" ;\ |
|---|
| 118 | $$cfgline |
|---|
| 119 | |
|---|
| 120 | DISTFILES = .svn COPYING DEVELOPERS Makefile.in README autoconf \ |
|---|
| 121 | configure doc include source tools |
|---|
| 122 | MDISTFILES = modules/.svn modules/Makefile.in |
|---|
| 123 | |
|---|
| 124 | release: clean |
|---|
| 125 | @repover=`sh tools/repover.sh` ; \ |
|---|
| 126 | echo ">>> building release for revision $$repover ..." ; \ |
|---|
| 127 | autoconf -o configure autoconf/configure.ac ; \ |
|---|
| 128 | autoheader autoconf/configure.ac ; \ |
|---|
| 129 | rm -rf dist ; \ |
|---|
| 130 | mkdir -p dist/$$repover ; \ |
|---|
| 131 | echo ">>> building release in $(VERSION).tar.gz"; \ |
|---|
| 132 | mkdir dist/$$repover/$(VERSION) ; \ |
|---|
| 133 | cp -R $(DISTFILES) dist/$$repover/$(VERSION) ; \ |
|---|
| 134 | cp -R modules dist/$$repover/$(VERSION)/modules ; \ |
|---|
| 135 | (cd dist/$$repover && tar -zcf $(VERSION).tar.gz $(VERSION)) ; \ |
|---|
| 136 | rm -rf dist/$$repover/$(VERSION) ; \ |
|---|
| 137 | echo ">>> building release for base system in $(VERSION)-base.tar.gz";\ |
|---|
| 138 | mkdir dist/$$repover/$(VERSION) ; \ |
|---|
| 139 | cp -R $(DISTFILES) dist/$$repover/$(VERSION) ; \ |
|---|
| 140 | mkdir -p dist/$$repover/$(VERSION)/modules ; \ |
|---|
| 141 | cp -R $(MDISTFILES) dist/$$repover/$(VERSION)/modules ; \ |
|---|
| 142 | (cd dist/$$repover && tar -zcf $(VERSION)-base.tar.gz $(VERSION)) ;\ |
|---|
| 143 | rm -rf dist/$$repover/$(VERSION) ; \ |
|---|
| 144 | (cd modules && $(MAKE) REPOVER=$$repover release) ; \ |
|---|
| 145 | echo "<<< finished building release in dist/$$repover" |
|---|
| 146 | |
|---|
| 147 | # vi:set ts=8 sts=4 sw=4 tw=76: |
|---|