From eb49f6926581f9f9d7e6d9853ad41533fd779c07 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 30 Oct 2013 15:38:01 +0100 Subject: use a little helper to determine architecture Architecture reported by `uname -a` and used by pacman are not neccessarily the same, so use a little helper. --- Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 78798a4..f41b033 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,6 @@ CFLAGS += $(shell pkg-config --libs --cflags libcurl) CFLAGS += $(shell pkg-config --libs --cflags avahi-client) CFLAGS += $(shell pkg-config --libs --cflags libmicrohttpd) VERSION := $(shell git describe --tags --long 2>/dev/null) -ARCH := $(shell uname -m) # this is just a fallback in case you do not use git but downloaded # a release tarball... ifeq ($(VERSION),) @@ -20,6 +19,9 @@ endif all: pacredir avahi/pacdbserve.service README.html +arch: arch.c config.h + $(CC) -o arch arch.c + pacredir: pacredir.c config.h $(CC) $(CFLAGS) -o pacredir pacredir.c \ -DVERSION="\"$(VERSION)\"" @@ -27,8 +29,8 @@ pacredir: pacredir.c config.h config.h: $(CP) config.def.h config.h -avahi/pacdbserve.service: avahi/pacdbserve.service.in - $(SED) 's/%ARCH%/$(ARCH)/' avahi/pacdbserve.service.in > avahi/pacdbserve.service +avahi/pacdbserve.service: arch avahi/pacdbserve.service.in + $(SED) 's/%ARCH%/$(shell ./arch)/' avahi/pacdbserve.service.in > avahi/pacdbserve.service README.html: README.md $(MD) README.md > README.html @@ -49,4 +51,4 @@ install-doc: README.html $(INSTALL) -D -m0644 README.html $(DESTDIR)/usr/share/doc/paccache/README.html clean: - $(RM) -f *.o *~ pacredir avahi/pacdbserve.service README.html + $(RM) -f *.o *~ arch pacredir avahi/pacdbserve.service README.html -- cgit v1.2.3-54-g00ecf