-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile.in
More file actions
232 lines (201 loc) · 7.13 KB
/
Makefile.in
File metadata and controls
232 lines (201 loc) · 7.13 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# SPDX-License-Identifier: GPL-3.0-or-later
#
# @configure_input@
# Copyright (C) 2022, 2023 Quico Augustijn
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This library is distributed "as is" 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. If your
# computer no longer boots, divides by 0 or explodes, you are the only
# one responsible. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# version 3 along with this library. If not, see
# <https://www.gnu.org/licenses/gpl-3.0.html>.
SHELL = /bin/sh
# Variables
NAME = @PACKAGE_NAME@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
MAJOR_VERSION = @MAJOR_VERSION@
CC = @CC@
AR = @AR@
RANLIB = @RANLIB@
EXE_EXT = @EXEEXT@
OBJ_EXT = @OBJEXT@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
MKDIR_P = @MKDIR_P@
LN_S = @LN_S@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
PKG_CFLAGS += @GLIB_CFLAGS@ @GIO_CFLAGS@ @GOBJECT_CFLAGS@ @GSTREAMER_CFLAGS@
PKG_LIBS += @GLIB_LIBS@ @GIO_LIBS@ @GOBJECT_LIBS@ @GSTREAMER_LIBS@
# Directory variables
builddir = @builddir@
abs_builddir = @abs_builddir@
top_builddir = @top_builddir@
top_build_prefix = @top_build_prefix@
abs_top_builddir = @abs_top_builddir@
srcdir = @srcdir@
abs_srcdir = @abs_srcdir@
top_srcdir = @top_srcdir@
abs_top_srcdir = @abs_top_srcdir@
# Common prefix for installation directories
# (following the Makefile Conventions)
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datarootdir = @datarootdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
runstatedir = @runstatedir@
includedir = @includedir@
docdir = @docdir@
infodir = @infodir@
htmldir = @htmldir@
dvidir = @dvidir@
pdfdir = @pdfdir@
psdir = @psdir@
libdir = @libdir@
localedir = @localedir@
mandir = @mandir@
# Build information
TAG = lib$(PACKAGE_TARNAME)
OUT_SHARED ?= $(TAG).so.$(PACKAGE_VERSION)
OUT_STATIC ?= $(TAG).a
DIST_PKG = $(TAG)-$(PACKAGE_VERSION)
LINK_SHARED ?= $(TAG).so.$(MAJOR_VERSION)
# Installation paths
INC_DIR = $(includedir)/$(PACKAGE_TARNAME)
PKGCONFIG_PATH = $(libdir)/pkgconfig
# Dependencies and targets
PREREQUISITE_LIB = app song player library settings intelligence song_manager \
song_metadata remote mpris statistics notifications \
file_inspector utils characters dlist memory tweaks \
static/gdbus static/gdbus static/mediaplayer2 \
static/options static/resources
HEADERS = woofer.h app.h song.h intelligence.h settings.h library.h utils.h \
authors.h constants.h resources.h
PKGCONFIG_FILE = woofer.pc
TAR_FILES = AUTHORS BUGS CODE_OF_CONDUCT.md configure configure.ac \
CONTRIBUTING.md COPYING envsetup.sh INSTALL install-sh \
Makefile.fallback Makefile.in README.md $(TAG).doap
TAR_DIRS = data doc resources src
# Compiler and linker flags
WARN_FLAGS = -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter
INC_FLAGS = -I$(SRC_DIR)
MACROS = -DG_LOG_DOMAIN=\"$(TAG)\"
DEBUG_FLAGS = -g -ggdb
# Directories used for compilation
BUILD_DIR = build
SRC_DIR = src
DATA_DIR = data
# Final library target
TARGET_SHARED ?= $(BUILD_DIR)/$(OUT_SHARED)
TARGET_STATIC ?= $(BUILD_DIR)/$(OUT_STATIC)
TARGET_LINK ?= $(BUILD_DIR)/$(LINK_SHARED)
# Sources and targets
OBJS := $(PREREQUISITE_LIB:%=$(BUILD_DIR)/%.$(OBJ_EXT))
SRCS := $(PREREQUISITE_LIB:%=$(SRC_DIR)/%.c)
# Include file location
INC_FILES = $(HEADERS:%=$(SRC_DIR)/%)
# Targets that do not generate any files
.PHONY: all install uninstall resources clean distclean mostlyclean \
maintainer-clean dist dist-gzip dist-xz installdirs
# Default target
all: $(TARGET_SHARED) $(TARGET_STATIC) $(TARGET_LINK)
# Final shared library linkage
$(TARGET_SHARED): $(OBJS)
@$(MKDIR_P) $(@D)
$(CC) -shared -o $@ $^ $(LIBS) $(PKG_LIBS) $(CFLAGS) $(LDFLAGS)
# Final static library archive creation
$(TARGET_STATIC): $(OBJS)
@$(MKDIR_P) $(@D)
$(AR) $(ARFLAGS) $@ $^
$(RANLIB) $@
# Shared library symbolic link creation
$(TARGET_LINK): $(TARGET_SHARED)
$(LN_S) -rf $^ $@
# Library object compilation
$(BUILD_DIR)/%.$(OBJ_EXT): $(SRC_DIR)/%.c $(SRC_DIR)/%.h
@$(MKDIR_P) $(@D)
$(CC) $(INC_FLAGS) $(MACROS) -fPIC -c $< -o $@ $(PKG_CFLAGS) $(WARN_FLAGS) $(DEBUG_FLAGS) $(CFLAGS) $(CPPFLAGS)
# Install required files
install:
$(MAKE) installdirs
$(INSTALL_DATA) $(TARGET_SHARED) $(DESTDIR)$(libdir)/$(OUT_SHARED)
$(INSTALL_DATA) $(TARGET_STATIC) $(DESTDIR)$(libdir)/$(OUT_STATIC)
$(LN_S) -rf $(TARGET_LINK) $(DESTDIR)$(libdir)/$(LINK_SHARED)
$(INSTALL_DATA) $(INC_FILES) $(DESTDIR)$(INC_DIR)/
$(INSTALL_DATA) $(DATA_DIR)/$(PKGCONFIG_FILE) $(DESTDIR)$(PKGCONFIG_PATH)/
# Uninstall installed files
uninstall:
-rm -fv $(DESTDIR)$(libdir)/$(OUT_SHARED)
-rm -fv $(DESTDIR)$(libdir)/$(OUT_STATIC)
-rm -fv $(DESTDIR)$(libdir)/$(LINK_SHARED)
-rm -fv $(DESTDIR)$(INC_DIR)/*
-rm -fv $(DESTDIR)$(PKGCONFIG_PATH)/$(PKGCONFIG_FILE)
# Recompile resource files
resources: resources/resources.gresource.xml
glib-compile-resources --sourcedir=resources --generate-source --internal $<
glib-compile-resources --sourcedir=resources --generate-header --internal $<
cp -f resources/resources.c src/static/resources.c
cp -f resources/resources.h src/static/resources.h
# Clean all compiled files
clean:
@$(MAKE) mostlyclean
-rm -fv $(TARGET_SHARED) $(TARGET_STATIC) $(TARGET_LINK)
# Clean all generated and compiled files
distclean:
@$(MAKE) clean
-rm -frv autom4te.cache aclocal.m4 config.log config.status Makefile $(DATA_DIR)/$(PKGCONFIG_FILE)
# Clean temporary files
mostlyclean:
-rm -fv $(BUILD_DIR)/*.i $(BUILD_DIR)/*.s $(BUILD_DIR)/*.o
-rm -fv $(BUILD_DIR)/*/*.i $(BUILD_DIR)/*/*.s $(BUILD_DIR)/*/*.o
# Clean almost everything
maintainer-clean:
@echo 'This command is intended for maintainers to use; it'
@echo 'deletes files that may need special tools to rebuild.'
@$(MAKE) distclean
-rm -fv resources/resources.c resources/resources.h resources.gresource
# Create a distribution tar file
dist:
$(MAKE) dist-gzip
# Common operations to create a distribution archive
dist-tar:
@$(MKDIR_P) $(DIST_PKG)
cp -dflRux -t $(DIST_PKG) $(TAR_FILES) $(TAR_DIRS)
-rm -f $(DIST_PKG)/*/$(PKGCONFIG_FILE)
tar -c --remove-files --file=$(DIST_PKG).tar $(DIST_PKG)
-rm -rf $(DIST_PKG)
# Create a distribution tar file, compressed with gzip
dist-gzip: $(TAR_FILES)
$(MAKE) dist-tar
gzip -9 -f $(DIST_PKG).tar
# Create a distribution tar file, compressed with xz
dist-xz: $(TAR_FILES)
$(MAKE) dist-tar
xz $(DIST_PKG).tar
# Make sure all installation directories (e.g. $(libdir))
# actually exist by making them if necessary.
installdirs:
@$(MKDIR_P) $(DESTDIR)$(libdir)
@$(MKDIR_P) $(DESTDIR)$(INC_DIR)
@$(MKDIR_P) $(DESTDIR)$(PKGCONFIG_PATH)
# Reconfigure Makefile
Makefile:
./configure