Initial tla -> git updates/conversions
[emoney] / Makefile
CommitLineData
a7161eda 1## Makefile for eMoney -*-Makefile-*-
a7161eda 2##
ee98102e 3## Copyright (C) 2003 - 2011 Steve Youngs
a7161eda
SY
4##
5## This file is part of eMoney.
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
34PACKAGE = emoney
ee98102e 35VER = 1.0
a7161eda
SY
36
37# csh... yell no, we won't go!
38SHELL = /bin/sh
39
40# Programs and their flags.
41ifndef XEMACS
42 XEMACS = sxemacs
43endif
44XEMACS_FLAGS = -batch -no-autoloads
45INSTALL = install
46PKG_INSTALL = $(INSTALL)
47TAR = tar
48TAR_FLAGS = \
49 --create \
50 --owner=0 \
51 --group=0 \
52 --gzip \
53 --file
54
55
56# Our prefix. Everything hangs off this.
57ifndef PREFIX
58 ifeq ('$(XEMACS)','sxemacs')
59 PREFIX = /usr/local/share/sxemacs/site-packages
60 else
61 PREFIX = /usr/local/lib/xemacs/site-packages
62 endif
63endif
64
65# Where the lisp files go.
66LISP_DIR = $(PREFIX)/lisp/$(PACKAGE)
67
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
70# build the tarball.
71STAGING = ../build-pkg
72INFO_STAGING = $(STAGING)/info
73LISP_STAGING = $(STAGING)/lisp/$(PACKAGE)
74
75
76############################################################################
77## No User Configurable Items Below Here ##
78############################################################################
79
80SOURCES = $(wildcard ./emoney*.el)
81OBJECTS = $(SOURCES:.el=.elc)
82EXTRA_SRC =
83EXTRA_OBJ = $(wildcard ./auto-autoloads.el*) $(wildcard ./custom-load.el*)
84
85PRELOADS = -eval \("push default-directory load-path"\)
86AUTOLOAD_PACKAGE_NAME = (setq autoload-package-name \"$(PACKAGE)\")
87AUTOLOAD_FILE = (setq generated-autoload-file \"./auto-autoloads.el\")
88
89
90.SUFFIXES:
91.SUFFIXES: .elc .el
92
93all:: emoney-version.el autoloads customloads compile
94
95autoloads: auto-autoloads.el
96
97customloads: custom-load.el
98
99compile: $(SOURCES) auto-autoloads.el custom-load.el
100 $(XEMACS) $(XEMACS_FLAGS) $(PRELOADS) \
101 -l bytecomp \
102 -l byte-optimize \
103 -f batch-byte-compile $^
104
105auto-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~
111
112custom-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~
117
118emoney-version.el:
119 echo ";;; Automatically generated file -- DO NOT EDIT OR DELETE" > $@
120 echo ";;;###autoload" >> $@
121 echo "(defconst emoney-version" >> $@
ee98102e
SY
122 if [[ -d ".git" && -x `which git 2>/dev/null` ]]; then \
123 printf ' "%s"' `git describe` >> $@; \
a7161eda
SY
124 else \
125 echo -n ' "$(VER)"' >> $@; \
126 fi
127 echo ")" >> $@
128 echo "(provide 'emoney-version)" >> $@
129
130version: emoney-version.el
131
132install: all
133 $(INSTALL) -d $(LISP_DIR)
134 $(INSTALL) -m 644 $(SOURCES) $(EXTRA_SRC) $(OBJECTS) $(EXTRA_OBJ) \
135 $(LISP_DIR)
136
137pkg: all
138 $(PKG_INSTALL) -d $(STAGING) $(LISP_STAGING)
139 $(PKG_INSTALL) -m 644 $(SOURCES) $(EXTRA_SRC) $(OBJECTS) $(EXTRA_OBJ) \
140 $(LISP_STAGING)
141 (cd $(STAGING); \
142 $(TAR) $(TAR_FLAGS) $(PACKAGE)-$(VER)-pkg.tar.gz ./*)
143
144upgrade: uninstall install
145
146uninstall::
147 rm -rf $(LISP_DIR)
148 # rm -f $(INFO_DIR)/$(INFO_FILES)
149
150
151clean::
152 rm -f $(OBJECTS) $(INFO_FILES) \
153 auto-autoloads.el* custom-load.el*
154
155distclean: clean
156 rm -f core* *~ TAGS tags emoney-version.el*
157
158# Developer targets
159tags: TAGS
160
161TAGS: $(SOURCES)
162 etags $(SOURCES)
163
164dist: distclean
165 (cd ../ ; \
166 $(TAR) $(TAR_FLAGS) $(PACKAGE)-$(VER).tar.gz ./$(PACKAGE)/)
167
168.PHONY: emoney-version.el version