summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@server-speed.net>2011-03-07 19:00:06 +0100
committerFlorian Pritz <bluewind@server-speed.net>2011-03-20 21:08:32 +0100
commit913ed7c9d756407212c56205d23cc2a06d25511a (patch)
tree72fa248b2cec43cc54487027fe55695b1927cb8d /Makefile
parent483ddd7630faaa5942907659e658db3fe91c898b (diff)
use helper script instead of curl for uploading
Signed-off-by: Florian Pritz <bluewind@server-speed.net>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 15 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index eeb2679..c48bbc4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,33 +1,44 @@
VERSION:=$(shell git describe --dirty | sed 's/^v//')
MANDIR=/usr/share/man
BINDIR=/usr/bin
+LIBDIR=/usr/lib
+CC=gcc
+CFLAGS=-O2 -std=c99 -Wall -Wextra -pedantic
-all: fb.1 fb
+all: fb.1 fb fb-upload
fb: fb.in
@[ -n "$(VERSION)" ] || (echo "Error: version detection failed"; exit 1)
- sed 's/@VERSION@/$(VERSION)/' fb.in > fb
+ sed 's|@VERSION@|$(VERSION)|; s|@LIBDIR@|$(LIBDIR)|' fb.in > fb
chmod 755 fb
+fb.c: fb.c.in
+ sed 's/@VERSION@/$(VERSION)/' fb.c.in > fb.c
+
+fb-upload: fb.c
+ $(CC) $(CFLAGS) -lcurl -lm -o fb-upload fb.c
+
fb.1: fb.pod
pod2man -c "" fb.pod fb.1
clean:
- rm -f fb.1 fb
+ rm -f fb.1 fb fb.c fb-upload
rm -rf dist
install: all
install -Dm755 fb $(DESTDIR)$(BINDIR)/fb
+ install -Dm755 fb-upload $(DESTDIR)$(LIBDIR)/fb-upload
install -Dm644 fb.1 $(DESTDIR)$(MANDIR)/man1/fb.1
uninstall:
rm -f $(DESTDIR)$(BINDIR)/fb
+ rm -f $(DESTDIR)$(LIBDIR)/fb-upload
rm -f $(DESTDIR)$(MANDIR)/man1/fb.1
dist: all
@[ -n "$(VERSION)" ] || (echo "Error: version detection failed"; exit 1)
mkdir -p dist/fb-$(VERSION)
- cp -a fb fb.in fb.pod fb.1 COPYING Makefile dist/fb-$(VERSION)
+ cp -a fb fb.c fb.in fb.pod fb.1 COPYING Makefile dist/fb-$(VERSION)
sed -i 's/^VERSION:=.*$$/VERSION:="'$(VERSION)'"/' dist/fb-$(VERSION)/Makefile
cd dist; tar -czf fb-$(VERSION).tar.gz fb-$(VERSION)