File: Makefile

package info (click to toggle)
osspd 1.3.2-6
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 484 kB
  • ctags: 953
  • sloc: ansic: 8,489; makefile: 222; sh: 83
file content (70 lines) | stat: -rw-r--r-- 2,063 bytes parent folder | download | duplicates (3)
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
66
67
68
69
70
# These can be overridden if needed
# DESTDIR is completely respected
CC := gcc
AR := ar
CFLAGS := -Wall -pthread $(CFLAGS) $(CPPFLAGS)
XLDFLAGS := $(LDFLAGS)
LDFLAGS := -L. -lossp -pthread $(LDFLAGS)
prefix := /usr/local
DESTDIR :=
UDEVDIR := /etc/udev/rules.d
SLAVESDIR := $(prefix)/sbin

ifeq "$(origin OSSPD_CFLAGS)" "undefined"
OSSPD_CFLAGS := $(shell pkg-config --cflags fuse)
endif

ifeq "$(origin OSSPD_LDFLAGS)" "undefined"
OSSPD_LDFLAGS := $(shell pkg-config --libs fuse)
endif

ifeq "$(origin OSSP_PADSP_CFLAGS)" "undefined"
OSSP_PADSP_CFLAGS := $(shell pkg-config --cflags libpulse)
endif

ifeq "$(origin OSSP_PADSP_LDFLAGS)" "undefined"
OSSP_PADSP_LDFLAGS := $(shell pkg-config --libs libpulse)
endif

ifeq "$(origin OSSP_ALSAP_CFLAGS)" "undefined"
OSSP_ALSAP_CFLAGS := $(shell pkg-config --libs alsa)
endif

ifeq "$(origin OSSP_ALSAP_LDFLAGS)" "undefined"
OSSP_ALSAP_LDFLAGS := $(shell pkg-config --libs alsa)
endif

headers := ossp.h ossp-util.h ossp-slave.h

all: osspd ossp-padsp ossp-alsap

install:
	mkdir -p $(DESTDIR)$(prefix)/sbin $(DESTDIR)$(SLAVESDIR)
	install -m755 osspd $(DESTDIR)$(prefix)/sbin
	install -m755 ossp-padsp ossp-alsap $(DESTDIR)$(SLAVESDIR)
	mkdir -p $(DESTDIR)$(UDEVDIR)
	install -m644 98-osscuse.rules $(DESTDIR)$(UDEVDIR)

libossp.a: ossp.c ossp.h ossp-util.c ossp-util.h ossp-slave.c ossp-slave.h
	$(CC) $(CFLAGS) -c -o ossp.o ossp.c
	$(CC) $(CFLAGS) -c -o ossp-util.o ossp-util.c
	$(CC) $(CFLAGS) -c -o ossp-slave.o ossp-slave.c
	$(AR) rc $@ ossp.o ossp-util.o ossp-slave.o

osspd: osspd.c libossp.a $(headers)
	$(CC) $(CFLAGS) $(OSSPD_CFLAGS) -DSLAVE_DEFAULT_PATH=\"$(SLAVESDIR)\" -o $@ $< $(OSSPD_LDFLAGS) $(LDFLAGS)

ossp-padsp: ossp-padsp.c libossp.a $(headers)
	$(CC) $(CFLAGS) $(OSSP_PADSP_CFLAGS) -o $@ $< $(OSSP_PADSP_LDFLAGS) $(LDFLAGS)

ossp-alsap: ossp-alsap.c libossp.a $(headers)
	$(CC) $(CFLAGS) $(OSSP_ALSAP_CFLAGS) -o $@ $< $(OSSP_ALSAP_LDFLAGS) $(LDFLAGS)

osstest: osstest.c
	$(CC) $(CFLAGS) -o $@ $< $(XLDFLAGS)

test: osstest
	@./osstest

clean:
	rm -f *.o *.a osspd ossp-padsp ossp-alsap osstest