AUTHORS: Add Ken Dawson.
[metastore.git] / Makefile
blobde5b84af0cfbe7d5259d479a4858f5f4b6ea7faf
2 # Copyright (C) 2007 David Härdeman <david@hardeman.nu>
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; version 2 of the License.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 # Generic settings
20 CC = gcc
21 CFLAGS += -g -Wall -pedantic -std=c99 -D_FILE_OFFSET_BITS=64 -O2
22 LDFLAGS +=
23 INCLUDES =
24 INSTALL = install -c
25 INSTALL_PROGRAM = ${INSTALL}
26 INSTALL_DATA = ${INSTALL} -m 644
27 COMPILE = $(CC) $(INCLUDES) $(CFLAGS) $(CPPFLAGS)
28 LINK = $(CC) $(CFLAGS) $(LDFLAGS)
29 OBJECTS = utils.o metastore.o metaentry.o
30 HEADERS = utils.h metastore.h metaentry.h
32 DESTDIR ?=
33 prefix = /usr
34 usrbindir = ${prefix}/bin
35 mandir = ${prefix}/share/man
38 # Targets
41 all: metastore
42 .DEFAULT: all
45 %.o: %.c $(HEADERS)
46 $(COMPILE) -o $@ -c $<
49 metastore: $(OBJECTS)
50 $(LINK) -o $@ $^
53 install: all
54 $(INSTALL_DATA) -D metastore.1 $(DESTDIR)$(mandir)/man1/metastore.1
55 $(INSTALL_PROGRAM) -D metastore $(DESTDIR)$(usrbindir)/metastore
58 uninstall:
59 - rm -f $(DESTDIR)$(mandir)/man1/metastore.1
60 - rm -f $(DESTDIR)$(usrbindir)/metastore
63 clean:
64 - rm -f *.o metastore
67 .PHONY: install uninstall clean all