## Makefile for EMchat -*-Makefile-*- ## ## Copyright (C) 2001 - 2011 Steve Youngs ## ## This file is part of EMchat. ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions ## are met: ## ## 1. Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## ## 2. Redistributions in binary form must reproduce the above copyright ## notice, this list of conditions and the following disclaimer in the ## documentation and/or other materials provided with the distribution. ## ## 3. Neither the name of the author nor the names of any contributors ## may be used to endorse or promote products derived from this ## software without specific prior written permission. ## ## THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR ## IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ## WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ## DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE ## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ## SUBSTITUTE GOODS OR SERVICES# LOSS OF USE, DATA, OR PROFITS# OR ## BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE ## OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN ## IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PACKAGE = emchat VER = 0.9.6 SHELL = /bin/sh # Cygwin # Comment out line above and uncomment the following line # SHELL = /usr/bin/sh # Cygwin # Comment out the line above and uncomment the # following line (/cygdrive/c is Cygwin notation for C:\ !!!) # PREFIX = /cygdrive/c/Program\ Files/XEmacs/site-packages # If you want to make a tarball that you can just unpack on all your # PC's you can 'make pkg'. The 'pkg' target uses these directories to # build the tarball. STAGING = ../build-pkg INFO_STAGING = $(STAGING)/info LISP_STAGING = $(STAGING)/lisp/$(PACKAGE) # Programs and their flags. ifeq ($(XEMACS),) XEMACS = sxemacs endif XEMACS_FLAGS = -batch -no-autoloads MAKEINFO = makeinfo INSTALL = install # Solaris # Comment out above line and uncomment the line below # INSTALL = install -u 0 -g 0 PKG_INSTALL = install TAR = /bin/tar TAR_FLAGS = czf # Everything hangs off this. ifeq ($(PREFIX),) ifeq ('$(XEMACS)','sxemacs') PREFIX = /usr/local/share/sxemacs/site-packages else ifeq ('$(XEMACS)','xemacs') PREFIX = /usr/local/lib/xemacs/site-packages endif endif endif # Where the lisp files go. LISP_DIR = $(PREFIX)/lisp/$(PACKAGE) # logos/icons etc DATA_DIR = $(PREFIX)/etc/$(PACKAGE) # Where the info files go. INFO_DIR = $(PREFIX)/info ############################################################################ ## No User Configurable Items Below Here ## ############################################################################ ## Order is IMPORTANT here. Add new files to the _end_ unless you ## know what you are doing. SOURCES = \ emchat-utils.el \ emchat.el \ emchat-buddy.el \ emchat-convert.el \ emchat-curl.el \ emchat-doctor.el \ emchat-emphasis.el \ emchat-history.el \ emchat-log.el \ emchat-menu.el \ emchat-meta.el \ emchat-report.el \ emchat-setup.el \ emchat-status.el \ emchat-toolbar.el \ emchat-track.el \ emchat-v8.el \ emchat-wharf.el \ emchat-world.el # emchat-xwem.el GENERATED_SRC = \ auto-autoloads.el \ custom-load.el \ custom-defines.el \ EXTRA_SRC = INSTALL NEWS README TODO emchat-version.el OBJECTS = $(SOURCES:.el=.elc) GENERATED_OBJ = $(GENERATED_SRC:.el=.elc) TEXI_FILES = $(PACKAGE).texi INFO_FILES = $(TEXI_FILES:.texi=.info) DATA_FILES = $(wildcard images/*.x[pb]m) \ $(wildcard images/*.png) .SUFFIXES: .SUFFIXES: .info .texi .elc .el all:: prepsrc version compile texinfo compile: $(XEMACS) $(XEMACS_FLAGS) -l "build.el" prepsrc.el: @echo "(defvar srcfiles" > $@ @echo " (quote ($(GENERATED_SRC)" >> $@ @echo " $(SOURCES))))" >> $@ prepsrc: prepsrc.el .texi.info: $(MAKEINFO) $< texinfo: emchat-version.texi $(INFO_FILES) emchat-version.el: echo ";;; Automatically generated file -- DO NOT EDIT OR DELETE" > $@ echo ";;;###autoload" >> $@ echo "(defconst emchat-version" >> $@ if [ -x `which git 2>/dev/null` ]; then \ printf ' "%s"' `git describe` >> $@; \ else \ echo -n ' "$(VER)"' >> $@; \ fi echo ")" >> $@ echo "(provide 'emchat-version)" >> $@ version: emchat-version.el emchat-version.texi: if [ -x `which git 2>/dev/null` ]; then \ printf "@set VERSION %s" `git describe` > $@; \ else \ echo "@set VERSION $(VER)" > $@; \ fi install: all $(INSTALL) -d $(INFO_DIR) $(LISP_DIR) $(DATA_DIR) $(INSTALL) -m 644 $(INFO_FILES) $(INFO_DIR) $(INSTALL) -m 644 $(DATA_FILES) $(DATA_DIR) $(INSTALL) -m 644 $(SOURCES) $(GENERATED_SRC) $(EXTRA_SRC) \ $(OBJECTS) $(GENERATED_OBJ) $(LISP_DIR) # Solaris # Comment out the above and uncomment the following. # install: all # for file in $(INFO_DIR) $(LISP_DIR); \ # do $(INSTALL) -d $$file; \ # done # for file in $(INFO_FILES); \ # do $(INSTALL) -f $(INFO_DIR) -m 644 $$file; \ # done # for file in $(SOURCES) $(GENERATED_SRC) $(EXTRA_SRC) $(OBJECTS) $(GENERATED_OBJ); \ # do $(INSTALL) -f $(LISP_DIR) -m 644 $$file; \ # done pkg: all $(PKG_INSTALL) -d $(STAGING) $(INFO_STAGING) $(LISP_STAGING) $(PKG_INSTALL) -m 644 $(INFO_FILES) $(INFO_STAGING) $(PKG_INSTALL) -m 644 $(SOURCES) $(GENERATED_SRC) $(EXTRA_SRC) \ $(OBJECTS) $(GENERATED_OBJ) $(LISP_STAGING) (cd $(STAGING); \ $(TAR) $(TAR_FLAGS) $(PACKAGE)-$(VER)-pkg.tar.gz ./*) upgrade: distclean uninstall install uninstall:: rm -rf $(LISP_DIR) rm -f $(INFO_DIR)/$(INFO_FILES) clean:: rm -f $(OBJECTS) $(GENERATED_OBJ) $(GENERATED_SRC) \ $(INFO_FILES) distclean: clean rm -f core* *~ TAGS emchat-version.el emchat-version.texi \ prepsrc.el # Developer targets tags: TAGS TAGS: $(SOURCES) etags $(SOURCES) .PHONY: emchat-version.el version emchat-version.texi