Changed indentation to avoid a gcc warning.
[mymail.git] / Makefile
1
2 #
3 #  Copyright (c) 2013 Francois Fleuret
4 #  Written by Francois Fleuret <francois@fleuret.org>
5 #
6 #  This file is part of mymail.
7 #
8 #  mymail is free software: you can redistribute it and/or modify
9 #  it under the terms of the GNU General Public License version 3 as
10 #  published by the Free Software Foundation.
11 #
12 #  mymail is distributed in the hope that it will be useful, but
13 #  WITHOUT ANY WARRANTY; without even the implied warranty of
14 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 #  General Public License for more details.
16 #
17 #  You should have received a copy of the GNU General Public License
18 #  along with mymail.  If not, see <http://www.gnu.org/licenses/>.
19 #
20
21 BINARY_PATH = $(DESTDIR)/usr/local/bin
22 MAN_PATH = $(DESTDIR)/usr/local/share/man/man1
23
24 LDFLAGS=
25
26 UNAME=\"$(shell uname -srmn)\"
27
28 ifeq ($(DEBUG),yes)
29   OPTIMIZE_FLAG = -ggdb3 -DDEBUG -fno-omit-frame-pointer
30 else
31   OPTIMIZE_FLAG = -O2
32 endif
33
34 CFLAGS = -Wall -Wextra -ansi -pedantic -DUNAME="$(UNAME)" $(OPTIMIZE_FLAG)
35
36 all: mymail
37
38 mymail: mymail.o
39         $(CC) -o $@ $^ $(LDFLAGS)
40
41 install: mymail
42         mkdir -p $(BINARY_PATH) $(MAN_PATH)
43         install -m 755 mymail $(BINARY_PATH)
44         install -m 644 mymail.1 $(MAN_PATH)
45         gzip $(MAN_PATH)/mymail.1
46
47 uninstall:
48         rm $(BINARY_PATH)/mymail
49         rm $(MAN_PATH)/mymail.1.gz
50
51 clean:
52         rm -f *.o mymail