1 ## Makefile for eMoney -*-Makefile-*-
3 ## Copyright (C) 2003 - 2011 Steve Youngs
5 ## This file is part of eMoney.
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.
37 # csh... yell no, we won't go!
40 # Programs and their flags.
44 XEMACS_FLAGS = -batch -no-autoloads
46 PKG_INSTALL = $(INSTALL)
56 # Our prefix. Everything hangs off this.
58 ifeq ('$(XEMACS)','sxemacs')
59 PREFIX = /usr/local/share/sxemacs/site-packages
61 PREFIX = /usr/local/lib/xemacs/site-packages
65 # Where the lisp files go.
66 LISP_DIR = $(PREFIX)/lisp/$(PACKAGE)
68 # If you want to make a tarball that you can just unpack on all your
69 # PC's you can 'make pkg'. The 'pkg' target uses these directories to
71 STAGING = ../build-pkg
72 INFO_STAGING = $(STAGING)/info
73 LISP_STAGING = $(STAGING)/lisp/$(PACKAGE)
76 ############################################################################
77 ## No User Configurable Items Below Here ##
78 ############################################################################
80 SOURCES = $(wildcard ./emoney*.el)
81 OBJECTS = $(SOURCES:.el=.elc)
83 EXTRA_OBJ = $(wildcard ./auto-autoloads.el*) $(wildcard ./custom-*.el*)
85 all:: emoney-version.el compile
88 $(XEMACS) $(XEMACS_FLAGS) -l "build.el"
91 echo ";;; Automatically generated file -- DO NOT EDIT OR DELETE" > $@
92 echo ";;;###autoload" >> $@
93 echo "(defconst emoney-version" >> $@
94 if [[ -d ".git" && -x `which git 2>/dev/null` ]]; then \
95 printf ' "%s"' `git describe` >> $@; \
97 echo -n ' "$(VER)"' >> $@; \
100 echo "(provide 'emoney-version)" >> $@
102 version: emoney-version.el
105 $(INSTALL) -d $(LISP_DIR)
106 $(INSTALL) -m 644 $(SOURCES) $(EXTRA_SRC) $(OBJECTS) $(EXTRA_OBJ) \
110 $(PKG_INSTALL) -d $(STAGING) $(LISP_STAGING)
111 $(PKG_INSTALL) -m 644 $(SOURCES) $(EXTRA_SRC) $(OBJECTS) $(EXTRA_OBJ) \
114 $(TAR) $(TAR_FLAGS) $(PACKAGE)-$(VER)-pkg.tar.gz ./*)
116 upgrade: uninstall install
120 # rm -f $(INFO_DIR)/$(INFO_FILES)
125 auto-autoloads.el* custom-*.el*
128 rm -f core* *~ TAGS tags emoney-version.el*
138 $(TAR) $(TAR_FLAGS) $(PACKAGE)-$(VER).tar.gz ./$(PACKAGE)/)
140 .PHONY: emoney-version.el version