--- morse.d/Makefile.orig 2011-06-04 02:08:38.000000000 -0700 +++ morse.d/Makefile 2012-04-12 11:10:58.000000000 -0700 @@ -1,40 +1,43 @@ -DEVICE=PA +DEVICE?=PA BEEPERS = beepLinux.c beepOSS.c beepX11.c beepALSA.c SOURCES = alarm.c morse.c alarm.h beep.h $(BEEPERS) # The flags necessary to link with the X11 libraries. -X11LIBS = -L/usr/X11R6/lib -lX11 +X11LIBS = -lX11 # The flags necessary to link with PulseAudio and support pthread -PA_CFLAGS = -pthread $(shell pkg-config --cflags libpulse-simple) -PA_LIBS = $(shell pkg-config --libs libpulse-simple) -pthread +PA_CFLAGS = -pthread `pkg-config --cflags libpulse-simple` +PA_LIBS = `pkg-config --libs libpulse-simple` -pthread # The flags necessary to link with ALSA -ALSA_CFLAGS = $(shell pkg-config --cflags alsa) -ALSA_LIBS = $(shell pkg-config --libs alsa) +ALSA_CFLAGS = `pkg-config --cflags alsa` +ALSA_LIBS = `shell pkg-config --libs alsa` # Any additional flags your favorite C compiler requires to work. -CFLAGS = -O3 -I/usr/X11R6/include $($(device)_EXTRA_CFLAGS) +#CFLAGS = -O3 -I/usr/X11R6/include $($(device)_EXTRA_CFLAGS) morse: morse${DEVICE} rm -f $@ ln morse${DEVICE} $@ morseX11: morse.o beepX11.o alarm.o - $(CC) $(X11LIBS) -o $@ morse.o beepX11.o alarm.o + $(CC) $(X11LIBS) $(LDFLAGS) -o $@ morse.o beepX11.o alarm.o morseLinux: morse.o beepLinux.o alarm.o - $(CC) -o $@ morse.o beepLinux.o alarm.o -lm + $(CC) $(LDFLAGS) -o $@ morse.o beepLinux.o alarm.o -lm morseOSS: morse.o beepOSS.o - $(CC) $(CFLAGS) -o $@ morse.o beepOSS.o -lm + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ morse.o beepOSS.o -lm + +beepPA.o: beepPA.c + ${CC} ${CFLAGS} ${PA_CFLAGS} -c ${.IMPSRC} morsePA: morse.o beepPA.o - $(CC) $(CFLAGS) $(PA_CFLAGS) -o $@ morse.o beepPA.o -lm $(PA_LIBS) + $(CC) $(CFLAGS) $(PA_CFLAGS) $(LDFLAGS) -o $@ morse.o beepPA.o -lm $(PA_LIBS) morseALSA: morse.o beepALSA.o - $(CC) $(CFLAGS) $(ALSA_CFLAGS) -o $@ morse.o beepALSA.o -lm $(ALSA_LIBS) + $(CC) $(CFLAGS) $(ALSA_CFLAGS) $(LDFLAGS) -o $@ morse.o beepALSA.o -lm $(ALSA_LIBS) morse.o: beep.h Makefile beepX11.o: beep.h alarm.h