1 ## Makefile for EMchat -*-Makefile-*-
3 ## Copyright (C) 2001 - 2011 Steve Youngs
5 ## This file is part of EMchat.
7 ## Redistribution and use in source and binary forms, with or without
8 ## modification, are permitted provided that the following conditions
11 ## 1. Redistributions of source code must retain the above copyright
12 ## notice, this list of conditions and the following disclaimer.
14 ## 2. Redistributions in binary form must reproduce the above copyright
15 ## notice, this list of conditions and the following disclaimer in the
16 ## documentation and/or other materials provided with the distribution.
18 ## 3. Neither the name of the author nor the names of any contributors
19 ## may be used to endorse or promote products derived from this
20 ## software without specific prior written permission.
22 ## THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
23 ## IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 ## WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 ## DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 ## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 ## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 ## SUBSTITUTE GOODS OR SERVICES# LOSS OF USE, DATA, OR PROFITS# OR
29 ## BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30 ## WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
31 ## OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
32 ## IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 # Cygwin # Comment out line above and uncomment the following line
41 # Cygwin # Comment out the line above and uncomment the
42 # following line (/cygdrive/c is Cygwin notation for C:\ !!!)
43 # PREFIX = /cygdrive/c/Program\ Files/XEmacs/site-packages
45 # If you want to make a tarball that you can just unpack on all your
46 # PC's you can 'make pkg'. The 'pkg' target uses these directories to
48 STAGING = ../build-pkg
49 INFO_STAGING = $(STAGING)/info
50 LISP_STAGING = $(STAGING)/lisp/$(PACKAGE)
52 # Programs and their flags.
57 XEMACS_FLAGS = -batch -no-autoloads
60 # Solaris # Comment out above line and uncomment the line below
61 # INSTALL = install -u 0 -g 0
67 # Everything hangs off this.
69 ifeq ('$(XEMACS)','sxemacs')
70 PREFIX = /usr/local/share/sxemacs/site-packages
72 ifeq ('$(XEMACS)','xemacs')
73 PREFIX = /usr/local/lib/xemacs/site-packages
78 # Where the lisp files go.
79 LISP_DIR = $(PREFIX)/lisp/$(PACKAGE)
82 DATA_DIR = $(PREFIX)/etc/$(PACKAGE)
84 # Where the info files go.
85 INFO_DIR = $(PREFIX)/info
87 ############################################################################
88 ## No User Configurable Items Below Here ##
89 ############################################################################
91 ## Order is IMPORTANT here. Add new files to the _end_ unless you
92 ## know what you are doing.
120 EXTRA_SRC = INSTALL NEWS README TODO emchat-version.el
122 OBJECTS = $(SOURCES:.el=.elc)
123 GENERATED_OBJ = $(GENERATED_SRC:.el=.elc)
124 TEXI_FILES = $(PACKAGE).texi
125 INFO_FILES = $(TEXI_FILES:.texi=.info)
127 DATA_FILES = $(wildcard images/*.x[pb]m) \
128 $(wildcard images/*.png)
131 .SUFFIXES: .info .texi .elc .el
133 all:: prepsrc version compile texinfo
136 $(XEMACS) $(XEMACS_FLAGS) -l "build.el"
139 @echo "(defvar srcfiles" > $@
140 @echo " (quote ($(GENERATED_SRC)" >> $@
141 @echo " $(SOURCES))))" >> $@
148 texinfo: emchat-version.texi $(INFO_FILES)
151 echo ";;; Automatically generated file -- DO NOT EDIT OR DELETE" > $@
152 echo ";;;###autoload" >> $@
153 echo "(defconst emchat-version" >> $@
154 if [ -x `which git 2>/dev/null` ]; then \
155 printf ' "%s"' `git describe` >> $@; \
157 echo -n ' "$(VER)"' >> $@; \
160 echo "(provide 'emchat-version)" >> $@
162 version: emchat-version.el
165 if [ -x `which git 2>/dev/null` ]; then \
166 printf "@set VERSION %s" `git describe` > $@; \
168 echo "@set VERSION $(VER)" > $@; \
172 $(INSTALL) -d $(INFO_DIR) $(LISP_DIR) $(DATA_DIR)
173 $(INSTALL) -m 644 $(INFO_FILES) $(INFO_DIR)
174 $(INSTALL) -m 644 $(DATA_FILES) $(DATA_DIR)
175 $(INSTALL) -m 644 $(SOURCES) $(GENERATED_SRC) $(EXTRA_SRC) \
176 $(OBJECTS) $(GENERATED_OBJ) $(LISP_DIR)
178 # Solaris # Comment out the above and uncomment the following.
180 # for file in $(INFO_DIR) $(LISP_DIR); \
181 # do $(INSTALL) -d $$file; \
183 # for file in $(INFO_FILES); \
184 # do $(INSTALL) -f $(INFO_DIR) -m 644 $$file; \
186 # for file in $(SOURCES) $(GENERATED_SRC) $(EXTRA_SRC) $(OBJECTS) $(GENERATED_OBJ); \
187 # do $(INSTALL) -f $(LISP_DIR) -m 644 $$file; \
192 $(PKG_INSTALL) -d $(STAGING) $(INFO_STAGING) $(LISP_STAGING)
193 $(PKG_INSTALL) -m 644 $(INFO_FILES) $(INFO_STAGING)
194 $(PKG_INSTALL) -m 644 $(SOURCES) $(GENERATED_SRC) $(EXTRA_SRC) \
195 $(OBJECTS) $(GENERATED_OBJ) $(LISP_STAGING)
197 $(TAR) $(TAR_FLAGS) $(PACKAGE)-$(VER)-pkg.tar.gz ./*)
199 upgrade: distclean uninstall install
203 rm -f $(INFO_DIR)/$(INFO_FILES)
206 rm -f $(OBJECTS) $(GENERATED_OBJ) $(GENERATED_SRC) \
211 rm -f core* *~ TAGS emchat-version.el emchat-version.texi \
220 .PHONY: emchat-version.el version emchat-version.texi