File: Makefile

package info (click to toggle)
lsp-plugins 1.2.26-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 130,004 kB
  • sloc: cpp: 642,749; xml: 78,805; makefile: 14,229; php: 1,361; sh: 185
file content (99 lines) | stat: -rw-r--r-- 4,009 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
#
# Copyright (C) 2024 Linux Studio Plugins Project <https://lsp-plug.in/>
#           (C) 2024 Vladimir Sadovnikov <sadko4u@gmail.com>
#
# This file is part of lsp-plugins-shared
#
# lsp-plugins-shared is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# lsp-plugins-shared 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with lsp-plugins-shared.  If not, see <https://www.gnu.org/licenses/>.
#

ifneq ($(VERBOSE),1)
.SILENT:
endif

MODDIR                  = $(CURDIR)/..
CONFIG                 := $(MODDIR)/.config.mk
DESTDIR                :=
ETCDIR                 := /etc
SHAREDDIR              := /usr/local/share

include $(CONFIG)

XDG_ICON_PATH   = $(DESTDIR)$(SHAREDDIR)/icons/hicolor
XDG_MENU_PATH   = $(DESTDIR)$(ETCDIR)/xdg/menus/applications-merged
XDG_APP_PATH    = $(DESTDIR)$(SHAREDDIR)/applications
XDG_DIR_PATH    = $(DESTDIR)$(SHAREDDIR)/desktop-directories
XDG_FILES       = $(file < $(FILE_LIST))
XDG_FILE_PATH   = $(foreach file,$(XDG_FILES),$(XDG_APP_PATH)/$(notdir $(file)))

# Form the batch file
$(file > $(BATCH_FILE),) \
$(file >> $(BATCH_FILE),install_xdg: install_xdg_prepare) \
$(foreach item,$(XDG_FILES),\
    $(file >> $(BATCH_FILE),$(shell printf "\t")cp "$(item)" "$$(XDG_APP_PATH)/") \
)
$(file >> $(BATCH_FILE),) \
\
$(file >> $(BATCH_FILE),uninstall_xdg: uninstall_xdg_prepare) \
$(foreach item,$(XDG_FILE_PATH),\
    $(file >> $(BATCH_FILE),$(shell printf "\t")-rm "$(item)") \
)
$(file >> $(BATCH_FILE),) \

include $(BATCH_FILE)

.PHONY: all install_xdg uninstall_xdg install_xdg_prepare uninstall_xdg_prepare
.DEFAULT_TARGET=all

all:

install_xdg_prepare:
	mkdir -p "$(XDG_APP_PATH)"
	mkdir -p "$(XDG_DIR_PATH)"
	mkdir -p "$(XDG_MENU_PATH)"
	mkdir -p "$(XDG_ICON_PATH)/scalable/apps"
	mkdir -p "$(XDG_ICON_PATH)/16x16/apps"
	mkdir -p "$(XDG_ICON_PATH)/22x22/apps"
	mkdir -p "$(XDG_ICON_PATH)/24x24/apps"
	mkdir -p "$(XDG_ICON_PATH)/32x32/apps"
	mkdir -p "$(XDG_ICON_PATH)/48x48/apps"
	mkdir -p "$(XDG_ICON_PATH)/64x64/apps"
	mkdir -p "$(XDG_ICON_PATH)/128x128/apps"
	mkdir -p "$(XDG_ICON_PATH)/256x256/apps"
	cp -f icons/lsp-plugins/16x16.png    "$(XDG_ICON_PATH)/16x16/apps/lsp-plugins.png"
	cp -f icons/lsp-plugins/22x22.png    "$(XDG_ICON_PATH)/22x22/apps/lsp-plugins.png"
	cp -f icons/lsp-plugins/24x24.png    "$(XDG_ICON_PATH)/24x24/apps/lsp-plugins.png"
	cp -f icons/lsp-plugins/32x32.png    "$(XDG_ICON_PATH)/32x32/apps/lsp-plugins.png"
	cp -f icons/lsp-plugins/48x48.png    "$(XDG_ICON_PATH)/48x48/apps/lsp-plugins.png"
	cp -f icons/lsp-plugins/64x64.png    "$(XDG_ICON_PATH)/64x64/apps/lsp-plugins.png"
	cp -f icons/lsp-plugins/128x128.png  "$(XDG_ICON_PATH)/128x128/apps/lsp-plugins.png"
	cp -f icons/lsp-plugins/256x256.png  "$(XDG_ICON_PATH)/256x256/apps/lsp-plugins.png"
	cp -f icons/lsp-plugins/scalable.svg "$(XDG_ICON_PATH)/scalable/apps/lsp-plugins.svg"
	cp -f dirs/lsp-plugins.directory     "$(XDG_DIR_PATH)/lsp-plugins.directory"
	cp menus/lsp-plugins.menu "$(XDG_MENU_PATH)/lsp-plugins.menu"

uninstall_xdg_prepare:
	-rm -f $(XDG_DIR_PATH)/lsp-plugins.directory
	-rm -f $(XDG_MENU_PATH)/lsp-plugins.menu
	-rm -f $(XDG_ICON_PATH)/16x16/apps/lsp-plugins.png
	-rm -f $(XDG_ICON_PATH)/22x22/apps/lsp-plugins.png
	-rm -f $(XDG_ICON_PATH)/24x24/apps/lsp-plugins.png
	-rm -f $(XDG_ICON_PATH)/32x32/apps/lsp-plugins.png
	-rm -f $(XDG_ICON_PATH)/48x48/apps/lsp-plugins.png
	-rm -f $(XDG_ICON_PATH)/64x64/apps/lsp-plugins.png
	-rm -f $(XDG_ICON_PATH)/128x128/apps/lsp-plugins.png
	-rm -f $(XDG_ICON_PATH)/256x256/apps/lsp-plugins.png
	-rm -f $(XDG_ICON_PATH)/scalable/apps/lsp-plugins.svg