| 1 |
# File: Makefile |
| 2 |
|
| 3 |
# Makefile for Praat |
| 4 |
# Paul Boersma, 19 July 2026 |
| 5 |
|
| 6 |
########################## |
| 7 |
# |
| 8 |
# To make Praat from the command line on Windows or Linux, type |
| 9 |
# |
| 10 |
# make |
| 11 |
# will make Praat with default settings |
| 12 |
# |
| 13 |
# There are several settings that you can either add on the command line |
| 14 |
# or define as an environment variable. |
| 15 |
# |
| 16 |
########################## |
| 17 |
# |
| 18 |
# PRAAT_OS |
| 19 |
# |
| 20 |
# determines the OS and sub-OS for which Praat will be built. |
| 21 |
# The default is to have this Makefile audo-detect the OS and sub-OS; |
| 22 |
# this tends to work for: |
| 23 |
# - OS: Windows |
| 24 |
# - OS: Linux |
| 25 |
# - Sub-OS: Raspberry Pi (implying that Linux is the OS) |
| 26 |
# but not (yet) for: |
| 27 |
# - Sub-OS: Chrome (only Linux will be detected as the OS) |
| 28 |
# - OS: FreeBSD |
| 29 |
# |
| 30 |
# make PRAAT_OS=windows # will set Windows as the OS |
| 31 |
# |
| 32 |
# make PRAAT_OS=linux # will set Linux as the OS, and no sub-OS |
| 33 |
# |
| 34 |
# make PRAAT_OS=chrome # will set Linux as the OS, and Chrome as the sub-OS |
| 35 |
# |
| 36 |
# make PRAAT_OS=linuxone # will set Linux as the OS, and LinuxONE as the sub-OS |
| 37 |
# |
| 38 |
# make PRAAT_OS=raspberrypi # will set Linux as the OS, and Raspberry Pi as the sub-OS |
| 39 |
# |
| 40 |
# make PRAAT_OS=freebsd # will set FreeBSD as the OS (note: this doesn't count as Linux) |
| 41 |
# |
| 42 |
########################## |
| 43 |
# |
| 44 |
# PRAAT_ARCH |
| 45 |
# |
| 46 |
# determines the processor architecture for which Praat will be built. |
| 47 |
# The default is what GCC and Clang will use if an architecture is not specified, which is: |
| 48 |
# - armv8-a (simplest ARM64) for the MSYS2-CLANGARM64 shell (Windows) and the OrbStack ARM64 shell (Linux) |
| 49 |
# - x86-64 (i.e. x64-v1) for the MSYS2-CLANG64 shell (Windows) and the OrbStack x64 shell (Linux) |
| 50 |
# - pentium4 (i.e. basic i686) for the MSYS2-MINGW32 shell (Windows) |
| 51 |
# - armv6+fp for some Raspberry Pi computers (you can check this using: gcc -Q --help=target) |
| 52 |
# Note that x64-v1 is the original 64-bit AMD/Intel chip; |
| 53 |
# for post-2013 computers you'd opt for x64-v3 instead. |
| 54 |
# |
| 55 |
# make PRAAT_ARCH=arm64 |
| 56 |
# will make Praat with the "armv8-a" setting for the architecture, |
| 57 |
# producing an ARM64 edition of Praat. |
| 58 |
# |
| 59 |
# make PRAAT_ARCH=x64v1 |
| 60 |
# will make Praat with the "x86-64" setting for the architecture, |
| 61 |
# producing an x64-v1 edition of Praat. |
| 62 |
# |
| 63 |
# make PRAAT_ARCH=x64v3 |
| 64 |
# will make Praat with the "x86-64-v3" setting for the architecture, |
| 65 |
# i.e. with support for AVX2, FMA, F16C and more, |
| 66 |
# producing an x64-v3 edition of Praat. |
| 67 |
# |
| 68 |
# make PRAAT_ARCH=i686 |
| 69 |
# will make Praat with the "i686" setting for the architecture, |
| 70 |
# producing a 32-bits Windows edition of Praat. |
| 71 |
# |
| 72 |
# make PRAAT_ARCH=native |
| 73 |
# will make Praat for the architecture of the shell, |
| 74 |
# which will often produce a version of Praat that is fastest on your computer. |
| 75 |
# |
| 76 |
# Tips and tricks |
| 77 |
# |
| 78 |
# To make PRAAT_ARCH=native the default, you can add an environment variable, e.g. you can put |
| 79 |
# export PRAAT_ARCH=native |
| 80 |
# in your ~/.bashrc file (or so). Once you have done that, |
| 81 |
# make |
| 82 |
# will from then on behave the same as if you typed |
| 83 |
# make PRAAT_ARCH=native |
| 84 |
# Note that an explicit command-line-specified setting, such as |
| 85 |
# make PRAAT_ARCH=x64v1 |
| 86 |
# will override the environment variable. |
| 87 |
# |
| 88 |
########################## |
| 89 |
|
| 90 |
# First try: explicit setting of the OS via argument or environment variable PRAAT_OS. |
| 91 |
ifeq ($(PRAAT_OS),windows) |
| 92 |
OS_IS_WINDOWS := 1 |
| 93 |
$(info OS given as Windows) |
| 94 |
else ifeq ($(PRAAT_OS),freebsd) |
| 95 |
OS_IS_FREEBSD := 1 |
| 96 |
$(info OS given as FreeBSD) |
| 97 |
else ifeq ($(PRAAT_OS),linux) |
| 98 |
OS_IS_LINUX := 1 |
| 99 |
$(info OS given as Linux) |
| 100 |
else ifeq ($(PRAAT_OS),raspberrypi) |
| 101 |
OS_IS_LINUX := 1 |
| 102 |
SUBOS_IS_RASPBERRY_PI := 1 |
| 103 |
$(info OS given as Linux (sub-OS Raspberry Pi)) |
| 104 |
else ifeq ($(PRAAT_OS),chrome) |
| 105 |
OS_IS_LINUX := 1 |
| 106 |
SUBOS_IS_CHROME := 1 |
| 107 |
$(info OS given as Linux (sub-OS Chrome)) |
| 108 |
else ifeq ($(PRAAT_OS),linuxone) |
| 109 |
OS_IS_LINUX := 1 |
| 110 |
SUBOS_IS_LINUX_ONE := 1 |
| 111 |
$(info OS given as Linux (sub-OS LinuxONE)) |
| 112 |
# Second try: default setting, depending on heuristics. |
| 113 |
else ifeq ($(OS),Windows_NT) |
| 114 |
OS_IS_WINDOWS := 1 |
| 115 |
$(info OS detected as Windows) |
| 116 |
else |
| 117 |
TRY_OS_NAME := $(shell uname -s) |
| 118 |
ifeq ($(TRY_OS_NAME),Linux) |
| 119 |
OS_IS_LINUX := 1 |
| 120 |
TRY_RASPBERRY_PI_MODEL := $(shell cat /proc/device-tree/model 2>/dev/null) |
| 121 |
ifeq ($(findstring Raspberry Pi,$(TRY_RASPBERRY_PI_MODEL)),Raspberry Pi) |
| 122 |
SUBOS_IS_RASPBERRY_PI := 1 |
| 123 |
$(info OS detected as Linux (sub-OS Raspberry Pi)) |
| 124 |
else |
| 125 |
$(info OS detected as Linux (but not Raspberry Pi)) |
| 126 |
endif |
| 127 |
endif |
| 128 |
endif |
| 129 |
|
| 130 |
ifeq ($(PRAAT_ARCH),arm64) |
| 131 |
ARCH_COMPILER_FLAGS = -march=armv8-a |
| 132 |
else ifeq ($(PRAAT_ARCH),x64v1) |
| 133 |
ARCH_COMPILER_FLAGS = -march=x86-64 |
| 134 |
else ifeq ($(PRAAT_ARCH),x64v3) |
| 135 |
ARCH_COMPILER_FLAGS = -march=x86-64-v3 |
| 136 |
else ifeq ($(PRAAT_ARCH),i686) |
| 137 |
ARCH_COMPILER_FLAGS = -march=i686 |
| 138 |
else ifeq ($(PRAAT_ARCH),s390x) |
| 139 |
ARCH_COMPILER_FLAGS = -march=arch11 -mtune=arch13 |
| 140 |
else ifeq ($(PRAAT_ARCH),native) |
| 141 |
ARCH_COMPILER_FLAGS = -march=native |
| 142 |
else |
| 143 |
$(info No architecture given) |
| 144 |
ARCH_COMPILER_FLAGS = |
| 145 |
endif |
| 146 |
$(info ARCHITECTURE: given as "$(PRAAT_ARCH)", resolved as "$(ARCH_COMPILER_FLAGS)") |
| 147 |
|
| 148 |
ifeq ($(OS_IS_FREEBSD),1) |
| 149 |
# by Paul Boersma, Jason Bacon, Adriaan de Groot |
| 150 |
|
| 151 |
# Default setting for where the executable will be installed, |
| 152 |
# overridable by an environment variable (or on the `make` command line). |
| 153 |
# Also needs to be added to the include and linker paths. |
| 154 |
# (In the FreeBSD ports system, this is already set so nothing is overridden.) |
| 155 |
LOCALBASE ?= /usr/local |
| 156 |
|
| 157 |
PKG_CONFIG ?= pkg-config |
| 158 |
|
| 159 |
# FreeBSD defaults to clang, not gcc |
| 160 |
CC ?= cc |
| 161 |
CXX ?= c++ |
| 162 |
LINK ?= $(CXX) |
| 163 |
|
| 164 |
SYSTEM_COMPILER_FLAGS = -DUNIX -Dlinux |
| 165 |
|
| 166 |
GRAPHICS_COMPILER_FLAGS := `$(PKG_CONFIG) --cflags gtk+-3.0` |
| 167 |
GRAPHICS_LINKER_FLAGS := `$(PKG_CONFIG) --libs gtk+-3.0` |
| 168 |
|
| 169 |
# -DALSA and -DJACK: Use ALSA and Jack audio in pa_unix_hostapis.c |
| 170 |
AUDIO_COMPILER_FLAGS := -DALSA -DJACK -DHAVE_SYS_SOUNDCARD_H |
| 171 |
AUDIO_LINKER_FLAGS := -lasound -ljack |
| 172 |
|
| 173 |
# FreeBSD pretends to be Linux for most of the code; add CPPFLAGS |
| 174 |
# explicitly because GNU make / gcc uses those preprocessor flags, |
| 175 |
# but clang does not. |
| 176 |
SHARED_COMPILER_FLAGS := $(SYSTEM_COMPILER_FLAGS) -D_FILE_OFFSET_BITS=64 \ |
| 177 |
$(GRAPHICS_COMPILER_FLAGS) $(AUDIO_COMPILER_FLAGS) \ |
| 178 |
-Wreturn-type -Wunused -Wunused-parameter -Wuninitialized -O1 -g1 -pthread $(CPPFLAGS) |
| 179 |
|
| 180 |
CFLAGS := -std=gnu99 $(SHARED_COMPILER_FLAGS) -Werror=implicit |
| 181 |
# Note: why not also -Werror=missing-prototypes ? |
| 182 |
CXXFLAGS := -std=c++17 $(SHARED_COMPILER_FLAGS) -Wshadow -Werror=return-type \ |
| 183 |
-I$(LOCALBASE)/include -I$(LOCALBASE)/include/unicode |
| 184 |
# Note: can we add -Werror=return-type to other OSes as well? |
| 185 |
|
| 186 |
EXECUTABLE_FILE := praat |
| 187 |
|
| 188 |
NON_PRAAT_LIBRARIES := $(GRAPHICS_LINKER_FLAGS) -L$(LOCALBASE)/lib $(AUDIO_LINKER_FLAGS) -lm -lpthread -ltinfow |
| 189 |
|
| 190 |
AR = ar |
| 191 |
RANLIB = ls |
| 192 |
RM = rm -f |
| 193 |
ICON = |
| 194 |
MAIN_ICON = |
| 195 |
|
| 196 |
else ifeq ($(OS_IS_WINDOWS),1) |
| 197 |
# by Paul Boersma |
| 198 |
|
| 199 |
# |
| 200 |
# Determine the compiler: either GCC or Clang. |
| 201 |
# |
| 202 |
# First try: explicit setting of the compiler via argument or environment variable PRAAT_COMPILER. |
| 203 |
ifeq ($(PRAAT_COMPILER),gcc) |
| 204 |
WE_HAVE_GCC := 1 |
| 205 |
else ifeq ($(PRAAT_COMPILER),clang) |
| 206 |
WE_HAVE_GCC := 0 |
| 207 |
# Second try: default setting, depending on the name of the shell. |
| 208 |
else ifeq ($(findstring MINGW,$(MSYSTEM)),MINGW) |
| 209 |
WE_HAVE_GCC := 1 |
| 210 |
else ifeq ($(findstring CLANG,$(MSYSTEM)),CLANG) |
| 211 |
WE_HAVE_GCC := 0 |
| 212 |
else |
| 213 |
$(error Unknown compiler) |
| 214 |
endif |
| 215 |
|
| 216 |
# |
| 217 |
# Compiler-specific variables: |
| 218 |
# - CC is a standard variable for the command that will be used by implicit `make` rules to compile C files |
| 219 |
# - CXX is a standard variable for the command that will be used by implicit `make` rules to compile C++ files |
| 220 |
# - LINKER_COMMAND is our command to invoke the linker; it should match the compiler command |
| 221 |
# - NON_PRAAT_LIBRARIES is our listing of the Windows libraries and the GCC or Clang libraries |
| 222 |
# |
| 223 |
ifeq ($(WE_HAVE_GCC),1) |
| 224 |
CC := gcc |
| 225 |
CXX := g++ |
| 226 |
LINKER_COMMAND := g++ |
| 227 |
NON_PRAAT_LIBRARIES = -lwinmm -lwsock32 -lcomctl32 -lole32 -lgdi32 -lgdiplus -lcomdlg32 -lwinspool \ |
| 228 |
-static-libgcc -static-libstdc++ -mwindows -static -lwinpthread |
| 229 |
# Note: winpthread is linked statically, because it may not be available on all users' computers; |
| 230 |
# for the same reason, GCC's C and C++ libraries are also statically linked. |
| 231 |
else |
| 232 |
CC := clang |
| 233 |
CXX := clang |
| 234 |
LINKER_COMMAND := clang |
| 235 |
NON_PRAAT_LIBRARIES = -lwinmm -lwsock32 -lcomctl32 -lole32 -lgdi32 -lgdiplus -lcomdlg32 -lwinspool \ |
| 236 |
-static -lc++ -lc++abi -mwindows |
| 237 |
# Note: Clang's C++ libraries are not available on all users' computers, so they are linked statically. |
| 238 |
endif |
| 239 |
|
| 240 |
# |
| 241 |
# Compiler flags: |
| 242 |
# - CFLAGS is a standard variable for the settings that will be used by implicit `make` rules to compile C files |
| 243 |
# - CXXFLAGS is a standard variable for the settings that will be used by implicit `make` rules to compile C++ files |
| 244 |
# - SHARED_COMPILER_FLAGS is our variable for the settings that will be shared between C and C++ compilation |
| 245 |
# |
| 246 |
SHARED_COMPILER_FLAGS := -municode -D_FILE_OFFSET_BITS=64 \ |
| 247 |
$(ARCH_COMPILER_FLAGS) -O3 |
| 248 |
# Note: the leaves many settings implicit, such as -mwin32 and -mtune=generic; |
| 249 |
# also -m64 (for x64-v1, x64-v3 and arm64) and -march=xxx (if not set in ARCH_COMPILER_FLAGS). |
| 250 |
CFLAGS := -std=gnu99 $(SHARED_COMPILER_FLAGS) |
| 251 |
CXXFLAGS := -std=gnu++17 $(SHARED_COMPILER_FLAGS) -Wshadow |
| 252 |
# Note: gnu++17 instead of c++17 is necessary to define M_PI in external code. |
| 253 |
|
| 254 |
EXECUTABLE_FILE = Praat.exe |
| 255 |
|
| 256 |
AR = ar |
| 257 |
RANLIB = ranlib |
| 258 |
WINDRES = windres |
| 259 |
ICON = praat_win.o |
| 260 |
MAIN_ICON = main/praat_win.o |
| 261 |
|
| 262 |
else ifeq ($(OS_IS_LINUX),1) |
| 263 |
# by Paul Boersma, David Weenink, Anna Simmons |
| 264 |
|
| 265 |
# Default settings for where the executable will be installed, |
| 266 |
# overridable by environment variables (or on the `make` command line). |
| 267 |
DESTDIR ?= |
| 268 |
PREFIX ?= /usr/local |
| 269 |
BINDIR ?= $(DESTDIR)$(PREFIX)/bin |
| 270 |
DATADIR ?= $(DESTDIR)$(PREFIX)/share |
| 271 |
|
| 272 |
PKG_CONFIG ?= pkg-config |
| 273 |
|
| 274 |
ifeq ($(PRAAT_GRAPHICS),barren) |
| 275 |
GRAPHICS_COMPILER_FLAGS := -DNO_GRAPHICS |
| 276 |
GRAPHICS_LINKER_FLAGS := |
| 277 |
EXECUTABLE_FILE = praat_barren |
| 278 |
else ifeq ($(PRAAT_GRAPHICS),nogui) |
| 279 |
GRAPHICS_COMPILER_FLAGS := -DNO_GUI `$(PKG_CONFIG) --cflags pangocairo` |
| 280 |
GRAPHICS_LINKER_FLAGS := `$(PKG_CONFIG) --libs pangocairo` |
| 281 |
EXECUTABLE_FILE = praat_nogui |
| 282 |
else |
| 283 |
GRAPHICS_COMPILER_FLAGS := `$(PKG_CONFIG) --cflags gtk+-3.0` |
| 284 |
GRAPHICS_LINKER_FLAGS := `$(PKG_CONFIG) --libs gtk+-3.0` |
| 285 |
EXECUTABLE_FILE = praat |
| 286 |
endif |
| 287 |
|
| 288 |
ifeq ($(PRAAT_AUDIO),none) |
| 289 |
AUDIO_COMPILER_FLAGS := |
| 290 |
AUDIO_LINKER_FLAGS := |
| 291 |
else ifeq ($(PRAAT_AUDIO),jack) |
| 292 |
AUDIO_COMPILER_FLAGS := -DJACK |
| 293 |
AUDIO_LINKER_FLAGS := `$(PKG_CONFIG) --libs jack` |
| 294 |
else ifeq ($(PRAAT_AUDIO),alsa) |
| 295 |
AUDIO_COMPILER_FLAGS := -DALSA |
| 296 |
AUDIO_LINKER_FLAGS := -lasound |
| 297 |
else ifeq ($(SUBOS_IS_RASPBERRY_PI),1) |
| 298 |
AUDIO_COMPILER_FLAGS := -DJACK |
| 299 |
AUDIO_LINKER_FLAGS := -ljack |
| 300 |
else |
| 301 |
AUDIO_COMPILER_FLAGS := -DALSA -DJACK -DHAVE_PULSEAUDIO |
| 302 |
AUDIO_LINKER_FLAGS := `$(PKG_CONFIG) --libs jack` -lpulse -lasound |
| 303 |
endif |
| 304 |
|
| 305 |
ifeq ($(SUBOS_IS_RASPBERRY_PI),1) |
| 306 |
SYSTEM_COMPILER_FLAGS = -DUNIX -Dlinux -Draspberrypi |
| 307 |
else |
| 308 |
SYSTEM_COMPILER_FLAGS = -DUNIX -Dlinux |
| 309 |
endif |
| 310 |
|
| 311 |
SHARED_COMPILER_FLAGS := $(SYSTEM_COMPILER_FLAGS) -D_FILE_OFFSET_BITS=64 \ |
| 312 |
$(ARCH_COMPILER_FLAGS) \ |
| 313 |
$(GRAPHICS_COMPILER_FLAGS) $(AUDIO_COMPILER_FLAGS) \ |
| 314 |
-Wreturn-type -Wunused -Wunused-parameter -Wuninitialized -O3 -g1 -pthread |
| 315 |
ifeq ($(SUBOS_IS_CHROME),1) |
| 316 |
SHARED_COMPILER_FLAGS += -Dchrome |
| 317 |
endif |
| 318 |
|
| 319 |
CFLAGS += -std=gnu99 $(SHARED_COMPILER_FLAGS) -Werror=missing-prototypes -Werror=implicit |
| 320 |
CXXFLAGS += -std=c++17 $(SHARED_COMPILER_FLAGS) -Wshadow |
| 321 |
|
| 322 |
ifeq ($(PRAAT_COMPILER),clang) |
| 323 |
CC := clang |
| 324 |
CXX := clang |
| 325 |
LINKER_COMMAND := clang |
| 326 |
CXXFLAGS += -stdlib=libc++ |
| 327 |
NON_PRAAT_LIBRARIES := $(GRAPHICS_LINKER_FLAGS) -lc++ -lm $(AUDIO_LINKER_FLAGS) -lpthread |
| 328 |
else |
| 329 |
CC := gcc |
| 330 |
CXX := g++ |
| 331 |
LINKER_COMMAND := g++ |
| 332 |
ifeq ($(SUBOS_IS_RASPBERRY_PI),1) |
| 333 |
# The static library /usr/lib/gcc/arm-linux-gnueabihf/8/libstdc++fs.a is needed with GCC 8, |
| 334 |
# and can be removed when using GCC 9 |
| 335 |
NON_PRAAT_LIBRARIES := $(GRAPHICS_LINKER_FLAGS) -lm $(AUDIO_LINKER_FLAGS) \ |
| 336 |
-static-libgcc -static-libstdc++ -lpthread -latomic -ldl -lstdc++fs |
| 337 |
else ifeq ($(SUBOS_IS_CHROME),1) |
| 338 |
NON_PRAAT_LIBRARIES := $(GRAPHICS_LINKER_FLAGS) -lm $(AUDIO_LINKER_FLAGS) \ |
| 339 |
-static-libgcc -static-libstdc++ -lpthread -L /usr/lib/x86_64-linux-gnu |
| 340 |
else ifeq ($(PRAAT_GRAPHICS),barrenXXX) |
| 341 |
NON_PRAAT_LIBRARIES := $(GRAPHICS_LINKER_FLAGS) -lm $(AUDIO_LINKER_FLAGS) \ |
| 342 |
-static-libgcc -static-libstdc++ -lpthread -L /usr/lib/x86_64-linux-gnu |
| 343 |
else ifeq ($(PRAAT_GRAPHICS),noguiXXX) |
| 344 |
NON_PRAAT_LIBRARIES := $(GRAPHICS_LINKER_FLAGS) -lm $(AUDIO_LINKER_FLAGS) \ |
| 345 |
-static-libgcc -static-libstdc++ -lpthread |
| 346 |
else |
| 347 |
NON_PRAAT_LIBRARIES := $(GRAPHICS_LINKER_FLAGS) -lm $(AUDIO_LINKER_FLAGS) -lpthread |
| 348 |
endif |
| 349 |
endif |
| 350 |
|
| 351 |
AR = ar |
| 352 |
RANLIB = ls |
| 353 |
ICON = |
| 354 |
MAIN_ICON = |
| 355 |
|
| 356 |
INSTALL ?= install |
| 357 |
ifeq ($(OS_IS_LINUX),1) |
| 358 |
BINARIES = $(shell find . -maxdepth 1 -name praat -o -name praat_nogui -o -name praat_barren) |
| 359 |
INSTALL_BIN = $(INSTALL) -pDm0755 $(BINARIES) -t $(BINDIR) |
| 360 |
INSTALL_BASHCOMPLETION = $(INSTALL) -Dm0644 main/praat.bash-completion $(DATADIR)/bash-completion/completions/praat |
| 361 |
else |
| 362 |
INSTALL_BIN = $(INSTALL) -pDm0755 praat -t $(BINDIR) |
| 363 |
INSTALL_BASHCOMPLETION = |
| 364 |
endif |
| 365 |
INSTALL_METAINFO = $(INSTALL) -Dm0644 org.praat.Praat.metainfo.xml -t $(DATADIR)/metainfo |
| 366 |
INSTALL_DESKTOP = $(INSTALL) -Dm0644 main/praat.desktop $(DATADIR)/applications/org.praat.Praat.desktop |
| 367 |
INSTALL_ICONS = \ |
| 368 |
$(INSTALL) -Dm0644 main/praat-480.svg $(DATADIR)/icons/hicolor/scalable/apps/org.praat.Praat.svg && \ |
| 369 |
$(INSTALL) -Dm0644 main/praat-16.png $(DATADIR)/icons/hicolor/16x16/apps/org.praat.Praat.png && \ |
| 370 |
$(INSTALL) -Dm0644 main/praat-32.png $(DATADIR)/icons/hicolor/32x32/apps/org.praat.Praat.png && \ |
| 371 |
$(INSTALL) -Dm0644 main/praat-48.png $(DATADIR)/icons/hicolor/48x48/apps/org.praat.Praat.png && \ |
| 372 |
$(INSTALL) -Dm0644 main/praat-128.png $(DATADIR)/icons/hicolor/128x128/apps/org.praat.Praat.png && \ |
| 373 |
$(INSTALL) -Dm0644 main/praat-256.png $(DATADIR)/icons/hicolor/256x256/apps/org.praat.Praat.png && \ |
| 374 |
$(INSTALL) -Dm0644 main/praat-512.png $(DATADIR)/icons/hicolor/512x512/apps/org.praat.Praat.png |
| 375 |
endif |
| 376 |
|
| 377 |
# Export some variables to the makefiles in the subdirectories. |
| 378 |
export CPPFLAGS # listing of include files (plus any flags provided by any environment variables also called CPPFLAGS) |
| 379 |
export CC |
| 380 |
export CXX |
| 381 |
export CFLAGS |
| 382 |
export CXXFLAGS |
| 383 |
export AR # for creating the archive of object files in a subfolder |
| 384 |
export RANLIB # for creating the archive of object files in a subfolder |
| 385 |
export RM # for `make clean` |
| 386 |
export WINDRES # for compiling `main/praat_win.rc` |
| 387 |
|
| 388 |
.PHONY: all clean install |
| 389 |
|
| 390 |
# Makes the Praat executable in the source directory. |
| 391 |
all: all-external all-self |
| 392 |
$(LINKER_COMMAND) -o $(EXECUTABLE_FILE) main/main_Praat.o $(MAIN_ICON) fon/libfon.a \ |
| 393 |
artsynth/libartsynth.a FFNet/libFFNet.a \ |
| 394 |
gram/libgram.a EEG/libEEG.a \ |
| 395 |
LPC/libLPC.a dwtools/libdwtools.a sensors/libsensors.a \ |
| 396 |
foned/libfoned.a fon/libfon.a stat/libstat.a \ |
| 397 |
dwsys/libdwsys.a sys/libsys.a melder/libmelder.a kar/libkar.a \ |
| 398 |
external/espeak/libespeak.a \ |
| 399 |
external/portaudio/libportaudio.a \ |
| 400 |
external/flac/libflac.a external/lame/liblame.a external/mp3/libmp3.a \ |
| 401 |
external/glpk/libglpk.a \ |
| 402 |
external/clapack/libclapack.a \ |
| 403 |
external/gsl/libgsl.a \ |
| 404 |
external/num/libnum.a \ |
| 405 |
external/vorbis/libvorbis.a \ |
| 406 |
external/opusfile/libopusfile.a \ |
| 407 |
external/whispercpp/libwhisper.a \ |
| 408 |
external/blake3/libblake3.a \ |
| 409 |
external/zlib/libzlib.a \ |
| 410 |
$(NON_PRAAT_LIBRARIES) $(LDFLAGS) |
| 411 |
|
| 412 |
all-external: |
| 413 |
$(MAKE) -C external/clapack |
| 414 |
$(MAKE) -C external/gsl |
| 415 |
$(MAKE) -C external/glpk |
| 416 |
$(MAKE) -C external/lame |
| 417 |
$(MAKE) -C external/mp3 |
| 418 |
$(MAKE) -C external/num |
| 419 |
$(MAKE) -C external/flac |
| 420 |
$(MAKE) -C external/portaudio |
| 421 |
$(MAKE) -C external/espeak |
| 422 |
$(MAKE) -C external/vorbis |
| 423 |
$(MAKE) -C external/opusfile |
| 424 |
$(MAKE) -C external/whispercpp |
| 425 |
$(MAKE) -C external/blake3 |
| 426 |
$(MAKE) -C external/zlib |
| 427 |
|
| 428 |
all-self: |
| 429 |
$(MAKE) -C kar |
| 430 |
$(MAKE) -C melder |
| 431 |
$(MAKE) -C sys |
| 432 |
$(MAKE) -C dwsys |
| 433 |
$(MAKE) -C stat |
| 434 |
$(MAKE) -C fon |
| 435 |
$(MAKE) -C foned |
| 436 |
$(MAKE) -C dwtools |
| 437 |
$(MAKE) -C LPC |
| 438 |
$(MAKE) -C EEG |
| 439 |
$(MAKE) -C sensors |
| 440 |
$(MAKE) -C gram |
| 441 |
$(MAKE) -C FFNet |
| 442 |
$(MAKE) -C artsynth |
| 443 |
$(MAKE) -C main main_Praat.o $(ICON) |
| 444 |
|
| 445 |
clean: clean-external clean-self clean-test |
| 446 |
$(RM) praat |
| 447 |
|
| 448 |
clean-external: |
| 449 |
$(MAKE) -C external/clapack clean |
| 450 |
$(MAKE) -C external/gsl clean |
| 451 |
$(MAKE) -C external/glpk clean |
| 452 |
$(MAKE) -C external/lame clean |
| 453 |
$(MAKE) -C external/mp3 clean |
| 454 |
$(MAKE) -C external/num clean |
| 455 |
$(MAKE) -C external/flac clean |
| 456 |
$(MAKE) -C external/portaudio clean |
| 457 |
$(MAKE) -C external/espeak clean |
| 458 |
$(MAKE) -C external/vorbis clean |
| 459 |
$(MAKE) -C external/opusfile clean |
| 460 |
$(MAKE) -C external/whispercpp clean |
| 461 |
$(MAKE) -C external/blake3 clean |
| 462 |
$(MAKE) -C external/zlib clean |
| 463 |
|
| 464 |
clean-self: |
| 465 |
$(MAKE) -C kar clean |
| 466 |
$(MAKE) -C melder clean |
| 467 |
$(MAKE) -C sys clean |
| 468 |
$(MAKE) -C dwsys clean |
| 469 |
$(MAKE) -C stat clean |
| 470 |
$(MAKE) -C fon clean |
| 471 |
$(MAKE) -C foned clean |
| 472 |
$(MAKE) -C dwtools clean |
| 473 |
$(MAKE) -C LPC clean |
| 474 |
$(MAKE) -C EEG clean |
| 475 |
$(MAKE) -C sensors clean |
| 476 |
$(MAKE) -C gram clean |
| 477 |
$(MAKE) -C FFNet clean |
| 478 |
$(MAKE) -C artsynth clean |
| 479 |
$(MAKE) -C main clean |
| 480 |
|
| 481 |
clean-test: |
| 482 |
$(MAKE) -C dwtest clean |
| 483 |
$(MAKE) -C test/dwtools clean |
| 484 |
$(MAKE) -C test/fon clean |
| 485 |
$(MAKE) -C test/kar clean |
| 486 |
$(MAKE) -C test/script clean |
| 487 |
$(MAKE) -C test/stat clean |
| 488 |
$(MAKE) -C test/sys clean |
| 489 |
|
| 490 |
install: |
| 491 |
$(INSTALL_BIN) |
| 492 |
$(INSTALL_METAINFO) |
| 493 |
$(INSTALL_DESKTOP) |
| 494 |
$(INSTALL_ICONS) |
| 495 |
$(INSTALL_BASHCOMPLETION) |