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-load.el*)
85 PRELOADS = -eval \("push default-directory load-path"\)
86 AUTOLOAD_PACKAGE_NAME = (setq autoload-package-name \"$(PACKAGE)\")
87 AUTOLOAD_FILE = (setq generated-autoload-file \"./auto-autoloads.el\")
93 all:: emoney-version.el autoloads customloads compile
95 autoloads: auto-autoloads.el
97 customloads: custom-load.el
99 compile: $(SOURCES) auto-autoloads.el custom-load.el
100 $(XEMACS) $(XEMACS_FLAGS) $(PRELOADS) \
103 -f batch-byte-compile $^
105 auto-autoloads.el : $(SOURCES) emoney-version.el
106 $(XEMACS) $(XEMACS_FLAGS) $(PRELOADS) \
107 -eval "$(AUTOLOAD_PACKAGE_NAME)" \
108 -eval "$(AUTOLOAD_FILE)" \
109 -l autoload -f batch-update-autoloads $^
110 @rm -f $(AUTOLOAD_PATH)/auto-autoloads.el~
112 custom-load.el : $(SOURCES)
113 $(XEMACS) $(XEMACS_FLAGS) $(PRELOADS) -l cus-dep \
114 -f Custom-make-dependencies ./
115 @touch ./custom-load.el
116 @rm -f ./custom-load.el~
119 echo ";;; Automatically generated file -- DO NOT EDIT OR DELETE" > $@
120 echo ";;;###autoload" >> $@
121 echo "(defconst emoney-version" >> $@
122 if [[ -d ".git" && -x `which git 2>/dev/null` ]]; then \
123 printf ' "%s"' `git describe` >> $@; \
125 echo -n ' "$(VER)"' >> $@; \
128 echo "(provide 'emoney-version)" >> $@
130 version: emoney-version.el
133 $(INSTALL) -d $(LISP_DIR)
134 $(INSTALL) -m 644 $(SOURCES) $(EXTRA_SRC) $(OBJECTS) $(EXTRA_OBJ) \
138 $(PKG_INSTALL) -d $(STAGING) $(LISP_STAGING)
139 $(PKG_INSTALL) -m 644 $(SOURCES) $(EXTRA_SRC) $(OBJECTS) $(EXTRA_OBJ) \
142 $(TAR) $(TAR_FLAGS) $(PACKAGE)-$(VER)-pkg.tar.gz ./*)
144 upgrade: uninstall install
148 # rm -f $(INFO_DIR)/$(INFO_FILES)
152 rm -f $(OBJECTS) $(INFO_FILES) \
153 auto-autoloads.el* custom-load.el*
156 rm -f core* *~ TAGS tags emoney-version.el*
166 $(TAR) $(TAR_FLAGS) $(PACKAGE)-$(VER).tar.gz ./$(PACKAGE)/)
168 .PHONY: emoney-version.el version