aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 3c87b3df884076b03abd94ba414670632524af9a (plain)
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
include config.mk

build: config.h
	${CC} -ljson-c wcli-gen.c -o wcli-gen
	${CC} wcli.c -o wcli

config.h: config.def.h
	cp config.def.h config.h

install: build
	mkdir -p $(PREFIX)/bin
	cp -f wcli wcli-gen wcli-query $(PREFIX)/bin
	chmod 755 ${PREFIX}/bin/wcli
	chmod 755 ${PREFIX}/bin/wcli-gen
	chmod 755 ${PREFIX}/bin/wcli-query
	mkdir -p $(MANPREFIX)/man1
	sed "s/VERSION/${VERSION}/g" < wcli.1 > ${MANPREFIX}/man1/wcli.1
	chmod 644 ${MANPREFIX}/man1/wcli.1


uninstall:
	rm -f ${PREFIX}/bin/wcli\
		${PREFIX}/bin/wcli-gen\
		${PREFIX}/bin/wcli-query\
		${MANPREFIX}/man1/wcli.1

clean:
	rm wcli wcli-gen

.PHONY: build install uninstall clean