File: Makefile

package info (click to toggle)
tmperamental 1.6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 84 kB
  • sloc: ansic: 157; makefile: 57; sh: 20
file content (37 lines) | stat: -rw-r--r-- 1,042 bytes parent folder | download | duplicates (2)
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
prefix		= /usr/
libdir		= ${prefix}lib
pkglibdir	= ${libdir}/tmperamental
bindir		= ${prefix}bin
mandir          = ${prefix}share/man

LIBS		= out/libtmperamental.so
PROGRAMS	= out/tmperamental

ifneq "$(filter Linux GNU%,$(shell uname))" ""
LDLIBS         += -ldl
endif

all: build
build: ${LIBS} ${PROGRAMS}
clean:
	rm -rf out tests/out
install: all
	install -d ${DESTDIR}/${pkglibdir} ${DESTDIR}/${bindir}
	install -m 0644 ${LIBS} ${DESTDIR}/${pkglibdir}/
	install -m 0755 ${PROGRAMS} ${DESTDIR}/${bindir}/
	install -d ${DESTDIR}/${pkglibdir} ${DESTDIR}/${mandir}/man1
	install -m 0644 doc/tmperamental.1 ${DESTDIR}/${mandir}/man1/
check: build
	$(MAKE) -C tests

.PHONY: all build clean install check

out:
	install -d out
out/libtmperamental.so: out/tmperamental.o out
	${CC} ${LDFLAGS} -shared -Wl,--no-as-needed ${LDLIBS} -o $@ $<
out/tmperamental.o: src/tmperamental.c out
	${CC} ${CFLAGS} ${CPPFLAGS} -Wall -fPIC -DPIC -c -o $@ $<
out/tmperamental: src/tmperamental.in out
	sed -e "s,@pkglibdir@,${pkglibdir},g" <$< >$@
	chmod +x $@