# Makefile for ctct # # Copyright 2015, 2016 Einhard Leichtfuß # # This file is part of ctct. # # ctct is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ctct 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 Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with ctct. If not, see . # TARGET = @PACKAGE_NAME@ VERSION = @PACKAGE_VERSION@ # for some reason, autoconf references to ${PACKAGE_TARNAME} in docdir PACKAGE_TARNAME = @PACKAGE_TARNAME@ SRCS = @PACKAGE_NAME@.c DOCS = COPYING README CHANGELOG CONFIGS = config.sh INSTALL = install INSTALL_PROGRAM = $(INSTALL) -m 755 INSTALL_DATA = $(INSTALL) -m 644 INSTALL_DIR = $(INSTALL) -d -m 755 prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ datarootdir = @datarootdir@ sysconfdir = @sysconfdir@ confdir = @confdir@ docdir = @docdir@ bash_completion_dir = @bash_completion_dir@ mandir = @mandir@ man1dir = ${mandir}/man1 man1ext = .1 all: $(TARGET) install: installdirs $(INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(bindir)/ $(INSTALL_DATA) $(CONFIGS) $(DESTDIR)$(confdir)/ $(INSTALL_DATA) $(DOCS) $(DESTDIR)$(docdir)/ $(INSTALL_DATA) $(TARGET).bash_completion \ $(DESTDIR)$(bash_completion_dir)/$(TARGET) $(INSTALL_DATA) $(TARGET)$(man1ext) $(DESTDIR)$(man1dir)/ installdirs: $(INSTALL_DIR) $(DESTDIR)$(bindir) $(INSTALL_DIR) $(DESTDIR)$(confdir) $(INSTALL_DIR) $(DESTDIR)$(docdir) $(INSTALL_DIR) $(DESTDIR)$(bash_completion_dir) $(INSTALL_DIR) $(DESTDIR)$(man1dir) uninstall: $(RM) $(DESTDIR)$(bindir)/$(TARGET) # only remove configuration file if unchanged for file in $(CONFIGS); do \ if cmp $$file $(DESTDIR)$(confdir)/$$file; then \ $(RM) $(DESTDIR)$(confdir)/$$file; \ fi \ done -$(RM) -d $(DESTDIR)$(confdir) for file in $(DOCS); do \ $(RM) $(DESTDIR)$(docdir)/$$file; \ done -$(RM) -d $(DESTDIR)$(docdir) $(RM) $(DESTDIR)$(bash_completion_dir)/$(TARGET) $(RM) $(DESTDIR)$(man1dir)/$(TARGET)$(man1ext) .PHONY: install installdirs uninstall