Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 70 lines (55 sloc) 2.209 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
# cower - a simple AUR downloader

include config.mk

SRC = conf.c cower.c curl.c download.c package.c pacman.c pkgbuild.c query.c update.c util.c yajl.c
OBJ = ${SRC:.c=.o}

all: options cower doc

options:
@echo cower build options:
@echo "PREFIX = ${PREFIX}"
@echo "MANPREFIX = ${MANPREFIX}"
@echo "CC = ${CC}"
@echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}"

.c.o:
@printf " %-8s %s\n" CC $@
@${CC} -c ${CFLAGS} $<

${OBJ}: config.mk

cower: ${OBJ}
@printf " %-8s %s\n" LD $@
@${CC} -o $@ ${OBJ} ${LDFLAGS}

doc: cower.1
cower.1: README.pod
@printf " %-8s %s\n" DOC cower.1
@pod2man --section=1 --center=" " --release=" " --name="COWER" --date="cower-VERSION" README.pod > cower.1

install: cower cower.1
@printf " %-8s %s\n" INSTALL ${DESTDIR}${PREFIX}/bin/cower
@mkdir -p ${DESTDIR}${PREFIX}/bin
@cp -f cower ${DESTDIR}${PREFIX}/bin
@chmod 755 ${DESTDIR}${PREFIX}/bin/cower
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
@printf " %-8s %s\n" INSTALL ${DESTDIR}${MANPREFIX}/man1/cower.1
@sed "s/\^VERSION/${VERSION}/g" < cower.1 > ${DESTDIR}${MANPREFIX}/man1/cower.1
@chmod 644 ${DESTDIR}${MANPREFIX}/man1/cower.1
@printf " %-8s %s\n" INSTALL ${DESTDIR}/etc/bash_completion.d/cower
@mkdir -p ${DESTDIR}/etc/bash_completion.d
@cp -f cower.bash_completion ${DESTDIR}/etc/bash_completion.d/cower

dist: clean
@mkdir -p cower-${VERSION}
@cp -R ${SRC} *.h Makefile config.mk README.pod cower.bash_completion cower-${VERSION}
@sed "s/VERSION =.*/VERSION = $(shell git describe)/" < config.mk > cower-${VERSION}/config.mk
@printf " %-8s %s\n" TAR cower-${VERSION}.tar
@tar -cf cower-${VERSION}.tar cower-${VERSION}
@printf " %-8s %s\n" GZIP cower-${VERSION}.tar.gz
@gzip cower-${VERSION}.tar
@rm -rf cower-${VERSION}

uninstall:
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
@rm -f ${DESTDIR}${PREFIX}/bin/cower
@echo removing man page from ${DESTDIR}${PREFIX}/man1/cower.1
@rm -f ${DESTDIR}/${PREFIX}/man1/cower.1
@echo removing bash completion
@rm -f ${DESTDIR}/etc/bash_completion.d/cower

clean:
@printf " %-8s %s\n" CLEAN "*.o cower cower.1"
@rm -f *.o cower cower.1

.PHONY: all clean dist doc install options uninstall

Something went wrong with that request. Please try again.