| 1 |
PREFIX ?= /usr/local |
| 2 |
bindir = $(PREFIX)/bin |
| 3 |
|
| 4 |
VERSION=0.9.73 |
| 5 |
|
| 6 |
CC=gcc |
| 7 |
CPP=g++ |
| 8 |
|
| 9 |
# Needed on OSX |
| 10 |
CFLAGS += -I/opt/local/include |
| 11 |
|
| 12 |
OPTIMIZE=-O3 |
| 13 |
#OPTIMIZE=-O0 -g |
| 14 |
|
| •15 |
COMPILEFLAGS=$(CPPLAGS) $(CFLAGS) $(OPTIMIZE) -DVERSION=\"$(VERSION)\" -Wall -Wextra -Wno-unused |
| 16 |
LINKFLAGS=$(LDFLAGS) -ljack -lsndfile -lm -lpthread |
| 17 |
|
| 18 |
OS := $(shell uname) |
| 19 |
ifneq ($(OS),Darwin) |
| 20 |
LINKFLAGS += -lrt |
| 21 |
endif |
| 22 |
|
| 23 |
targets = jack_capture |
| 24 |
|
| 25 |
all: check_dependencies jack_capture |
| 26 |
|
| 27 |
install: $(targets) |
| 28 |
install -d $(DESTDIR)$(bindir) |
| 29 |
install -m755 $(targets) $(DESTDIR)$(bindir) |
| 30 |
|
| 31 |
uninstall: |
| 32 |
rm -f $(DESTDIR)$(bindir)/jack_capture |
| 33 |
-rmdir $(DESTDIR)$(bindir) |
| 34 |
|
| 35 |
check_dependencies: |
| 36 |
@echo |
| 37 |
@echo "Checking dependencies: " |
| 38 |
which bash |
| 39 |
which tr |
| 40 |
which sed |
| 41 |
which install |
| 42 |
which pkg-config |
| 43 |
which $(CC) |
| 44 |
which $(CPP) |
| 45 |
$(CC) $(CFLAGS) -E testsndfile.c >/dev/null |
| 46 |
@echo "All seems good " |
| 47 |
@echo |
| 48 |
|
| 49 |
dist: clean |
| 50 |
rm -fr /tmp/jack_capture-$(VERSION) |
| 51 |
rm -fr jack_capture-$(VERSION) |
| 52 |
mkdir /tmp/jack_capture-$(VERSION) |
| 53 |
cp -a * /tmp/jack_capture-$(VERSION)/ |
| 54 |
mv /tmp/jack_capture-$(VERSION) . |
| 55 |
tar cvf jack_capture-$(VERSION).tar jack_capture-$(VERSION) |
| 56 |
gzip jack_capture-$(VERSION).tar |
| 57 |
marcel_upload jack_capture-$(VERSION).tar.gz |
| 58 |
ls -la jack_capture-$(VERSION) |
| 59 |
rm -fr jack_capture-$(VERSION) |
| 60 |
|
| 61 |
|
| 62 |
jack_capture: setformat.c jack_capture.c vringbuffer.c upwaker.c osc.c Makefile das_config.h config_flags |
| 63 |
$(CC) $(COMPILEFLAGS) jack_capture.c vringbuffer.c upwaker.c osc.c -o jack_capture $(LINKFLAGS) `cat config_flags` |
| 64 |
|
| 65 |
|
| 66 |
jack_capture_gui2: jack_capture_gui2.cpp |
| 67 |
$(CPP) $(CPPFLAGS) $(OPTIMIZE) jack_capture_gui2.cpp $(LDFLAGS) `pkg-config --libs --cflags gtk+-2.0` -o jack_capture_gui2 |
| 68 |
|
| 69 |
config_flags: Makefile das_config.h |
| 70 |
cat das_config.h |grep COMPILEFLAGS|sed s/\\/\\/COMPILEFLAGS//|tr '\n' ' ' >config_flags |
| 71 |
|
| 72 |
das_config.h: gen_das_config_h.sh |
| 73 |
bash gen_das_config_h.sh >das_config.h |
| 74 |
@echo |
| 75 |
@echo "jack_capture was configured with the following options:" |
| 76 |
@echo "------------------------------" |
| 77 |
@cat das_config.h |
| 78 |
@echo "------------------------------" |
| 79 |
@echo |
| 80 |
|
| 81 |
setformat.c: gen_setformat_c.sh |
| 82 |
bash gen_setformat_c.sh >setformat.c |
| 83 |
|
| 84 |
|
| 85 |
clean: |
| 86 |
rm -f *~ jack_capture jack_capture_gui2 config_flags *.wav *.flac *.ogg *.mp3 *.au *.aiff *.wavex temp.c* setformat.c* das_config.h* a.out *.gz *.orig "#*" |