forked from mod-audio/mod-host
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (49 loc) · 1.09 KB
/
Makefile
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
# compiler
CC = gcc
# linker
LD = gcc
# language file extension
EXT = c
# source files directory
SRC_DIR = ./src
# program name
PROG = mod-host
# default install paths
PREFIX = /usr/local
INSTALL_PATH = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1/
# compiler and linker flags
ifeq ($(MODE), release)
CFLAGS = -O2 -Wall -Wextra -c
LDFLAGS = -s
else
CFLAGS = -O0 -g -Wall -Wextra -c -DDEBUG
LDFLAGS =
endif
# library links
LIBS = -ljack `pkg-config --libs lilv-0` -largtable2 -lreadline -lpthread
# additional include paths
INCS = -I/usr/include/lilv-0
# remove command
RM = rm -f
# source and object files
SRC = $(wildcard $(SRC_DIR)/*.$(EXT))
OBJ = $(SRC:.$(EXT)=.o)
# linking rule
$(PROG): $(OBJ)
$(LD) $(LDFLAGS) $(OBJ) -o $(PROG) $(LIBS)
# meta-rule to generate the object files
%.o: %.$(EXT)
$(CC) $(CFLAGS) $(INCS) -o $@ $<
# install rule
install:
install $(PROG) $(INSTALL_PATH)
# clean rule
clean:
$(RM) $(SRC_DIR)/*.o $(PROG)
# manual page rule
man:
txt2man -s 1 -t MOD-HOST doc/man.txt > doc/mod-host.1
# install manual page rule
install-man: man
install doc/*.1 $(MANDIR)