# Makefile for ctct # # Copyright 2015, 2016, 2018 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 # If there were more than one, a separate confdir should be created. CONFIG = ctct_config INSTALL = install INSTALL_PROGRAM = $(INSTALL) -m 755 INSTALL_DATA = $(INSTALL) -m 644 INSTALL_DIR = $(INSTALL) -d -m 755 RM = rm prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ datarootdir = @datarootdir@ sysconfdir = @sysconfdir@ docdir = @docdir@ bash_completion_dir = @bash_completion_dir@ mandir = @mandir@ man1dir = $(mandir)/man1 man5dir = $(mandir)/man5 man1ext = .1 man5ext = .5 all: $(TARGET) install: installdirs $(INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(bindir)/ $(INSTALL_DATA) $(CONFIG) $(DESTDIR)$(sysconfdir)/ $(INSTALL_DATA) $(DOCS) $(DESTDIR)$(docdir)/ $(INSTALL_DATA) bash_completion \ $(DESTDIR)$(bash_completion_dir)/$(TARGET) $(INSTALL_DATA) $(TARGET)$(man1ext) $(DESTDIR)$(man1dir)/ $(INSTALL_DATA) $(CONFIG)$(man5ext) $(DESTDIR)$(man5dir)/ installdirs: $(INSTALL_DIR) $(DESTDIR)$(bindir) $(INSTALL_DIR) $(DESTDIR)$(sysconfdir) $(INSTALL_DIR) $(DESTDIR)$(docdir) $(INSTALL_DIR) $(DESTDIR)$(bash_completion_dir) $(INSTALL_DIR) $(DESTDIR)$(man1dir) $(INSTALL_DIR) $(DESTDIR)$(man5dir) uninstall: $(RM) $(DESTDIR)$(bindir)/$(TARGET) # Only remove configuration file if unchanged. if cmp $(CONFIG) $(DESTDIR)$(sysconfdir)/$(CONFIG); \ then \ $(RM) $(DESTDIR)$(sysconfdir)/$(CONFIG); \ fi 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) $(RM) $(DESTDIR)$(man5dir)/$(CONFIG)$(man5ext) .PHONY: install installdirs uninstall # vi: ts=2 sw=2