summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile38
1 files changed, 30 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 9b601f3..571427b 100644
--- a/Makefile
+++ b/Makefile
@@ -11,16 +11,26 @@ GENERIC_CFLAGS = -g -Wall -Werror -D_FILE_OFFSET_BITS=64 \
EXTRA_CFLAGS =
GENERIC_LDFLAGS =
EXTRA_LDFLAGS =
+
RCM_PACKAGES = libudev libsystemd
RCM_CFLAGS = ${GENERIC_CFLAGS} ${EXTRA_CFLAGS} $(shell pkg-config --cflags ${RCM_PACKAGES})
RCM_LDFLAGS = ${GENERIC_LDFLAGS} ${EXTRA_LDFLAGS} $(shell pkg-config --libs ${RCM_PACKAGES})
+RCM_COMPILE = $(CC) $(RCM_CFLAGS)
+RCM_LINK = $(CC) $(RCM_CFLAGS) $(RCM_LDFLAGS)
+RCM_OBJECTS = rcm-server-main.o rcm-server-keymap.o
+RCM_HEADERS = rcm-server-main.h rcm-server-keymap.h utils.h
+
+RCC_PACKAGES = gtk+-3.0
+RCC_CFLAGS = ${GENERIC_CFLAGS} ${EXTRA_CFLAGS} $(shell pkg-config --cflags ${RCC_PACKAGES})
+RCC_LDFLAGS = ${GENERIC_LDFLAGS} ${EXTRA_LDFLAGS} $(shell pkg-config --libs ${RCC_PACKAGES})
+RCC_COMPILE = $(CC) $(RCC_CFLAGS)
+RCC_LINK = $(CC) $(RCC_CFLAGS) $(RCC_LDFLAGS)
+RCC_OBJECTS = rcm-client-main.o rcm-client-hardware-list.o rcm-client-hardware-info.o rcm-client-receive.o rcm-client-transmit.o generated.o
+RCC_HEADERS = rcm-client-main.h rcm-client-hardware-list.h rcm-client-hardware-info.h rcm-client-receive.h rcm-client-transmit.h generated.h
+
INSTALL = install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
-RCM_COMPILE = $(CC) $(RCM_CFLAGS)
-RCM_LINK = $(CC) $(RCM_CFLAGS) $(RCM_LDFLAGS)
-RCM_SERVER_OBJ = rcm-server.o rcm-server-keymap.o
-RCM_SERVER_HDR = rcm-server.h rcm-server-keymap.h utils.h
DESTDIR ?=
prefix = /usr
@@ -33,13 +43,25 @@ mandir = ${prefix}/share/man
# Targets
#
-all: rcm-server
+all: rcm-server rcm-client
.DEFAULT: all
-%.o: %.c $(RCM_SERVER_HDR)
+rcm-client-%.o: rcm-client-%.c $(RCC_HEADERS)
+ $(RCC_COMPILE) -o $@ -c $<
+
+generated.o: generated.c generated.h
+ $(RCC_COMPILE) -o $@ -c $<
+
+generated.c generated.h: RemoteControlManager.xml
+ gdbus-codegen --interface-prefix org.gnome --c-generate-object-manager --generate-c-code generated RemoteControlManager.xml
+
+rcm-client: $(RCC_OBJECTS)
+ $(RCC_LINK) -o $@ $^
+
+rcm-server-%.o: rcm-server-%.c $(RCM_HEADERS)
$(RCM_COMPILE) -o $@ -c $<
-rcm-server: $(RCM_SERVER_OBJ)
+rcm-server: $(RCM_OBJECTS)
$(RCM_LINK) -o $@ $^
install: all
@@ -49,7 +71,7 @@ uninstall:
- rm -f $(DESTDIR)$(usrbindir)/rcm-server
clean:
- - rm -f *.o rcm-server
+ - rm -f generated.[ch] *.o rcm-server rcm-client
.PHONY: install uninstall clean all