1#
2# $Id: Makefile,v 1.27 2008/01/15 18:10:44 dtynan Exp $
3#
4# Copyright (c) 2003, Kalopa Media Limited.  All rights reserved.
5# Copyright (c) 2005, Kalopa Research Limited.  All rights reserved.
6# This is free software; you can redistribute it and/or modify it
7# under the terms of the GNU General Public License as published
8# by the Free Software Foundation; either version 2, or (at your
9# option) any later version.
10#
11# It is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
14# License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this product; see the file COPYING.  If not, write to
18# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
19# USA.
20#
21# THIS SOFTWARE IS PROVIDED BY KALOPA RESEARCH LIMITED "AS IS" AND
22# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24# PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL KALOPA
25# RESEARCH LIMITED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
28# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
31# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32# THE POSSIBILITY OF SUCH DAMAGE.
33#
34# ABSTRACT
35#
36# $Log: Makefile,v $
37# Revision 1.27  2008/01/15 18:10:44  dtynan
38# Changed to use new company name and copyright, also fixed a few old
39# files with the wrong license.
40#
41# Revision 1.26  2007/10/29 17:23:39  dtynan
42# Extensive changes to handle hourly billing and various other tweaks.
43#
44# Revision 1.25  2006/10/01 10:32:33  dtynan
45# Major changes for VAT.
46#
47# Revision 1.24  2005/12/18 16:11:53  dtynan
48# Added a new program to generate credit notes.
49#
50# Revision 1.23  2005/08/12 19:51:18  dtynan
51# Converted to Linux make format.
52#
53# Revision 1.22  2005/08/12 18:56:50  dtynan
54# Renamed 'sendinvoice' to 'remind' because it now sends statements.
55#
56# Revision 1.21  2005/04/11 21:16:32  dtynan
57# Cleaned up the code a bit and also ensured that without the -p option
58# to geninvoice, the output goes to stdout.  Could be nice to have a -o
59# option for this (and statement.c).
60#
61# Revision 1.20  2005/04/11 17:51:57  dtynan
62# New program to produce a customer statement.
63#
64# Revision 1.19  2005/03/31 10:16:11  dtynan
65# First pass at producing a generic billing system based on what's in
66# the sales order table.
67#
68# Revision 1.18  2005/03/22 09:41:24  dtynan
69# Extensive upgrade to make sure the copyright block was
70# consistent and GPL'ed.
71#
72# Revision 1.17  2005/03/09 11:22:12  dtynan
73# Removed custcode from the customer table.  Now replaced with ccode
74# from the contact table.
75#
76# Revision 1.16  2005/03/08 16:38:19  dtynan
77# Added a new function to auto-generate a Google AdSense invoice (once
78# payment has been received) and removed the vatcode() function.
79#
80# Revision 1.15  2005/02/17 17:17:49  dtynan
81# Fixed some issues with directory prefixes.
82#
83# Revision 1.14  2005/01/13 17:44:25  dtynan
84# Added new program to post a customer payment to the database.  Also did cleanups
85# of functions across the board.
86#
87# Revision 1.13  2004/07/16 19:23:32  dtynan
88# Extensive changes to split the invoicing into posting and generating.
89# Also fixed some bugs in the site billing code, added a default nominal
90# account (5060) and fixed some bugs in the invoice emailing code.  Added
91# makepath() calls to generate the correct paths.
92#
93# Revision 1.12  2004/05/12 15:21:02  dtynan
94# Massive check-in of various changes, mostly around DBOW and directory
95# reorganization (moved to /u/beanie).
96#
97# Revision 1.11  2004/01/05 19:05:48  dtynan
98# Added program to show outstanding debtors.
99#
100# Revision 1.10  2004/01/05 18:09:17  dtynan
101# Lots of changes to help automate invoice generation and emailing.
102#
103# Revision 1.9  2004/01/05 11:53:44  dtynan
104# Various changes around the filesystem layout and other minor details.
105#
106# Revision 1.8  2003/12/09 12:30:14  dtynan
107# Moved location of invoice template and added nominal accounts data.
108#
109# Revision 1.7  2003/11/08 16:13:53  dtynan
110# Fixed a couple of portability issues.
111#
112# Revision 1.6  2003/11/08 15:23:21  dtynan
113# Added a new file for generating website invoices, and modified the
114# geninvoice code to automatically post invoices.
115#
116# Revision 1.5  2003/11/07 16:14:15  dtynan
117# More install-rule errors.
118#
119# Revision 1.4  2003/11/07 16:07:16  dtynan
120# Fixed bux in install rule.
121#
122# Revision 1.3  2003/11/07 15:58:10  dtynan
123# Fixed implementation of invoice generation and emailing thereof.
124#
125include ../beanie.mk
126
127OBJS=	geninvoice.o postinvoice.o sendinvoice.o statement.o \
128	crnote.o runorders.o runhours.o arreport.o invemail.o
129EXES=	geninvoice postinvoice remind statement \
130	crnote runorders runhours arreport
131
132all:	$(EXES)
133
134install: $(EXES)
135	-mkdir -p $(BEANIEROOT)/bin
136	$(INSTALL) -C -m 555 -s $(EXES) $(BEANIEROOT)/bin
137
138clean:
139	rm -f $(EXES) $(OBJS) a.out errs *.core
140
141tags:
142	ctags ../lib/*.[ch] *.[ch]
143
144geninvoice: geninvoice.o
145	$(CC) -o geninvoice geninvoice.o $(LDFLAGS)
146
147postinvoice: postinvoice.o invemail.o
148	$(CC) -o postinvoice postinvoice.o invemail.o $(LDFLAGS)
149
150crnote: crnote.o
151	$(CC) -o crnote crnote.o $(LDFLAGS)
152
153remind: sendinvoice.o invemail.o
154	$(CC) -o remind sendinvoice.o invemail.o $(LDFLAGS)
155
156statement: statement.o
157	$(CC) -o statement statement.o $(LDFLAGS)
158
159runorders: runorders.o
160	$(CC) -o runorders runorders.o $(LDFLAGS)
161
162runhours: runhours.o
163	$(CC) -o runhours runhours.o $(LDFLAGS)
164
165arreport: arreport.o
166	$(CC) -o arreport arreport.o $(LDFLAGS)
167