Use a nicer, cleaner syntax calling #'make-glyph
[emchat] / Makefile
1 ## Makefile for EMchat   -*-Makefile-*-
2 ##
3 ## Copyright (C) 2001 - 2011 Steve Youngs
4 ##
5 ## This file is part of EMchat.
6
7 ## Redistribution and use in source and binary forms, with or without
8 ## modification, are permitted provided that the following conditions
9 ## are met:
10 ##
11 ## 1. Redistributions of source code must retain the above copyright
12 ##    notice, this list of conditions and the following disclaimer.
13 ##
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.
17 ##
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.
21 ##
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.
33
34 PACKAGE = emchat
35 VER = 0.9.6
36
37 SHELL = /bin/sh
38 # Cygwin # Comment out line above and uncomment the following line
39 # SHELL = /usr/bin/sh
40
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
44
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
47 # build the tarball.
48 STAGING = ../build-pkg
49 INFO_STAGING = $(STAGING)/info
50 LISP_STAGING = $(STAGING)/lisp/$(PACKAGE)
51
52 # Programs and their flags.
53 ifeq ($(XEMACS),)
54   XEMACS = sxemacs
55 endif
56
57 XEMACS_FLAGS = -batch -no-autoloads
58 MAKEINFO = makeinfo
59 INSTALL = install
60 # Solaris #  Comment out above line and uncomment the line below
61 # INSTALL = install -u 0 -g 0
62
63 PKG_INSTALL = install
64 TAR = /bin/tar
65 TAR_FLAGS = czf
66
67 # Everything hangs off this.
68 ifeq ($(PREFIX),)
69   ifeq ('$(XEMACS)','sxemacs')
70     PREFIX = /usr/local/share/sxemacs/site-packages
71   else
72     ifeq ('$(XEMACS)','xemacs')
73       PREFIX = /usr/local/lib/xemacs/site-packages
74     endif
75   endif
76 endif
77
78 # Where the lisp files go.
79 LISP_DIR = $(PREFIX)/lisp/$(PACKAGE)
80
81 # logos/icons etc
82 DATA_DIR = $(PREFIX)/etc/$(PACKAGE)
83
84 # Where the info files go.
85 INFO_DIR = $(PREFIX)/info
86
87 ############################################################################
88 ##                No User Configurable Items Below Here                   ##
89 ############################################################################
90
91 ## Order is IMPORTANT here.  Add new files to the _end_ unless you
92 ## know what you are doing.
93 SOURCES = \
94         emchat-utils.el    \
95         emchat.el          \
96         emchat-buddy.el    \
97         emchat-convert.el  \
98         emchat-curl.el     \
99         emchat-doctor.el   \
100         emchat-emphasis.el \
101         emchat-history.el  \
102         emchat-log.el      \
103         emchat-menu.el     \
104         emchat-meta.el     \
105         emchat-report.el   \
106         emchat-setup.el    \
107         emchat-status.el   \
108         emchat-toolbar.el  \
109         emchat-track.el    \
110         emchat-v8.el       \
111         emchat-wharf.el    \
112         emchat-world.el
113 #       emchat-xwem.el
114
115 GENERATED_SRC = \
116         auto-autoloads.el \
117         custom-load.el    \
118         custom-defines.el \
119
120 EXTRA_SRC = INSTALL NEWS README TODO emchat-version.el
121
122 OBJECTS = $(SOURCES:.el=.elc)
123 GENERATED_OBJ = $(GENERATED_SRC:.el=.elc)
124 TEXI_FILES = $(PACKAGE).texi
125 INFO_FILES = $(TEXI_FILES:.texi=.info)
126
127 DATA_FILES = $(wildcard images/*.x[pb]m) \
128         $(wildcard images/*.png)
129
130 .SUFFIXES:
131 .SUFFIXES: .info .texi .elc .el
132
133 all:: prepsrc version compile texinfo
134
135 compile:
136         $(XEMACS) $(XEMACS_FLAGS) -l "build.el"
137
138 prepsrc.el:
139         @echo "(defvar srcfiles" > $@
140         @echo "  (quote ($(GENERATED_SRC)" >> $@
141         @echo "          $(SOURCES))))" >> $@
142
143 prepsrc: prepsrc.el
144
145 .texi.info:
146         $(MAKEINFO) $<
147
148 texinfo: emchat-version.texi $(INFO_FILES)
149
150 emchat-version.el:
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` >> $@; \
156         else \
157                 echo -n '  "$(VER)"' >> $@; \
158         fi
159         echo ")" >> $@
160         echo "(provide 'emchat-version)" >> $@
161
162 version: emchat-version.el
163
164 emchat-version.texi:
165         if [ -x `which git 2>/dev/null` ]; then \
166                 printf "@set VERSION %s" `git describe` > $@; \
167         else \
168                 echo "@set VERSION $(VER)" > $@; \
169         fi
170
171 install: all
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)
177
178 # Solaris # Comment out the above and uncomment the following.
179 # install: all
180 #       for file in $(INFO_DIR) $(LISP_DIR); \
181 #         do $(INSTALL) -d $$file; \
182 #       done
183 #       for file in $(INFO_FILES); \
184 #         do $(INSTALL) -f $(INFO_DIR) -m 644 $$file; \
185 #       done
186 #       for file in $(SOURCES) $(GENERATED_SRC) $(EXTRA_SRC) $(OBJECTS) $(GENERATED_OBJ); \
187 #         do $(INSTALL) -f $(LISP_DIR) -m 644 $$file; \
188 #       done
189
190
191 pkg: all
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)
196         (cd $(STAGING); \
197                 $(TAR) $(TAR_FLAGS) $(PACKAGE)-$(VER)-pkg.tar.gz ./*)
198
199 upgrade: distclean uninstall install
200
201 uninstall::
202         rm -rf $(LISP_DIR)
203         rm -f $(INFO_DIR)/$(INFO_FILES)
204
205 clean::
206         rm -f $(OBJECTS) $(GENERATED_OBJ) $(GENERATED_SRC) \
207                 $(INFO_FILES)
208
209
210 distclean: clean
211         rm -f core* *~ TAGS emchat-version.el emchat-version.texi \
212                 prepsrc.el
213
214 # Developer targets
215 tags: TAGS
216
217 TAGS: $(SOURCES)
218         etags $(SOURCES)
219
220 .PHONY: emchat-version.el version emchat-version.texi