Implement mmap support with STORE and RETRIEVE notifications
[ossp.git] / Makefile
blob1473fd2727c262238436ea04b06b146c2ef5b354
1 # These can be overridden if needed
2 # DESTDIR is completely respected
3 CC := gcc
4 AR := ar
5 CFLAGS := -Wall $(CFLAGS)
6 XLDFLAGS := $(LDFLAGS)
7 LDFLAGS := -L. -lossp $(LDFLAGS)
8 prefix := /usr/local
9 DESTDIR :=
10 UDEVDIR := /etc/udev/rules.d
12 ifeq "$(origin OSSPD_CFLAGS)" "undefined"
13 OSSPD_CFLAGS := $(shell pkg-config --cflags fuse)
14 endif
16 ifeq "$(origin OSSPD_LDFLAGS)" "undefined"
17 OSSPD_LDFLAGS := $(shell pkg-config --libs fuse)
18 endif
20 ifeq "$(origin OSSP_PADSP_CFLAGS)" "undefined"
21 OSSP_PADSP_CFLAGS := $(shell pkg-config --cflags libpulse)
22 endif
24 ifeq "$(origin OSSP_PADSP_LDFLAGS)" "undefined"
25 OSSP_PADSP_LDFLAGS := $(shell pkg-config --libs libpulse) -lpthread
26 endif
28 ifeq "$(origin OSSP_ALSAP_CFLAGS)" "undefined"
29 OSSP_ALSAP_CFLAGS := $(shell pkg-config --libs alsa)
30 endif
32 ifeq "$(origin OSSP_ALSAP_LDFLAGS)" "undefined"
33 OSSP_ALSAP_LDFLAGS := $(shell pkg-config --libs alsa)
34 endif
36 headers := ossp.h ossp-util.h ossp-slave.h
38 all: osspd ossp-padsp ossp-alsap
40 install:
41 mkdir -p $(DESTDIR)$(prefix)/sbin
42 install -m755 osspd ossp-padsp ossp-alsap $(DESTDIR)$(prefix)/sbin
43 mkdir -p $(DESTDIR)$(UDEVDIR)
44 install -m644 98-osscuse.rules $(DESTDIR)$(UDEVDIR)
46 libossp.a: ossp.c ossp.h ossp-util.c ossp-util.h ossp-slave.c ossp-slave.h
47 $(CC) $(CFLAGS) -c -o ossp.o ossp.c
48 $(CC) $(CFLAGS) -c -o ossp-util.o ossp-util.c
49 $(CC) $(CFLAGS) -c -o ossp-slave.o ossp-slave.c
50 $(AR) rc $@ ossp.o ossp-util.o ossp-slave.o
52 osspd: osspd.c libossp.a $(headers)
53 $(CC) $(CFLAGS) $(OSSPD_CFLAGS) -o $@ $< $(OSSPD_LDFLAGS) $(LDFLAGS)
55 ossp-padsp: ossp-padsp.c libossp.a $(headers)
56 $(CC) $(CFLAGS) $(OSSP_PADSP_CFLAGS) -o $@ $< $(OSSP_PADSP_LDFLAGS) $(LDFLAGS)
58 ossp-alsap: ossp-alsap.c libossp.a $(headers)
59 $(CC) $(CFLAGS) $(OSSP_ALSAP_CFLAGS) -o $@ $< $(OSSP_ALSAP_LDFLAGS) $(LDFLAGS)
61 osstest: osstest.c
62 $(CC) $(CFLAGS) -o $@ $< $(XLDFLAGS)
64 test: osstest
65 @./osstest
67 clean:
68 rm -f *.o *.a osspd ossp-padsp ossp-alsap osstest