Debian Codegraph @

modules/lsp-plugins-para-equalizer/Makefile

raw
1 #!/usr/bin/make -f
2 #
3 # Copyright (C) 2026 Linux Studio Plugins Project <https://lsp-plug.in/>
4 # (C) 2026 Vladimir Sadovnikov <[email protected]>
5 #
6 # This file is part of lsp-plugins-para-equalizer
7 #
8 # lsp-plugins-para-equalizer is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU Lesser General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # any later version.
12 #
13 # lsp-plugins-para-equalizer is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU Lesser General Public License for more details.
17 #
18 # You should have received a copy of the GNU Lesser General Public License
19 # along with lsp-plugins-para-equalizer. If not, see <https://www.gnu.org/licenses/>.
20 #
21
22 # Command-line flag to silence nested $(MAKE).
23 ifneq ($(VERBOSE),1)
24 .SILENT:
25 endif
26
27 # Location
28 BASEDIR := $(CURDIR)
29 MODULES := $(BASEDIR)/modules
30 BUILDDIR := $(BASEDIR)/.build
31 CONFIG := $(BASEDIR)/.config.mk
32 PLUGINS := $(BASEDIR)/plugins.mk
33 PROJECT := $(BASEDIR)/project.mk
34
35 # Basic initialization
36 # Checks
37 ifeq ("$(wildcard $(CONFIG))", "")
38 CONFIGURED = 0
39 else
40 CONFIGURED = 1
41 endif
42
43 include $(BASEDIR)/project.mk
44
45 # Setup paths
46 CHK_CONFIG = test -f "$(CONFIG)" || (echo "System not properly configured. Please launch 'make config' first" && exit 1)
47 DISTSRC_PATH = $(BUILDDIR)/distsrc
48 DISTSRC = $(DISTSRC_PATH)/$(ARTIFACT_NAME)
49 DISTSRC_DIRS = \
50 $(if $(wildcard $(BASEDIR)/include/*), $(BASEDIR)/include) \
51 $(if $(wildcard $(BASEDIR)/src/*), $(BASEDIR)/src) \
52 $(if $(wildcard $(BASEDIR)/make/*), $(BASEDIR)/make) \
53 $(if $(wildcard $(BASEDIR)/res/*), $(BASEDIR)/res)
54 DISTSRC_FILES = \
55 $(wildcard $(BASEDIR)/CHANGELOG) \
56 $(wildcard $(BASEDIR)/COPYING*) \
57 $(wildcard $(BASEDIR)/*LICENSE*) \
58 $(wildcard $(BASEDIR)/Makefile) \
59 $(wildcard $(BASEDIR)/*.mk) \
60 $(wildcard $(BASEDIR)/*.md) \
61 $(wildcard $(BASEDIR)/*.txt)
62
63 .DEFAULT_GOAL := all
64 .PHONY: all compile install uninstall clean package
65
66 compile all install uninstall package:
67 $(CHK_CONFIG)
68 $(MAKE) -C "$(BASEDIR)/src" $(@) VERBOSE="$(VERBOSE)" CONFIG="$(CONFIG)" DESTDIR="$(DESTDIR)"
69
70 clean:
71 echo "Cleaning build directory $(BUILDDIR)"
72 -rm -rf $(BUILDDIR)
73 echo "Clean OK"
74
75 # Module-related tasks
76 .PHONY: fetch tree prune
77 fetch:
78 $(CHK_CONFIG)
79 echo "Fetching desired source code dependencies"
80 $(MAKE) -f "make/modules.mk" $(@) VERBOSE="$(VERBOSE)" BASEDIR="$(BASEDIR)" CONFIG="$(CONFIG)"
81 echo "Fetch OK"
82
83 tree:
84 echo "Fetching all possible source code dependencies"
85 $(MAKE) -f "make/modules.mk" $(@) VERBOSE="$(VERBOSE)" BASEDIR="$(BASEDIR)" TREE="1"
86 echo "Fetch OK"
87
88 prune: clean
89 echo "Pruning the whole project tree"
90 $(MAKE) -f "make/modules.mk" prune VERBOSE="$(VERBOSE)" BASEDIR="$(BASEDIR)" CONFIG="$(CONFIG)"
91 $(MAKE) -f "make/modules.mk" prune VERBOSE="$(VERBOSE)" BASEDIR="$(BASEDIR)" TREE="1"
92 -rm -rf "$(CONFIG)"
93 echo "Prune OK"
94
95 # Configuration-related targets
96 .PHONY: config testconfig devel help chkconfig
97
98 config: CONFIG_FLAGS=
99 testconfig: CONFIG_FLAGS=TEST=1
100 devel: CONFIG_FLAGS=TEST=1 DEVEL=1
101
102 config testconfig devel:
103 $(MAKE) -f "$(BASEDIR)/make/configure.mk" config VERBOSE="$(VERBOSE)" CONFIG="$(CONFIG)" -$(MAKEFLAGS)
104
105 # Release-related targets
106 .PHONY: distsrc
107 distsrc:
108 echo "Building source code archive"
109 mkdir -p "$(DISTSRC)/modules"
110 $(MAKE) -f "make/modules.mk" tree TREE="1" BUILD_FEATURES="$(FEATURES)" VERBOSE="$(VERBOSE)" BASEDIR="$(BASEDIR)" MODULES="$(DISTSRC)/modules"
111 $(if $(DISTSRC_DIRS), cp -R $(DISTSRC_DIRS) "$(DISTSRC)/")
112 $(if $(DISTSRC_FILES), cp $(DISTSRC_FILES) "$(DISTSRC)/")
113 find "$(DISTSRC)" -iname '.git' | xargs -exec rm -rf {}
114 find "$(DISTSRC)" -iname '.gitignore' | xargs -exec rm -rf {}
115 tar -C $(DISTSRC_PATH) -czf "$(BUILDDIR)/$(ARTIFACT_NAME)-src-$(ARTIFACT_VERSION).tar.gz" "$(ARTIFACT_NAME)"
116 echo "Created archive: $(BUILDDIR)/$(ARTIFACT_NAME)-src-$(ARTIFACT_VERSION).tar.gz"
117 rm -rf $(DISTSRC_PATH)
118 echo "Build OK"
119
120 # Help
121 help:
122 echo "Available targets:"
123 echo " all Build all binaries"
124 echo " clean Clean all build files and configuration file"
125 echo " config Configure build"
126 echo " devel Configure build as development build"
127 echo " distsrc Make tarball with source code for packagers"
128 echo " fetch Fetch all desired source code dependencies from git"
129 echo " help Print this help message"
130 echo " info Output build configuration"
131 echo " install Install all binaries into the system"
132 echo " package Create archive files with binaries"
133 echo " prune Cleanup build and all fetched dependencies from git"
134 echo " testconfig Configure test build"
135 echo " tree Fetch all possible source code dependencies from git"
136 echo " to make source code portable between machines"
137 echo " uninstall Uninstall binaries"
138 echo ""
139 $(MAKE) -f "$(BASEDIR)/make/configure.mk" $(@) VERBOSE="$(VERBOSE)"
140 echo ""
141 echo "Available FEATURES:"
142 echo " clap CLAP plugins"
143 echo " doc Generate standalone HTML documentation"
144 echo " gst GStreamer plugins"
145 echo " jack JACK audio backend for standalone plugins"
146 echo " ladspa LADSPA plugins"
147 echo " launcher Build launcher application for standalone plugin applications"
148 echo " lv2 LV2 plugins"
149 echo " standalone Standalone plugin applications"
150 echo " vst2 VST 2.x plugin binaries"
151 echo " vst3 VST 3.x plugin binaries"
152 echo " xdg Desktop integration icons"
153
154