From cf2f0b97355586d75b740d6a0d1f576df436e783 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Mon, 29 Jun 2015 23:10:08 +0200 Subject: Initial commit --- Makefile | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c514d8d --- /dev/null +++ b/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2015 David Härdeman +# + +# +# Generic settings +# +CC = gcc +GENERIC_CFLAGS = -g -Wall -Werror -D_FILE_OFFSET_BITS=64 \ + -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -flto +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}) +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_HDR = utils.h + +DESTDIR ?= +prefix = /usr +usrbindir = ${prefix}/bin +mandir = ${prefix}/share/man + +.SUFFIXES: + +# +# Targets +# + +all: rcm-server +.DEFAULT: all + +%.o: %.c $(RCM_SERVER_HDR) + $(RCM_COMPILE) -o $@ -c $< + +rcm-server: $(RCM_SERVER_OBJ) + $(RCM_LINK) -o $@ $^ + +install: all + $(INSTALL_PROGRAM) -D rcm-server $(DESTDIR)$(usrbindir)/rcm-server + +uninstall: + - rm -f $(DESTDIR)$(usrbindir)/rcm-server + +clean: + - rm -f *.o rcm-server + +.PHONY: install uninstall clean all + -- cgit v1.2.3