File: Makefile

package info (click to toggle)
suckless-tools 40-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 700 kB
  • sloc: ansic: 2,512; makefile: 465; sh: 104
file content (52 lines) | stat: -rw-r--r-- 1,312 bytes parent folder | download | duplicates (3)
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
# sprop - simple X property utility

include config.mk

SRC = sprop.c
OBJ = ${SRC:.c=.o}

all: options sprop

options:
	@echo sprop build options:
	@echo "CFLAGS   = ${CFLAGS}"
	@echo "LDFLAGS  = ${LDFLAGS}"
	@echo "CC       = ${CC}"

.c.o:
	${CC} -c ${CFLAGS} $<

${OBJ}: config.mk

sprop: ${OBJ}
	${CC} -o $@ ${OBJ} ${LDFLAGS}

clean:
	@echo cleaning
	rm -f sprop ${OBJ} sprop-${VERSION}.tar.gz

dist: clean
	@echo creating dist tarball
	mkdir -p sprop-${VERSION}
	cp -R LICENSE Makefile README config.mk sprop.1 ${SRC} sprop-${VERSION}
	tar -cf sprop-${VERSION}.tar sprop-${VERSION}
	gzip sprop-${VERSION}.tar
	rm -rf sprop-${VERSION}

install: all
	@echo installing executable file to ${DESTDIR}${PREFIX}/bin
	mkdir -p ${DESTDIR}${PREFIX}/bin
	cp -f sprop ${DESTDIR}${PREFIX}/bin
	chmod 755 ${DESTDIR}${PREFIX}/bin/sprop
	echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
	mkdir -p ${DESTDIR}${MANPREFIX}/man1
	sed "s/VERSION/${VERSION}/g" < sprop.1 > ${DESTDIR}${MANPREFIX}/man1/sprop.1
	chmod 644 ${DESTDIR}${MANPREFIX}/man1/sprop.1

uninstall:
	@echo removing executable file from ${DESTDIR}${PREFIX}/bin
	rm -f ${DESTDIR}${PREFIX}/bin/sprop
	@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
	rm -f ${DESTDIR}${MANPREFIX}/man1/sprop.1

.PHONY: all options clean dist install uninstall