File: Makefile.in

package info (click to toggle)
dwdiff 2.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 540 kB
  • sloc: ansic: 4,072; sh: 685; makefile: 83; python: 20
file content (108 lines) | stat: -rw-r--r-- 3,975 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Copyright (C) 2006-2010 G.P. Halkes
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
.POSIX:

# C-compiler flags
# If strdup is not provided by the library, add -DNO_STRDUP.
CFLAGS=-O2

# Installation prefix
prefix=/usr/local

# Gettext configuration
# GETTEXTFLAGS should contain -DUSE_GETTEXT to enable gettext translations
# GETTEXTLIBS should contain all link flags to allow linking with gettext, if
# it has been enabled. The GNU libc already contains the gettext library, so
# there is no need to add any flags. Otherwise, -lintl is usually required, and
# sometimes -liconv as well.
GETTEXTFLAGS=
GETTEXTLIBS=

# Gettext related
# LOCALEDIR: the directory where the locale dependant files should be installed.
# LINGUAS: translations to be installed. Look in po directory for available
#  translations.
LOCALEDIR=$(prefix)/share/locale
LINGUAS=

# Unicode/ICU config
# If unicode support is to be enabled, the following flags should be set
# ICUFLAGS: should at least be set to -DUSE_UNICODE. If the nl_langinfo
#  function is available it should also include -DUSE_NL_LANGINFO. Furthermore
#  it should include any C preprocessor flags that are required for building.
#  Usually this can be `pkg-config --cflags icu-uc`.
# ICULIBS: Flags to link to ICU, usually `pkg-config --libs icu-uc`
ICUFLAGS=
ICULIBS=

# Install program to use (should provide -m and -d options)
INSTALL=install

# dwfilter on/off. To disable the compilation of dwfilter, comment the next
# line or set DWFILTER to empty
DWFILTER=yes

# Miscelaneous install paths
bindir=$(prefix)/bin
docdir=$(prefix)/share/doc/dwdiff-2.1.4
mandir=$(prefix)/share/man

all: dwdiff $(DWFILTER:yes=dwfilter) linguas

.PHONY: all clean dist-clean install dwdiff-install lingua-install linguas

OBJECTS_DWDIFF=src/doDiff.o src/diff/analyze.o src/file.o src/option.o src/unicode.o src/buffer.o src/hashtable.o src/profile.o src/dwdiff.o src/util.o src/tempfile.o src/stream.o
OBJECTS_DWFILTER=src/dwfilter.o src/util.o

clean:
	rm -rf src/*.o po/*.mo

dist-clean: clean
	rm -rf dwdiff config.log Makefile

.c.o:
	$(CC) $(CFLAGS) -Isrc $(GETTEXTFLAGS) -DOPTION_STRDUP=strdupA -DLOCALEDIR=\"$(LOCALEDIR)\" $(ICUFLAGS) -c -o $@ $<

dwdiff: $(OBJECTS_DWDIFF)
	$(CC) $(CFLAGS) $(LDFLAGS) -o dwdiff $(OBJECTS_DWDIFF) $(LDLIBS) $(ICULIBS) $(GETTEXTLIBS)

dwfilter: $(OBJECTS_DWFILTER)
	$(CC) $(CFLAGS) $(LDFLAGS) -o dwfilter $(OBJECTS_DWFILTER) $(LDLIBS) $(ICULIBS) $(GETTEXTLIBS)


linguas:
	cd po && $(MAKE) "LINGUAS=$(LINGUAS)" linguas

# Macros to make DESTDIR support more readable
_bindir=$(DESTDIR)$(bindir)
_docdir=$(DESTDIR)$(docdir)
_mandir=$(DESTDIR)$(mandir)

install: dwdiff-install lingua-install

dwdiff-install: dwdiff $(DWFILTER:yes=dwfilter)
	$(INSTALL) -d "$(_bindir)"
	$(INSTALL) dwdiff "$(_bindir)"
	if [ -n "$(DWFILTER)" ] ; then $(INSTALL) dwfilter "$(_bindir)" ; fi
	$(INSTALL) -d "$(_mandir)/man1"
	$(INSTALL) -m 644 "man/dwdiff.1" "$(_mandir)/man1"
	if [ -n "$(DWFILTER)" ] ; then $(INSTALL) -m 644 "man/dwfilter.1" "$(_mandir)/man1" ; fi
	$(INSTALL) -d "$(_docdir)"
	$(INSTALL) -m 644 README COPYING Changelog "$(_docdir)"

# Work around empty LINGUAS list. Some shells don't like empty lists in for-loops
lingua-install:
	if [ -n "$(LINGUAS)" ] ; then \
		mandir="$(_mandir)" LINGUAS="$(LINGUAS)" INSTALL="$(INSTALL)" ./install-manpages $(DWFILTER) ;\
		cd po && $(MAKE) "LOCALEDIR=$(DESTDIR)$(LOCALEDIR)" "INSTALL=$(INSTALL)" "LINGUAS=$(LINGUAS)" lingua-install ;\
	fi