5 kx # -*-makefile-*- (gpm/main)
5 kx #
5 kx # Copyright 1994,1997 rubini@linux.it
5 kx # Copyright 1997 dickey@clark.net
5 kx # Copyright (C) 1998 Ian Zimmerman <itz@rahul.net>
5 kx # Copyright (C) 2001-2012 Nico Schottelius
5 kx #
5 kx
5 kx SHELL = /bin/sh
5 kx srcdir = @srcdir@
5 kx top_srcdir = @top_srcdir@
5 kx top_builddir = .
5 kx
5 kx include Makefile.include
5 kx
5 kx # allow CFLAGS to be overriden from make command line
5 kx # ideally one would never have to write this rule again, but the GNU
5 kx # makefile standards are at cross-purposes: CFLAGS is reserved for
5 kx # user-overridable flags, but it's also all the implicit rule looks at.
5 kx # missing ?
5 kx
5 kx SUBDIRS = src doc contrib
5 kx
5 kx
5 kx ### simple, but effective rules
5 kx
5 kx all: do-all
5 kx
5 kx src/$(DEPFILE):
5 kx touch $@ # to prevent unecessary warnings
5 kx
5 kx dep: src/$(DEPFILE)
5 kx $(MAKE) -C src dep
5 kx
5 kx check: all
5 kx
5 kx uninstall: do-uninstall
5 kx
5 kx clean: do-clean
5 kx rm -f config.status.lineno
5 kx
5 kx #aclocal.m4: acinclude.m4
5 kx # $(MKDIR) config
5 kx # aclocal -I config
5 kx
5 kx #configure: configure.ac aclocal.m4 $(versionfiles)
5 kx # libtoolize --force --copy `libtoolize -n --install >/dev/null 2>&1 && echo --install`
5 kx # autoheader
5 kx # autoconf
5 kx
5 kx #config.status: configure
5 kx # if [ -f config.status ]; then $(SHELL) ./config.status --recheck; \
5 kx # else $(SHELL) ./configure; fi
5 kx
5 kx Makefile: config.status $(srcdir)/Makefile.in Makefile.include
5 kx ./config.status
5 kx Makefile.include: config.status $(srcdir)/Makefile.include.in
5 kx ./config.status
5 kx
5 kx ### INSTALL
5 kx
5 kx install: check installdirs do-install
5 kx
5 kx install-strip:
5 kx $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) $(STRIP)' install
5 kx
5 kx installdirs:
5 kx $(MKDIR) $(libdir) $(bindir) $(sbindir) $(includedir) $(sysconfdir); \
5 kx if test "x$(ELISP)" != "x" ; then \
5 kx $(MKDIR) $(lispdir) ; \
5 kx fi
5 kx
5 kx ### GENERIC
5 kx
5 kx # do-all goes to all subdirectories and does all
5 kx do-%: dep
5 kx @target=`echo $@ | $(SED) -e 's/^do-//'`; \
5 kx for i in $(SUBDIRS) ; do \
5 kx if test -f ./$$i/Makefile ; then \
5 kx $(MAKE) -C ./$$i $${target} || exit 1 ;\
5 kx else \
5 kx true; \
5 kx fi; \
5 kx done
5 kx
5 kx
5 kx # Configure & unconfigure
5 kx
5 kx # Maintainer portion, use at your own risk
5 kx
5 kx barf:
5 kx @echo 'This command is intended for maintainers to use; it'
5 kx @echo 'deletes files that may need special tools to rebuild.'
5 kx @echo 'If you want to continue, please press return.'
5 kx @echo -n "Hit Ctrl+C to abort."
5 kx @read somevar
5 kx
5 kx
5 kx # who / what does need tags
5 kx TAGS: $(SRCS) $(HDRS) src/prog/gpm-root.y do-TAGS
5 kx cd $(srcdir) && $(ETAGS) -o TAGS $(SRCS) $(HDRS) src/prog/gpm-root.y
5 kx
5 kx ### RELEASE STUFF
5 kx TARS =../gpm-$(release).tar.gz
5 kx TARS +=../gpm-$(release).tar.bz2 ../gpm-$(release).tar.lzma
5 kx
5 kx M_HOST=arcana.linux.it
5 kx M_DIR=gpm/
5 kx
5 kx tars: $(TARS)
5 kx
5 kx # configure headers, produce new configure script
5 kx distconf: Makefile.in Makefile.include.in configure acinclude.m4 $(versionfiles)
5 kx
5 kx ../gpm-$(release).tar: $(srcdir) distclean distconf
5 kx # no exclude possible of .git with pax it seems, so the following is not possible:
5 kx git archive --prefix "gpm-$(release)/" -o $@ HEAD
5 kx
5 kx ../gpm-$(release).tar.gz: ../gpm-$(release).tar
5 kx gzip -9 -c $< > $@
5 kx
5 kx ../gpm-$(release).tar.bz2: ../gpm-$(release).tar
5 kx bzip2 -9 -c $< > $@
5 kx
5 kx ../gpm-$(release).tar.lzma: ../gpm-$(release).tar
5 kx lzma -9 -c $< > $@
5 kx
5 kx # 3. Put package together into .tar.gz and .tar.bz2
5 kx dist: disttest distclean distconf $(TARS)
5 kx scp $(TARS) $(M_HOST):$(M_DIR)
5 kx mv $(TARS) ~/niconetz/software/gpm/archives
5 kx
5 kx ### TEST: on nicos machine: not to be used anywhere else currently
5 kx # create / update configure, delete other parts from earlier build
5 kx disttest: distconf clean
5 kx ./configure
5 kx make all
5 kx
5 kx ### CLEANUP
5 kx distclean: clean do-clean do-distclean
5 kx rm -f config.log config.status* config.cache Makefile Makefile.include
5 kx rm -rf autom4te.cache
5 kx rm -f src/$(DEPFILE)
5 kx
5 kx allclean: do-allclean distclean
5 kx rm -f configure aclocal.m4