# Copyright (C) 2006-2007 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 . .POSIX: # Inserted settings CC=cc LDFLAGS= -L/usr/local/lib # C-compiler flags CFLAGS=-fno-common # 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=-DUSE_GETTEXT 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=de nl # diff program configuration # DIFF should contain the diff program to be used # DIFF_FLAGS can contain any of the following flags: # -DNO_MINUS_A if the diff program does not provide the -a option to treat all # files as text files. # -DNO_MINUS_I if the diff program does not provide the -i option to make diff # ignore case in comparisons DIFF=diff DIFF_FLAGS= # Install program to use (should provide -m and -d options) INSTALL=/usr/bin/install # Miscelaneous install paths bindir=$(prefix)/bin docdir=$(prefix)/share/doc/dwdiff-1.3 mandir=$(prefix)/share/man all: dwdiff linguas .PHONY: all clean dist-clean install dwdiff-install lingua-install linguas CSOURCES=src/buffer.c src/doDiff.c src/dwdiff.c src/option.c src/tempfile.c OBJECTS=$(CSOURCES:.c=.o) clean: rm -rf src/*.o po/*.mo dist-clean: clean rm -rf dwdiff .c.o: $(CC) $(CFLAGS) $(GETTEXTFLAGS) -DLOCALEDIR=\"$(LOCALEDIR)\" -c -o $@ $< dwdiff: $(OBJECTS) $(CC) $(CFLAGS) $(LDFLAGS) -o dwdiff $(OBJECTS) $(LDLIBS) $(GETTEXTLIBS) linguas: cd po && $(MAKE) "LINGUAS=$(LINGUAS)" linguas install: dwdiff-install lingua-install dwdiff-install: dwdiff $(INSTALL) -d "$(bindir)" $(INSTALL) dwdiff "$(bindir)" $(INSTALL) -d "$(mandir)/man1" $(INSTALL) -m 644 "man/dwdiff.1" "$(mandir)/man1" $(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 ;\ cd po && $(MAKE) "LOCALEDIR=$(LOCALEDIR)" "INSTALL=$(INSTALL)" "LINGUAS=$(LINGUAS)" lingua-install ;\ fi