github.com/hugh712/snapd@v0.0.0-20200910133618-1a99902bd583/data/desktop/Makefile (about)

     1  #
     2  # Copyright (C) 2018 Canonical Ltd
     3  #
     4  # This program is free software: you can redistribute it and/or modify
     5  # it under the terms of the GNU General Public License version 3 as
     6  # published by the Free Software Foundation.
     7  #
     8  # This program is distributed in the hope that it will be useful,
     9  # but WITHOUT ANY WARRANTY; without even the implied warranty of
    10  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    11  # GNU General Public License for more details.
    12  #
    13  # You should have received a copy of the GNU General Public License
    14  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
    15  
    16  BINDIR = /usr/bin
    17  SYSCONFXDGAUTOSTARTDIR = /etc/xdg/autostart
    18  APPLICATIONSDIR = /usr/share/applications
    19  
    20  DESKTOP_SOURCES = snap-handle-link.desktop.in
    21  DESKTOP_FILES = $(DESKTOP_SOURCES:.in=)
    22  
    23  AUTOSTART_SOURCES = snap-userd-autostart.desktop.in
    24  AUTOSTART_FILES = $(AUTOSTART_SOURCES:.in=)
    25  
    26  .PHONY: all
    27  all: $(DESKTOP_FILES) $(AUTOSTART_FILES)
    28  
    29  .PHONY: install
    30  # NOTE: old (e.g. 14.04) GNU coreutils doesn't -D with -t
    31  install:: $(DESKTOP_FILES)
    32  	install -d -m 0755 $(DESTDIR)/$(APPLICATIONSDIR)
    33  	install -m 0644 -t $(DESTDIR)/$(APPLICATIONSDIR) $^
    34  
    35  install:: $(AUTOSTART_FILES)
    36  	install -d -m 0755 $(DESTDIR)/$(SYSCONFXDGAUTOSTARTDIR)
    37  	install -m 0644 -t $(DESTDIR)/$(SYSCONFXDGAUTOSTARTDIR) $^
    38  
    39  .PHONY: clean
    40  clean:
    41  	rm -f $(DESKTOP_FILES) $(AUTOSTART_FILES)
    42  
    43  %: %.in
    44  	cat $< | \
    45  		sed s:@bindir@:$(BINDIR):g | \
    46  		cat > $@