forked from cntools/cnfa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (26 loc) · 803 Bytes
/
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
.PHONY: all shared shared-example clean
all: example wav_player
os_generic.h:
wget https://raw.githubusercontent.com/cntools/rawdraw/master/os_generic.h
LDFLAGS = -lasound -lpthread
ifeq "$(shell pkgconf --exists libpulse && echo 'found' )" "found"
PULSE ?= YES
else
PULSE ?= NO
endif
ifeq "$(PULSE)" "YES"
LDFLAGS += -lpulse -DPULSEAUDIO
endif
example : example.c os_generic.h
$(CC) -o $@ $^ $(LDFLAGS) -lm
wav_player: shared
make -C wave_player PULSE=$(PULSE)
cp wave_player/wav_player ./
shared : os_generic.h
$(CC) CNFA.c -shared -fpic -o libCNFA.so -DCNFA_IMPLEMENTATION -DBUILD_DLL \
$(LDFLAGS)
shared-example : example.c shared
$(CC) -L. -Wl,-rpath=. -o example example.c -DUSE_SHARED -lm -lCNFA
clean :
-rm -rf *.o *~ example libCNFA.so wav_player
-make -C wave_player clean