From 352dad23c7847d234e11c1034e1354fbd9a8349a Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Sat, 31 Dec 2011 17:50:06 +0100 Subject: initial import --- Makefile | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..07cc811 --- /dev/null +++ b/Makefile @@ -0,0 +1,44 @@ +CFLAGS?=-Os -Wall -ggdb +LDFLAGS?=-Wl,--as-needed +PREFIX?=/usr +DESTDIR?= + +FMRXD_PKGS:=glib-2.0 dbus-glib-1 bluez alsa +FMRXD_CFLAGS:=$(shell pkg-config --cflags $(FMRXD_PKGS)) +FMRXD_LIBS:=$(shell pkg-config --libs $(FMRXD_PKGS)) + +FMRXUTILS_PKGS:=glib-2.0 dbus-glib-1 +FMRXUTILS_CFLAGS:=$(shell pkg-config --cflags $(FMRXUTILS_PKGS)) +FMRXUTILS_LIBS:=$(shell pkg-config --libs $(FMRXUTILS_PKGS)) + +all: fmrxd fmrx-cat fmrx-ctl + +fmrxd: fmrxd.o server.o radio.o bt.o capture.o tuner.o rds.o + $(CC) $(FMRXD_LDFLAGS) $(LDFLAGS) -o $@ $+ $(LIBS) $(FMRXD_LIBS) + +fmrx-cat: fmrx-cat.o + $(CC) $(FMRXUTILS_LDFLAGS) $(LDFLAGS) -o $@ $+ $(LIBS) $(FMRXUTILS_LIBS) + +fmrx-ctl: fmrx-ctl.o + $(CC) $(FMRXUTILS_LDFLAGS) $(LDFLAGS) -o $@ $+ $(LIBS) $(FMRXUTILS_LIBS) + +%.o: %.c + $(CC) $(FMRXD_CFLAGS) $(CFLAGS) -o $@ -c $< + +clean: + rm -f *.o fmrxd fmrx-cat fmrx-ctl + +install: fmrxd fmrx-cat fmrx-ctl + install -d $(DESTDIR)$(PREFIX)/sbin $(DESTDIR)$(PREFIX)/bin + install -d $(DESTDIR)$(PREFIX)/share/dbus-1/system-services + install -m 0755 fmrxd $(DESTDIR)$(PREFIX)/sbin + install -m 0755 fmrx-cat fmrx-ctl $(DESTDIR)$(PREFIX)/bin + install -m 0644 fmrxd.service \ + $(DESTDIR)$(PREFIX)/share/dbus-1/system-services/com.javispedro.fmrxd.service + +uninstall: + rm -f $(DESTDIR)$(PREFIX)/sbin/fmrxd + rm -f $(DESTDIR)$(PREFIX)/bin/fmrx-cat $(DESTDIR)$(PREFIX)/bin/fmrx-ctl + rm -f $(DESTDIR)$(PREFIX)/share/dbus-1/system-services/com.javispedro.fmrxd.service + +.PHONY: all clean install uninstall -- cgit v1.2.3