forked from tari01/libodiosacd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·60 lines (49 loc) · 2.85 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
CC ?= gcc
ifndef O
O = 3
endif
CFLAGS := -g -O$O -Wall -Wno-format-truncation -fpic -Idecoder -Iconverter -Ireader $(CFLAGS)
LDFLAGS += -lpthread -lm -Ldecoder -Lconverter -Lreader -shared -Wl,-soname,libodiosacd.so.1
VPATH = src
OBJECTS = decoder/strdata decoder/acdata decoder/codedtable decoder/framereader decoder/decoderbase decoder/decoder converter/pcmfilter converter/dsdfilter converter/filtersetup converter/converterbase converter/converter reader/media reader/disc reader/dff reader/dsf libodiosacd
SUBDIRS = $(VPATH) $(VPATH)/decoder $(VPATH)/converter $(VPATH)/reader
LIBDIR = lib
ifneq ($(wildcard $(DESTDIR)/usr/lib64),)
LIBDIR = lib64
endif
.PHONY: all clean install uninstall
all: clean $(OBJECTS) odio-libsacd
decoder/strdata: decoder/strdata.c; $(CC) -c $(CFLAGS) $^ -o $(VPATH)/[email protected]
decoder/acdata: decoder/acdata.c; $(CC) -c $(CFLAGS) $^ -o $(VPATH)/[email protected]
decoder/codedtable: decoder/codedtable.c; $(CC) -c $(CFLAGS) $^ -o $(VPATH)/[email protected]
decoder/framereader: decoder/framereader.c; $(CC) -c $(CFLAGS) $^ -o $(VPATH)/[email protected]
decoder/decoderbase: decoder/decoderbase.c; $(CC) -c $(CFLAGS) $^ -o $(VPATH)/[email protected]
decoder/decoder: decoder/decoder.c; $(CC) -c $(CFLAGS) $^ -o $(VPATH)/[email protected]
converter/pcmfilter: converter/pcmfilter.c; $(CC) -c $(CFLAGS) $^ -o $(VPATH)/[email protected]
converter/dsdfilter: converter/dsdfilter.c; $(CC) -c $(CFLAGS) $^ -o $(VPATH)/[email protected]
converter/filtersetup: converter/filtersetup.c; $(CC) -c $(CFLAGS) $^ -o $(VPATH)/[email protected]
converter/converterbase: converter/converterbase.c; $(CC) -c $(CFLAGS) $^ -o $(VPATH)/[email protected]
converter/converter: converter/converter.c; $(CC) -c $(CFLAGS) $^ -o $(VPATH)/[email protected]
reader/media: reader/media.c; $(CC) -c $(CFLAGS) $^ -o $(VPATH)/[email protected]
reader/disc: reader/disc.c; $(CC) -c $(CFLAGS) $^ -o $(VPATH)/[email protected]
reader/dff: reader/dff.c; $(CC) -c $(CFLAGS) $^ -o $(VPATH)/[email protected]
reader/dsf: reader/dsf.c; $(CC) -c $(CFLAGS) $^ -o $(VPATH)/[email protected]
libodiosacd: libodiosacd.c; $(CC) -c $(CFLAGS) $^ -o $(VPATH)/[email protected]
odio-libsacd: $(foreach object, $(OBJECTS), $(VPATH)/$(object).o); $(CC) -o data/usr/lib/libodiosacd.so.1 $^ $(LDFLAGS)
clean:
$(shell rm -f ./data/usr/lib/libodiosacd.so)
$(shell rm -f $(foreach librarydir, $(SUBDIRS), $(librarydir)/*.o))
install:
$(shell install -Dt $(DESTDIR)/usr/$(LIBDIR) ./data/usr/lib/libodiosacd.so.1)
$(shell ln -sf ./libodiosacd.so.1 $(DESTDIR)/usr/$(LIBDIR)/libodiosacd.so)
$(shell install -Dt $(DESTDIR)/usr/include/libodiosacd ./src/libodiosacd.h)
$(shell install -Dt $(DESTDIR)/usr/include/libodiosacd/reader ./src/reader/disc.h)
$(shell install -Dt $(DESTDIR)/usr/include/libodiosacd/reader ./src/reader/media.h)
$(shell install -Dt $(DESTDIR)/usr/include/libodiosacd/reader ./src/reader/sacd.h)
ifndef DESTDIR
ldconfig
endif
uninstall:
$(shell rm -f $(DESTDIR)/usr/$(LIBDIR)/libodiosacd.so)
$(shell rm -f $(DESTDIR)/usr/$(LIBDIR)/libodiosacd.so.1)
$(shell rm -fr $(DESTDIR)/usr/include/libodiosacd)