| 1 |
DEVICE=PA |
| 2 |
|
| 3 |
BEEPERS = beepLinux.c beepOSS.c beepX11.c beepALSA.c |
| 4 |
SOURCES = alarm.c morse.c alarm.h beep.h $(BEEPERS) |
| 5 |
|
| •6 |
PKG_CONFIG ?= pkg-config |
| 7 |
|
| 8 |
# The flags necessary to link with the X11 libraries. |
| 9 |
X11LIBS = -L/usr/X11R6/lib -lX11 |
| 10 |
|
| 11 |
# The flags necessary to link with PulseAudio and support pthread |
| •12 |
PA_CFLAGS = -pthread $(shell $(PKG_CONFIG) --cflags libpulse-simple) |
| 13 |
PA_LIBS = $(shell $(PKG_CONFIG) --libs libpulse-simple) -pthread |
| 14 |
|
| 15 |
# The flags necessary to link with ALSA |
| •16 |
ALSA_CFLAGS = $(shell $(PKG_CONFIG) --cflags alsa) |
| 17 |
ALSA_LIBS = $(shell $(PKG_CONFIG) --libs alsa) |
| 18 |
|
| 19 |
# Any additional flags your favorite C compiler requires to work. |
| 20 |
CFLAGS = -O3 -I/usr/X11R6/include $($(device)_EXTRA_CFLAGS) |
| 21 |
|
| 22 |
morse: morse${DEVICE} |
| 23 |
rm -f $@ |
| 24 |
ln morse${DEVICE} $@ |
| 25 |
|
| 26 |
morseX11: morse.o beepX11.o alarm.o |
| •27 |
$(CC) $(LDFLAGS) -o $@ morse.o beepX11.o alarm.o $(X11LIBS) |
| 28 |
|
| 29 |
morseLinux: morse.o beepLinux.o alarm.o |
| •30 |
$(CC) $(LDFLAGS) -o $@ morse.o beepLinux.o alarm.o -lm |
| 31 |
|
| 32 |
morseOSS: morse.o beepOSS.o |
| •33 |
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ morse.o beepOSS.o -lm |
| 34 |
|
| 35 |
morsePA: morse.o beepPA.o |
| •36 |
$(CC) $(CFLAGS) $(LDFLAGS) $(PA_CFLAGS) -o $@ morse.o beepPA.o -lm $(PA_LIBS) |
| 37 |
|
| 38 |
morseALSA: morse.o beepALSA.o |
| •39 |
$(CC) $(CFLAGS) $(LDFLAGS) $(ALSA_CFLAGS) -o $@ morse.o beepALSA.o -lm $(ALSA_LIBS) |
| 40 |
|
| 41 |
morse.o: beep.h Makefile |
| 42 |
beepX11.o: beep.h alarm.h |
| 43 |
beepLinux.o: beep.h alarm.h |
| 44 |
beepOSS.o: beep.h |
| 45 |
beepALSA.o: beep.h |
| 46 |
alarm.o: alarm.h |
| 47 |
|
| 48 |
clean: |
| 49 |
rm -f *.o morse QSO morseX11 morseLinux morseOSS morsePA morseALSA |