-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
59 lines (41 loc) · 1.05 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
# dsd2pcm Makefile
VERSION = 0.1
SONAME = 0
OPTFLAGS ?= -Wall -g -O3
CFLAGS = $(OPTFLAGS) -fPIC -c
CC = g++
SRCDIR = .
OBJDIR = ./obj
INCLUDES = .
NAME = dsd2pcm
LIB_NAME = lib$(NAME)
LIB_HEADERS = \
$(SRCDIR)/dsd2pcm.h
LIB_SOURCES = \
$(SRCDIR)/dsd2pcm.c
LIB_OBJS = \
dsd2pcm.o
BIN_HEADERS = \
$(SRCDIR)/noiseshape.h \
$(SRCDIR)/noiseshape.hpp
BIN_SOURCES = \
$(SRCDIR)/main.cpp \
$(SRCDIR)/noiseshape.c
BIN_OBJS = \
main.o \
noiseshape.o
all: $(NAME)
$(NAME): $(LIB_NAME).so.$(VERSION) $(BIN_OBJS)
$(CC) -o $(NAME) $(BIN_OBJS) $(LDFLAGS) -L . -ldsd2pcm
$(LIB_NAME).so.$(VERSION): $(LIB_OBJS)
$(CC) -shared -Wl,-soname,$(LIB_NAME).so.$(SONAME) $(LDFLAGS) -o $(LIB_NAME).so.$(VERSION) $(LIB_OBJS)
ln -s $(LIB_NAME).so.$(VERSION) $(LIB_NAME).so.$(SONAME)
ln -s $(LIB_NAME).so.$(SONAME) $(LIB_NAME).so
dsd2pcm.o: dsd2pcm.c
$(CC) -I $(INCLUDES) $(CFLAGS) dsd2pcm.c
main.o: main.cpp
$(CC) -I $(INCLUDES) $(CFLAGS) main.cpp
noiseshape.o: noiseshape.c
$(CC) -I $(INCLUDES) $(CFLAGS) noiseshape.c
clean:
-rm $(LIB_OBJS) $(LIB_NAME)* $(BIN_OBJS) $(NAME)